Getting from Facebook API total number of likes pe

2019-08-28 02:55发布

I'm working with the following Facebook API endpoints: /statuses, /links, /photos For each returned object I'm only getting likes and comments objects which display top25 results, and a pagination that leads to the next 25.

I'm only interested in the number of likes. Is there a way to get that number through a different API call which doesn't require multiple pagination calls?

2条回答
相关推荐>>
2楼-- · 2019-08-28 02:57

You can return the total number of likes for various objects using FQL. Here's the documentation for how to get the total number of likes for a comment:

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

The query itself would look like this:

SELECT likes FROM comment WHERE post_id = xyx

查看更多
贼婆χ
3楼-- · 2019-08-28 03:03
SELECT like_info.like_count FROM stream WHERE source_id = '<id>'

or

SELECT like_info.like_count FROM stream WHERE source_id = '<id>' and and actor_id = '<id>'

More: https://developers.facebook.com/docs/reference/fql/stream/

查看更多
登录 后发表回答