Saturday, August 6, 2016

Get share count from Graph API efficiently

Leave a Comment

I am trying to get information about a set of user posts (last 20 posts). For each post, I would like to simply get likes, comments and shares count.

So far I was able to get the like and comment count, but I had no luck in retrieving the share count.

This is the query I used:

https://graph.facebook.com/me?access_token=x&limit=20&fields=id,comments.limit(0).summary(true),likes.limit(0).summary(true)

I understand that there are ways to retrieve the share count using the object id, but I would like to refrain from making 20 different requests in order to obtain this field.

Is there any other way that I can make a single batch request to achieve this?

1 Answers

Answers 1

You can get share count through engagement field of the object, as mentioned here : http://stackoverflow.com/a/5700882/533399

For batching your requests, graph api already supports batch requests :

https://developers.facebook.com/docs/graph-api/making-multiple-requests

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment