eli
eli

Reputation: 5147

Facebook post comment count from Graph API

In July 2013 Facebook removed the comment count from posts in the graph API. Is there an alternative, currently working way to retrieve the number of comments for a specific post, without having to download all of them? Thanks.

Upvotes: 1

Views: 5267

Answers (3)

evertjes
evertjes

Reputation: 76

FQL is deprecated so you should use the Graph API via https://developers.facebook.com/docs/graph-api/reference/v2.2/object/comments

Upvotes: 0

Alon Amit
Alon Amit

Reputation: 111

You can also do this with the Graph API, by appending /comments?summary=true to the request.

https://developers.facebook.com/tools/explorer/?method=GET&path=10151824665463057%2Fcomments%3Fsummary%3Dtrue

The return object has a summary field all the way at the end (scroll to the bottom to see it in the Graph API explorer). Within the summary there's a total_count field.

Upvotes: 1

Khurram
Khurram

Reputation: 883

Well i don't know your scenario, so can't help you with exact solution. but one way to get comments count is getting it from the stream table using FQL.

there is a structure of comment_info which gives the comment count for any specific post.

see the query below for example:

Select type, post_id, description, likes,comment_info from stream WHERE source_id = "*post_id*"

put the post id in the clause.

Upvotes: 2

Related Questions