Get all comments on Facebook public post

I want to get all the comments of a public Facebook post through my app. My application is a service that uses application_accesstoken to call the Graph API (so there is no way to authenticate from the user's point of view).

I receive messages through the search URL of all public messages ( https://graph.facebook.com/?q=[keywords†&type=posts . This URL returns only a few comments on the returned In most cases, only 2 comments (which you can see on the profile page before clicking "View all comments XX").

Is there any way to get all these comments through my app? Calling the URL https://graph.facebook.com/userId_postId/comments?access_token= {my_application_accesstoken} returns an empty data set.

In accordance with this question (the Facebook Graph API returns false, although the publication is publicly available ), this is a mistake, since it works for comments on company posts / pages.

Can anyone confirm this? Or does anyone know if this error has already been resolved / is there a workaround for this problem?

I hope you can help me!

+4
source share
2 answers

The Graph API returns only a few comments or comments for the Facebook Post. So, it is better to use the REST API method stream.getComments to retrieve all the comments of the message. We only need to pass post_id to url.

0
source

I will need to disagree with @vishal since the REST api is deprecated by Facebook and as such it may work now, but your application may just stop working at some point. Personally, I would take a look at using FQL if you have message identifiers and see if this works for you.

https://developers.facebook.com/docs/reference/fql/comment/

0
source

Source: https://habr.com/ru/post/1403904/


All Articles