Shared Count

Track your shares, likes, tweets, and more.

API Information

At this time, there are no rate limits. Values are cached for 5 minutes at a time. So, values may be up to 5 minutes old for repeated queries.

You can retrieve the counts from a JSON and JSONP API:
HTTP Endpoint: http://api.sharedcount.com/
HTTPS Endpoint: https://sharedcount.appspot.com/

Parameters

Note: The way in which you pass the URL will effect the results, depending on the service. Some services will return different results, depending on if you include a trailing slash on the URL.

Sources

We retrieve the data from the official 'Share' buttons provided by these major services. All of the services provide a JSON API for accessing the shared counts for particular URLs.

* Note: As of 8/1/2011, this Facebook endpoint requires authentication for end users; we take care of this authentication for you. For an unauthenticated endpoint, you can use http://graph.facebook.com/%%URL%%, but this does not include differentation of counts.

Sample Code - PHP 5+


<?php
$url 
= ((!empty($_SERVER['HTTPS'])) ? "https://""http://" ) . $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$json file_get_contents("http://api.sharedcount.com/?url=" rawurlencode($url));
$counts json_decode($jsontrue);
echo 
"This page has " $counts["Twitter"] ." tweets, " $counts["Facebook"]["like_count"] . " likes, and "$counts["GooglePlusOne"] . "+1's";
?>

Result:

This page has 10 tweets, 0 likes, and 0+1's

Sample Code - JSONP

Using jQuery:

<div style="display:none;" id="sharedcount">
This page has <span id="tweets">0</span> tweets, <span id="likes">0</span> likes, and <span id="plusones">0</span> +1's.
<div> <script>
jQuery(document).ready(function($){
$.getJSON("//sharedcount.appspot.com/?url="+encodeURIComponent(location.href)+"&callback=?", function(data){ $("#tweets").text(data.Twitter); $("#likes").text(data.Facebook.like_count); $("#plusones").text(data.GooglePlusOne); $("#sharedcount").fadeIn(); });
});
</script>

Result:

This page has 0 tweets, 0 likes, and 0 +1's.