Question

I need to retrieve the usernames of a lot of facebook users, given that I have their facebook ID. I could run a for loop that creates a lot of requests to Facebook graph API but this is pretty inefficient.

Is there a way to send let's say a Json with all the facebook IDs and retrieve the detailed public data?

Was it helpful?

Solution

As @CBroe said, the field username is no longer available in v2.0.

To request info for several Users at once via Graph API, you can use the following syntax:

GET /?ids={user_id_1},{user_id_2},{user_id_n}&fields={field_1},{field_1},{field_n}

Replace {field_n} with the respective fields you want to get returned, and {user_id_n} with the (app-specific) User IDs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top