问题
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