We have all been sharing stuffs and links to the social and bookmarking sites for long, and specially if you blog or visit blogs, you have a nice idea of sharing stuffs. A count of that is kept by every such sites to let you know how many times that particular link has been shared on that site. Ever wondered how to get those like or share counts without the like or share buttons? Say you want total counts of how many time your particular article has been liked on Facebook or tweeted on Twitter or stumbled upon on Stumbleupon, pinned in Pinterest. What I show you below will require basic json understanding. You can learn basics of json here. Once you get the json you can parse the json and print the count of shares or like as you wish. So here is how you get the like and share counts of different social and bookmarking sites.
- Google+
- Stumble Upon
https://api.facebook.com/method/fql.query?query=select%20%20like_count%20from%20link_stat%20where%20url=%22http://codepixelz.com/%22
Replace: http://codepixelz.com/ with the page or link you want the counts for.
http://urls.api.twitter.com/1/urls/count.json?url=http://codepixelz.com/
Replace: http://codepixelz.com/ with the page or link you want the counts for.
http://www.linkedin.com/countserv/count/share?url=http://codepixelz.com/
Replace: http://codepixelz.com/ with the page or link you want the counts for.
http://www.linkedin.com/countserv/count/share?url=http://codepixelz.com&format=json
Replace: http://codepixelz.com/ with the page or link you want the counts for.
http://www.stumbleupon.com/services/1.01/badge.getinfo?url=http://codepixelz.com
Replace: http://codepixelz.com/ with the page or link you want the counts for.
http://api.pinterest.com/v1/urls/count.json?callback=&url=http://codepixelz.com
Replace: http://codepixelz.com/ with the page or link you want the counts for.