I am trying to use Facebook’s graph API to access every post in a group’s feed, along with the number of reactions of each type, for every post.
When I try with just one reaction type, it works fine:
[GROUP_ID]/feed/?fields=message,from,created_time,updated_time,reactions.type(LOVE).limit(0).summary(total_count)&limit=1
However, when I add multiple reaction types, I receive an error.
[GROUP_ID]/feed?fields=message,from,created_time,updated_time,reactions.type(LOVE).limit(0).summary(total_count),reactions.type(WOW).limit(0).summary(total_count)&limit=1
gives me:
{
"error": {
"message": "Syntax error "Field reactions specified more than once. This is only possible before version 2.1" at character 139: message,from,created_time,updated_time,reactions.type(LOVE).limit(0).summary(total_count),reactions.type(WOW).limit(0).summary(total_count)",
"type": "OAuthException",
"code": 2500,
"fbtrace_id": "GzMCG2dRioK"
}
}
I followed the syntax in this post, however it seems to only work when trying to access reactions for a single post, not for every post in a feed. Is the only option to use the API to grab the post ID’s for every post in the feed, and then make individual calls on every post?
2
Answers
Try this:
Then you find instead of
reactions
the fieldsreactions_love
andreactions_wow
with your desired data. You can add all types and it is shortened here for a better overview 😉You can get around the aliasing issue, and still receive what you need, by asking for the following:
(I found it here: Getting Facebook Post all Reactions Count in single Graph API request)