UPDATE:
Following this answer, a way to retrieve the ID with a given username
https://stackoverflow.com/a/14979901/3032128
If you have a list of users with ids or something you can use autocomplete function from JQuery UI just as this example http://jqueryui.com/autocomplete/#custom-data where you will save the ID from the selected user in a hidden field such as
<input type="hidden" id="user_id">
that is the field that will be processed instead of the one you enter the ID or name,
your javascript will look like
$(document).ready(function() {
//see JSON datasource for remote load if thats the case
var users= [
{
value: "1",
label: "JohnDoe"
} // [...]
];
$( "#user" ).autocomplete({
minLength: 0,
source: users,
select: function( event, ui ) {
$( "#user" ).val( ui.item.label );
$( "#user_id" ).val( ui.item.value );
return false;
}
})
});
EDIT: another useful link http://jelled.com/instagram/lookup-user-id
hope that helps