Question

I have a blog where users share some of the articles on Facebook. I would like to know:

With Facebook API is it possible to get the shares, and the likes filter per day?

I do not just want the total of shares over all time but I want to get the shares, and likes per day.

Is it even possible?

Was it helpful?

Solution

Insights are only available for

Applications, Pages, and Domains with 30 or more connections

see https://developers.facebook.com/docs/reference/fql/insights/

If you want to get the stats links, and I guess your articles are just links for Facebook, then you can use the link_stat FQL table: https://developers.facebook.com/docs/reference/fql/link_stat/

You can query it like this:

select url, like_count, click_count, share_count, comment_count from link_stat where url="http://www.cnn.com"

Notice that you can't specify a certain timeframe/day. This means that you have to query this recurrently every day and store the results in some database yourself.

Also, be aware that FQL will be deprecated on April 30th, 2016. There's also the possibilty to request the overall metrics per URL via the old REST API:

 https://api.facebook.com/restserver.php?method=links.getStats&urls=http://www.cnn.com&format=json

But who knows when this will be deprecated as well :-/ It's not even in their docs anymore, but still working.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top