Main menu
WalkswithMeSocial NetworkingInstagram Tumblr Youtube followers using PHP

Instagram Tumblr Youtube followers using PHP

Instagram Tumblr Youtube followers using php is really simple and no need of any Oauth API setup. just setup your APP and using that, you will be able to get all the details. I hope you already read my post regarding Twitter Facebook Gplus and pintrest followers.

Instagram Followers

For getting Instagram followers count first you have to signup with Instagram and have an APP ID and USER ID. for registering Instagram application. Once you register the app you will get an API Key and secret.


$api_key = 'API_KEY';
$user_id = 'UID';
$data = @file_get_contents("https://api.instagram.com/v1/users/$user_id/?client_id=$api_key");
$data = json_decode($data, true);
echo '<pre/>';
print_r($data);
echo $data['data']['counts']['followed_by'];

If you are not able to figure out your User Id but you know the Instagram username just visit the page inspect the profile image and collect the user id :).

Youtube Subscribers

For getting subscribers count of your Youtube channel you can simply use the following scripts.


$channel_name = 'Your Channel';
$data = file_get_contents("http://gdata.youtube.com/feeds/api/users/$channel_name?alt=json");
$data = json_decode($data, true);
$subscribersDetails = $data['entry']['yt$statistics'];
echo $subscribersDetails['subscriberCount'].'<br />';
echo $subscribersDetails['viewCount'].'<br />';
Tumblr Likes

Tumblr Likes using API is really simple but followers is little complicated bcoz tumblr set it permission to Oauth API with a valid API key you will be able to read your tumblr blog info. First you have to create an APP with tumblr.

Login to Tumblr -> Setting Menu -> APP ->Register your APP get the API Key and secret key.


$api_key = 'API_KEY';
$blog_name = 'Blog_name';
$data = @file_get_contents("http://api.tumblr.com/v2/blog/$blog_name/info?api_key=$api_key");
$data = json_decode($data, true);
echo '<pre/>';
print_r($data);
echo $data['response']['blog']['likes'];
Instgram Youtube Tumblr followers using PHP

Instgram Youtube Tumblr followers using PHP

If you like to round your followers count to 10K and 10M simply use like below.


if ($followers_count > 999 && $followers_count <= 999999) {
$result = floor($followers_count / 1000) . ' K';
} elseif ($followers_count > 999999) {
$result = floor($followers_count / 1000000) . ' M';
} else {
$result = $followers_count;
}

Hope this article will help you to get Instagram Youtube and Tumblr Followers using PHP/Javascript .

Thanks for  reading :):):)

3 thoughts on “Instagram Tumblr Youtube followers using PHP

  1. Looks like the provided code for tumblr doesnot provide followers count instead it give the user details only so please modify the title of the post or provide the codes for the followers count of tumblr

    Thanks

  2. I tried the code for instagram, but that didnot work for me, i apply certain tweaks then it worked for me, i applied client_id and access token.
    “https://api.instagram.com/v1/users/”.$user_id.”/?access_token=”.$access_token”

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

FacebookTwitterGoogle+RSS