Manuel Reis
Manuel Reis

Reputation: 574

Get share count from Graph API efficiently

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?

Upvotes: 4

Views: 2452

Answers (1)

DhruvPathak
DhruvPathak

Reputation: 43235

You can get share count through engagement field of the object, as mentioned here : https://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

Upvotes: 1

Related Questions