Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get other pages followers count number in Instagram?

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?

like image 673
eMKa Avatar asked Jan 20 '16 17:01

eMKa


People also ask

How do you see someones Instagram followers number?

Visit someone's profile and tap on the Followers list from your mobile. There you will see their followers displayed in chronological order. This means the recent followers will be displayed at the very top.

Why can't I see someone's number of followers on Instagram?

if you follow him/her than he/she put privacy on it, that no one can see his/her followers. But if you didn't follow him/her than his account is private. you have send follow request to him/her. And if he/she accepted your follow request than you will see his/her followers.


2 Answers

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;
    }
}
like image 51
rNix Avatar answered Sep 24 '22 19:09

rNix


Jumping through hoops to get an app approved for quickly checking follower counts seemed excessive so I had a look at network requests on Instagram's web search and saw that typing in the search box fires off requests to this URL:

https://www.instagram.com/web/search/topsearch/?query={searchquery}

That returns a JSON feed which has a bunch of info on the user including a value for follower_count. If you are logged in, the results are weighted by relevance to your account, but you don't have to be authenticated or even logged in to get a result:

{
"has_more": false, 
"status": "ok", 
"hashtags": [], 
"users": [
            {
            "position": 0, 
            "user": {
                "username": "thenativepaul", 
                "has_anonymous_profile_picture": false, 
                "byline": "457 followers", 
                "mutual_followers_count": 0.0, 
                "profile_pic_url": "https://scontent-lhr3-1.cdninstagram.com/t51.2885-19/11373838_482400848607323_1803683048_a.jpg", 
                "full_name": "Paul Almeida-Seele", 
                "follower_count": 457, 
                "pk": 21072296, 
                "is_verified": false, 
                "is_private": false
                }
            }, 
            {
            "position": 1, 
            "user": {
                "username": "the_native_warrior", 
                "has_anonymous_profile_picture": false, 
                "byline": "251 followers", 
                "mutual_followers_count": 0.0, 
                "profile_pic_url": "https://scontent-lhr3-1.cdninstagram.com/t51.2885-19/s150x150/14473927_312669442422199_4605888521247391744_a.jpg", 
                "profile_pic_id": "1352745514521408299_1824600282", 
                "full_name": "Paul Carpenter", 
                "follower_count": 251, 
                "pk": 1824600282, 
                "is_verified": false, 
                "is_private": true
                }
            }
        ], 
"places": [ ]
}
like image 41
NativePaul Avatar answered Sep 24 '22 19:09

NativePaul