Facebook is the largest social network.

Information about obtaining an app access token for this source can be found at http://developers.facebook.com/docs/howtos/login/login-as-app/. Access tokens are required for production use because of rate-limiting.

Since January 2013 Facebook aggregates the stats from DOIs (e.g. http://dx.doi.org/10.1371/journal.pone.0035869) with those from the journal landing page (e.g. http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0035869), so that multiple API calls per article are no longer necessary, but the results aren't consistent. Since URLs with query parameters (e.g. ?pid=S1415-47572009000400031&lng=en&nrm=iso&tlng=en) can cause problems, we use the DOI.

Facebook has problems with DOIs that require cookies during DOI resolution. We talk to Facebook via the Graph API, the old REST API will return the same results via http://api.facebook.com/restserver.php?method=links.getStats&urls=URL, but has been depreciated.

Required configuration fields

ALM Name facebook
ALM Configuration staleness: [ 1.day, 1.day, 1.month * 0.25, 1.month]
ALM Core Attributes  
ALM Other Attributes  
Protocol REST
Format JSON
Rate-limiting varies
Authentication OAuth 2.0 (optional)
Restriction by IP Address no
API URL https://graph.facebook.com/fql?q=select url, share_count, like_count, comment_count, click_count, total_count, comments_fbid, commentsbox_count from link_stat where url = 'DOI_AS_URL'
License unknown

Example Response

{
  "commentsbox_count": 0,
  "like_count": 0,
  "url": "http://www.plosbiology.org/article/info:doi/10.1371/journal.pbio.0000002",
  "comments_fbid": 10150608377818440,
  "total_count": 3,
  "comment_count": 0,
  "share_count": 3,
  "click_count": 0
}

Source Code

The source code is available here.

Further Documentation