How to get other pages followers count number in Instagram?

eMKa picture eMKa · Jan 20, 2016 · Viewed 32.3k times · Source

is there possibility to get other pages follower count number in Instagram? I can get only my profile followers count number, but I want to get other followers too? (for example in php)

Any ideas?

Answer

rNix picture rNix · Nov 23, 2016

Yes, it's possible with ?__a=1 queries which return json.

$otherPage = 'nasa';
$response = file_get_contents("https://www.instagram.com/$otherPage/?__a=1");
if ($response !== false) {
    $data = json_decode($response, true);
    if ($data !== null) {
        $follows = $data['graphql']['user']['edge_follow']['count'];
        $followedBy = $data['graphql']['user']['edge_followed_by']['count'];
        echo $follows . ' and ' . $followedBy;
    }
}