Getting Facebook Reactions with Graph API

后端 未结 7 1964
你的背包
你的背包 2020-12-23 20:47

Facebook just released the new reaction button, but I can\'t figure out a way to get this information from the Graph API v2.5 as the /likes edge only returns the total count

7条回答
  •  半阙折子戏
    2020-12-23 21:33

    Try

    GET /v2.5/{post_id}/insights/post_reactions_by_type_total
    

    Which returns

    {
     "data": [
      {
         "name": "post_reactions_by_type_total",
         "period": "lifetime",
         "values": [
            {
               "value": {
                  "like": 9,
                  "love": 0,
                  "wow": 1,
                  "haha": 0,
                  "sorry": 0,
                  "anger": 0
               }
            }
         ],
         "title": "Daily total post reactions by type.",
         "description": "Daily total post reactions by type.",
         "id": "{post_id}/insights/post_reactions_by_type_total/lifetime"
       }
     ],
    }
    

    I have had some luck using the same in Facebook Graph API 2.3, but not for every request

提交回复
热议问题