This post will help you to find snippets to get followers count for social platforms like Facebook, Twitter, Google plus, Youtube, Instagram, Pinterest and Tumblr.
Facebook Followers Count
Twitter followers Count
Google Plus Followers Count
Youtube Subscribers
Instagram Followers
Register the app you will get an API Key and secret.
Pinterest Followers Count
Tumblr Likes
Login to Tumblr -> Setting Menu -> APP ->Register your APP get the API Key and secret key.
Facebook Followers Count
$FBFollowercount = file_get_contents('http://api.facebook.com/method/fql.query?format=json&query=select+fan_count+from+page+where+page_id%3D355692061120689');
$data = json_decode($FBFollow);
echo $data[0]->fan_count;
Twitter followers Count
require_once 'twitteroauth.php';
define("CONSUMER_KEY", "****consumer key*******");
define("CONSUMER_SECRET", "*******Consumer secret********");
define("OAUTH_TOKEN", "**********Oauth token*******");
define("OAUTH_SECRET", "*****Oauth Secret********");
$username = 'Walkswithmenet'; //Your twitter screen name or page name
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_SECRET);
$followers = $connection->get('https://api.twitter.com/1.1/users/show.json?screen_name='.$username);
echo ($followers->followers_count);
Google Plus Followers Count
/ get api https://code.google.com/apis/console?hl=en#access
$google_api_key = 'YOUR_API';
$page_id = 'YOUR_PAGE_ID';
$data = @file_get_contents("https://www.googleapis.com/plus/v1/people/$page_id?key=$google_api_key");
$data = json_decode($data, true);
echo $data['plusOneCount'];
Youtube Subscribers
$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 />';
Instagram Followers
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'];
Pinterest Followers Count
$metas = get_meta_tags('http://pinterest.com/YOUR PINTREST ACCOUNT NAME/');
print_r($metas['pinterestapp:followers']);
Tumblr Likes
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'];
10 comments :