Getting Facebook Reactions with Graph API

EDIT: As of April 12th, 2016 Facebook has published a reactions endpoint for posts as part of their v2.6 release of the GraphAPI

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

More information can be found here: https://developers.facebook.com/docs/graph-api/reference/post/reactions

END EDIT

I’m not sure if Facebook has published this yet, but the reaction information is currently available in the Graph API v2.5. I pasted the response below. I achieved this result by hitting the insights endpoint. For each object listed in the response below, take a look at the ‘id’ property, it has more granular query endpoints.

GET /v2.5/{object-id}/insights

RESPONSE:

   {
  "name": "post_reactions_like_total",
  "period": "lifetime",
  "values": [
    {
      "value": 0
    }
  ],
  "title": "Lifetime Like Reactions",
  "description": "Lifetime: The total number of like reactions to your post.",
  "id": "{node_id}/insights/post_reactions_like_total/lifetime"
},
{
  "name": "post_reactions_love_total",
  "period": "lifetime",
  "values": [
    {
      "value": 0
    }
  ],
  "title": "Lifetime Love Reactions",
  "description": "Lifetime: The total number of love reactions to your post.",
  "id": "{node_id}/insights/post_reactions_love_total/lifetime"
},
{
  "name": "post_reactions_wow_total",
  "period": "lifetime",
  "values": [
    {
      "value": 0
    }
  ],
  "title": "Lifetime Wow Reactions",
  "description": "Lifetime: The total number of wow reactions to your post.",
  "id": "{node_id}/insights/post_reactions_wow_total/lifetime"
},
{
  "name": "post_reactions_haha_total",
  "period": "lifetime",
  "values": [
    {
      "value": 0
    }
  ],
  "title": "Lifetime Haha Reactions",
  "description": "Lifetime: The total number of haha reactions to your post.",
  "id": "{node_id}/insights/post_reactions_haha_total/lifetime"
},
{
  "name": "post_reactions_sorry_total",
  "period": "lifetime",
  "values": [
    {
      "value": 0
    }
  ],
  "title": "Lifetime Sorry Reactions",
  "description": "Lifetime: The total number of sorry reactions to your post.",
  "id": "{node_id}/insights/post_reactions_sorry_total/lifetime"
},
{
  "name": "post_reactions_anger_total",
  "period": "lifetime",
  "values": [
    {
      "value": 0
    }
  ],
  "title": "Lifetime Anger Reactions",
  "description": "Lifetime: The total number of anger reactions to your post.",
  "id": "{node_id}/insights/post_reactions_anger_total/lifetime"
},
{
  "name": "post_reactions_by_type_total",
  "period": "lifetime",
  "values": [
    {
      "value": {
        "like": 0,
        "love": 0,
        "wow": 0,
        "haha": 0,
        "sorry": 0,
        "anger": 0
      }
    }
  ],
  "title": "Lifetime Reactions by type",
  "description": "Lifetime: The total number of reactions to your post by type.",
  "id": "{node_id}/insights/post_reactions_by_type_total/lifetime"
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)