Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Facebook reactions total_count for each type of reaction

In Graph Api 2.6 with the new Reactions edge, Is there way to get the summary that include total_count for each reaction ?

I mean, something like this :

"summary": {
      "total_count": 51,
      "total_count_HAHA":23,
      "total_count_LOVE":28,
      "viewer_reaction": "NONE"
    }

there is only "total_count" right now.

like image 976
user1105951 Avatar asked Apr 17 '16 12:04

user1105951


2 Answers

20531316728_10154835146021729?fields=
    reactions.type(LIKE).summary(total_count).limit(0).as(like),
    reactions.type(LOVE).summary(total_count).limit(0).as(love),
    reactions.type(WOW).summary(total_count).limit(0).as(wow),
    reactions.type(HAHA).summary(total_count).limit(0).as(haha),
    reactions.type(SAD).summary(total_count).limit(0).as(sad),
    reactions.type(ANGRY).summary(total_count).limit(0).as(angry)
like image 125
David Beneš Avatar answered Nov 16 '22 00:11

David Beneš


The only thing I can think of is to make multiple API calls for each reaction type... If you limit your reactions to type=HAHA, the total_count will only count HAHAs. Certainly not the most efficient approach, but workable depending on what you are trying to accomplish...

like image 45
QuotidianVoid Avatar answered Nov 16 '22 00:11

QuotidianVoid