Mathieu Forcier
Mathieu Forcier

Reputation: 1

Retrieving Facebook post comments + replies with their likes

I want to retrieve comments on facebook posts with the number of likes they got.

I did find a useful script here (step 6): https://nocodewebscraping.com/how-to-extract-data-from-facebook-page-competitor-analysis/#comments

https://graph.facebook.com/204153042939851_761338343887982/comments?limit=900&access_token=EACEdE (Truncated)

The problem is that I don't manage to get the replies. I thought I could try directly in the Graph Api Explorer and add &filer=stream but then I lose the like_count for each comment.

Any ideas of what I should modify in the URL in order to have the comments+replies and the like count?

Thanks!

Upvotes: 0

Views: 270

Answers (1)

user1394884
user1394884

Reputation: 211

You can use field expansion to make nested queries.

For example, the following will get you the comments on the post, and for each comment will get the message, like_count, replies. For each reply you'll also get the message and like_count:

204153042939851_761338343887982?fields=comments{message,like_count,comments{message,like_count}}

Upvotes: 0

Related Questions