Deepak Singhal
Deepak Singhal

Reputation: 10866

Facebook API not giving me complete list of members of Facebook groups

I am trying a very simple FQL :

SELECT uid FROM group_member WHERE gid=<foo>

If my group has 3-4 members it works fine; but if it has thousands of members it returns me approx 33% of the members ! How can I get complete list

Upvotes: 1

Views: 3032

Answers (1)

Rahil Arora
Rahil Arora

Reputation: 3674

Unfortunately, this too has some limitations. You can't get more than 500 group members using an API call. Your query will only return you a max of 500 random members from that group.

Workaround: You can use Facebook Graph API and make use of pagination feature. For example: To retrieve 400 group members, you can simply make a request using -

https://graph.facebook.com/[Group ID]/members?limit=400&offset=0

This will return a list of 400 members of that group. You can then retrieve the next 400 members by increasing the offset to 400 and so on.

I tried this example using the API explorer and it worked fine for me.

Upvotes: 5

Related Questions