Getting Facebook Reactions with Graph API

后端 未结 7 1937
你的背包
你的背包 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:12

    The new reaction are not being counted at all right now. the current API is only surfacing the count for the like button, wow, sad, ETC clicks are not being counted in the likes bucket

    0 讨论(0)
  • 2020-12-23 21:14

    Facebook just released Graph API 2.6 and the reaction endpoint is available like so

    GET /v2.6/{object-id}/reactions
    

    Which returned something like

    {
      "data": [
        {
          "id": "ACCOUNT-ID",
          "name": "ACCOUNT-NAME",
          "type": "HAHA"
        },
        {
          "id": "ACCOUNT-ID",
          "name": "ACCOUNT-NAME",
          "type": "LIKE"
        }
      ],
      "paging": {
        "cursors": {
          "before": "TkRZAMU9EWTROakF6TmpBM01qYzJPak2TnpnNE5qUTRNRE0zT1RFek16RXkZD",
          "after": "TVRBd01EQTNOekEwTWpnME1EUTJPakUwTazJNVFl4TXc9PQZDZD"
        }
      }
    }
    

    More infos here : https://developers.facebook.com/docs/graph-api/reference/post/reactions/

    0 讨论(0)
  • 2020-12-23 21:14

    The next version of the GraphAPI (2.6) is due out in March/April timeframe -- so I would expect to see it there.

    0 讨论(0)
  • 2020-12-23 21:20

    New reactions picture: http://i.stack.imgur.com/d6kcp.jpg

    There aren't any information about this topic so I want to add somethings.

    The next version of the GraphAPI (2.6) is due out in March/April timeframe -- so I would expect to see it there. (Thank you Justin Bowler)

    Now at the graph api 2.5 new facebook reactions don't counting. If you look at post likes you can't see them so we must wait new api version.

    0 讨论(0)
  • 2020-12-23 21:24

    The reactions are already available via insights API v2.5. You can get them on post level via post_reactions_by_type_total edge and on page level via page_actions_post_reactions_total edge.

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题