1

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.

eli
  • 4,636
  • 7
  • 25
  • 29

3 Answers3

2

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.

Khurram
  • 853
  • 9
  • 15
1

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.

Alon Amit
  • 111
  • 3
0

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

evertjes
  • 76
  • 5