I want to fetch the instagram followers count for various users from my app using jquery / javascript. I tried the below code but i see 404 error:
var $url = 'https://api.instagram.com/v1/users/'+user_id+'/?access_token='+$access_token;
$.ajax({
method: "GET",
url: $url,
dataType: "jsonp",
jsonp : "callback",
success: function(data) {
console.log(data);
}
});
My access token is created with scope public_content.
Apart from this I also tried fetching the page content as below without access token:
$.ajax({
url: 'https://www.instagram.com/'+user_id+'/?__a=1',
type: 'GET',
data: {},
dataType: jsonp,
success: function(data) {
console.log(data);
}
});
But this throws CORS error. Please help.