/{object-id}/reactions
This reference describes the /reactions
edge that is common to multiple Graph API nodes. The structure and operations are the same for each node, except that for the following nodes, /reactions
doesn't return a profile except for the current user, if read with a user access token:
The following objects have this edge:
ads_management
manage_pages
pages_show_list
pages_show_list
Returns the reaction of the User or Page querying the object.
Also, view Insights for more information on Page and Post reactions.
The following example is a GET
request made by a User who has reacted to their own object.
curl -i -X GET \
"https://graph.facebook.com/your-post-id/reactions?access_token=your-user-access-token"
{ "data": [ { "id": "your-user-id", "name": "Your Name", "type": "HAHA" } ], "paging": { "cursors": { "before": "QVFIUk5YbXFFbG8yVWVOa2w0ZAGhmSUNKMkZAZAOXZARbzJOMHM0TUFtZAnhJbWdPdkF4OURUTHJrQjFqQ2RQZAVN1UGxSVU5FWURENnE4OUFPeXFreU1jV09pdFJR", "after": "QVFIUkpsWVRkcVl6SlhsdWlrcGdudl8xVEhwVEJ5ZA3FXdG90bTRxam13NmJDUGpQVnB5ZA29lMG9FVmFaeU1BLW1hc2oZD" } } }
If the User or Page has not reacted to the object being queried, data
will be empty.
The following example is a GET
request for the total reactions to an object.
curl -i -X GET \
"https://graph.facebook.com/your-post-id
?fields=reactions.summary(total_count)
&access_token=your-access-token"
The JSON Response if the User or Page has reacted to their own object.
{ "reactions": { "data": [ { "id": "your-user-id", "name": "Your Name", "type": "HAHA" } ], "paging": { "cursors": { "before": "QVFIUk5YbXFFbG8yVWVOa2w0ZAGhmSUNKMkZAZAOXZARbzJOMHM0TUFtZAnhJbWdPdkF4OURUTHJrQjFqQ2RQZAVN1UGxSVU5FWURENnE4OUFPeXFreU1jV09pdFJR", "after": "QVFIUkpsWVRkcVl6SlhsdWlrcGdudl8xVEhwVEJ5ZA3FXdG90bTRxam13NmJDUGpQVnB5ZA29lMG9FVmFaeU1BLW1hc2oZD" } }, "summary": { "total_count": 28 } }, "id": "your-post-id" }
The JSON Response if the User or Page has not reacted to their own object.
{ "reactions": { "data": [ ], "paging": { "cursors": { "before": "QVFIUk5YbXFFbG8yVWVOa2w0ZAGhmSUNKMkZAZAOXZARbzJOMHM0TUFtZAnhJbWdPdkF4OURUTHJrQjFqQ2RQZAVN1UGxSVU5FWURENnE4OUFPeXFreU1jV09pdFJR", "after": "QVFIUkpsWVRkcVl6SlhsdWlrcGdudl8xVEhwVEJ5ZA3FXdG90bTRxam13NmJDUGpQVnB5ZA29lMG9FVmFaeU1BLW1hc2oZD" } }, "summary": { "total_count": 28 } }, "id": "your-post-id" }
A User or Page can only query their own reactions. Other Users' or Pages' reactions are unavailable due to privacy concerns.
Name | Description |
---|---|
enum {NONE, LIKE, LOVE, WOW, HAHA, SAD, ANGRY} | Reaction type |
Reading from this edge will return a JSON formatted result
{ "data": [], "paging": {}, "summary": {} }
data
The Profile of the Page or User running the query, if the object being queried was reacted to by the Page or User, and a list of reaction types:
Field | Description |
---|---|
enum {NONE, LIKE, LOVE, WOW, HAHA, SAD, ANGRY} | The reaction type |
curl -i -X GET \
"https://graph.facebook.com/your-object-id
?fields=reactions.type(LOVE).limit(0).summary(total_count)
&access_token=your-access-token"
{ "reactions": { "data": [ ], "summary": { "total_count": 3498 } }, "id": "your-object-id" }
paging
For more details about pagination, see the Graph API's paging documentation. Adding limit(0)
to reactions
will remove paging
from the output.
summary
Aggregated information about the edge, such as counts. Specify the fields to fetch in the summary param (like summary=total_count
).
Field | Description |
---|---|
unsigned int32 | Total number of reactions |
enum {NONE, LIKE, LOVE, WOW, HAHA, SAD, ANGRY} | The viewer's reaction |
Error | Description |
---|---|
100 | Invalid parameter |
You can't perform this operation on this endpoint.
You can't perform this operation on this endpoint.
You can't perform this operation on this endpoint.