0

Hi i see that Facebook Graph API not returing all comments of posts for a page.it shows all posts of a page well but it not showing all comments for each post.it showing last two comments only!!. but for some other pages shows all comments.so don't why the problem is for some pages? is this a facebook bug? or please suggest if i am wrong.i used the access token of a app with read_stream premission.i don't want to use other permissions coz it's a security risk.

please reply

thanks

dev_hero
  • 19
  • 1
  • 11
  • Increase you LIMIT value, such as LIMIT=150. Facebook API return based on limit value first, then filter by some conditions like is_privacy. So it's make sense when only two comments. – 林果皞 Apr 19 '13 at 22:45
  • nope i did use like "..feed?limit=150&access_token=.." but each post which have many comments, shows only last 2 comments though count value is more than 2 i saw by graph api explorer.limit is actually for limiting posts i guess not post comments. – dev_hero Apr 19 '13 at 22:58
  • I see. If you query graph.facebook.com/USERID OR PAGEID/feed? It's by design only a few comments is return. This comments is deprecated, you can read more on http://developers.facebook.com/blog/post/2013/04/03/new-apis-for-comment-replies/, find this line "'comments' field from 'stream' FQL table is deprecated. Please use the'comment_info' column to fetch the 'can_comment' and 'comment_count' fields." – 林果皞 Apr 19 '13 at 23:22
  • You should use fql instead. Kindly check it out on https://developers.facebook.com/docs/technical-guides/fql/ – 林果皞 Apr 19 '13 at 23:25
  • well let us make it easy.'comments' field in fql table is deprecated but if try get comments using graph api "https://graph.facebook.com/POSTID/comments?access_token=.." is that ok? also i tried using fql query to get comments-"SELECT id, fromid, time, text, likes FROM comment WHERE object_id=id_value ORDER BY time" but i don't see commenter name(but have fromid) in comment table? i need to show commenter name how if i must use fql query ? – dev_hero Apr 20 '13 at 14:19
  • "graph.facebook.com/POSTID/comments?access_token=" is ok, and cursor pagination is more stable(https://developers.facebook.com/docs/reference/api/pagination/). For fql, you require Multi-query to get name and profile pic, such as {"query1":"SELECT id, fromid, time, text, likes FROM comment WHERE post_id='126757470715601_530905090300835' ORDER BY time","query2":"SELECT id, name, pic_square FROM profile WHERE id IN (SELECT fromid FROM #query1)"} – 林果皞 Apr 22 '13 at 03:25

1 Answers1

1

its because commentor privacy settings. if user turn it off, you can't request the comments via API. when you do testing on facebook graph api:

postid/?fields=comments.summary(true)

you will see the debug info:

total_count represents the approximate number of nodes on the comments edge. The actual number of results returned might be different depending on privacy settings.

you can also refer to this related question: facebook graph api returns not all the comments

Community
  • 1
  • 1
user3613026
  • 191
  • 1
  • 16