Lücks
Lücks

Reputation: 3994

Facebook API: Get all likes of a post

I want to get all users that liked a post of a page. I'm setting LIMIT 200000, but it's returning 1000, and the post has 1200 likes. What are my options?

FQL:

select post_id, user_id
  from like 
 where post_id = "XXXXX"
  LIMIT 200000

Upvotes: 0

Views: 207

Answers (1)

Hardeep Mehta
Hardeep Mehta

Reputation: 489

By default,Facebook Graphi API returns only the first 1000 results,Doesn't matter what your Limit Parameter is set to.

To overcome this problem,There is a paging key provided in the JSON parsed array,Something like this,

"paging": { "cursors": { "after": "MzE0NzA0Njc0ODE0", "before": "Nzc5NTQ3MDU1NDAyNjc4" }, "next": "https://graph.facebook.com/v2.0/734056698/likes?limit=25&after=MzE0NzA0Njc0ODE0" }

Here,You will be needing to access the next value to get your rest 200 likes. Regards

Upvotes: 2

Related Questions