Getting other account's followers count by using Instagram API

点点圈 提交于 2019-12-12 06:48:19

问题


I want to show lists of famous Instagram Users with their followers count and profile pictures in my project.
Is there any possible ways I can get real time followers count of other accounts by using there account id only? (I am developing with javascript, jsp, ajax). Please Help!


回答1:


Please try this,

$userID = "miketyson";
$myToken = "***some_valid_access_token***";

$userURL = "https://api.instagram.com/v1/users/" . $userID . "/?access_token=" . $myToken;
$fgc = url_get_contents($userURL);
$jsonUser = json_decode(json_encode($fgc));

//now, we have all information about user.

$bio = $jsonUser->data->bio;
$website = $jsonUser->data->website;
$mediaCount = $jsonUser->data->counts->media;
$follows = $jsonUser->data->counts->follows;
$followedby = $jsonUser->data->counts->followed_by;

echo "There is ".$followedby." followers of ".$userID;

I do not have valid access token now, but I developed a instagram.com like website in the past :)



来源:https://stackoverflow.com/questions/43989516/getting-other-accounts-followers-count-by-using-instagram-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!