Pulling Social Share figures

Below is a quick reference on pulling stats for the amount of times a given url has been shared on the following sites.

Facebook

The counts include the number of shares, likes and comments on a shared link - note that the total count of the "like" button displayed on a website is the sum of likes + shares + comments.

Pass the following url, or paste it into a browser;

http://api.facebook.com/restserver.php?method=links.getStats&urls='http://www.richardallen.co.uk'
This will respond with the following xml;
  
<links_getStats_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
<link_stat>
<url>http://www.richardallen.co.uk</url>;
<normalized_url>http://www.richardallen.co.uk/</normalized_url>;
<share_count>3</share_count>
<like_count>2</like_count>
<comment_count>6</comment_count>
<total_count>11</total_count>
<click_count>0</click_count>
<comments_fbid>10150774609023711</comments_fbid>
<commentsbox_count>0</commentsbox_count>
</link_stat>
</links_getStats_response>

Twitter

You can pass the following url, or paste into a browser;

http://urls.api.twitter.com/1/urls/count.json?url=http://google.com  

Which will respond with the following JSON;

  
{"count":2730,"url":"http:\/\/google.com\/"}

Enjoy,

Rich.

Show Comments