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.';
}
?>
@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