Skip to content

Instantly share code, notes, and snippets.

@burhandodhy
Created March 15, 2018 18:03
Show Gist options
  • Save burhandodhy/bd1be9dc402397dc3e6e550137a593d6 to your computer and use it in GitHub Desktop.
Save burhandodhy/bd1be9dc402397dc3e6e550137a593d6 to your computer and use it in GitHub Desktop.
Get Instagram Follower Counts
<?php
$username = 'burhandodhy';
$response = @file_get_contents( "https://www.instagram.com/$username/?__a=1" );
if ( $response !== false ) {
$data = json_decode( $response, true );
if ( $data !== null ) {
$full_name = $data['graphql']['user']['full_name'];
$follower = $data['graphql']['user']['edge_followed_by']['count'];
echo "{$full_name} have {$follower} followers.";
}
} else {
echo 'Username not found.';
}
?>
@porp
Copy link

porp commented Jun 24, 2020

not working anymore...

@yassinebzk
Copy link

not working

@mostmojo
Copy link

carbon

@StevenMorrison26
Copy link

This code doesn't work for me, usually I use Google Chrome extension.

@krwlng
Copy link

krwlng commented Nov 24, 2020

It's work for my Accounts. Thanks, good job.

@nsa14
Copy link

nsa14 commented Dec 14, 2020

this code not working for me...

@Dinaa95
Copy link

Dinaa95 commented Feb 3, 2021

Anyone managed how to get an instagram follower counter in 2021? :C

@whiteLT
Copy link

whiteLT commented Feb 7, 2021

Anyone?

@abdo-host
Copy link

We need help about it

@jashan2211
Copy link

If its not working for you. Insta blocked you from sending any more requests.

@yo00kitan
Copy link

This is not working!!

@Thomasdouscha
Copy link

this is not working!

@fishheadcode
Copy link

Its working like a charm, maybe you all dont have a cert installed? can you do curl on ssl? if not, you need a certificate on your local server. a pem/cert file (on xampp) or similar. i dont got any problems here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment