-1

**i'm trying to fetch my friends list with graph explorer using this query

/me/friends but only 25 out of 950 friends are returned in the response**

i need to fetch my friend id's to do something .

When i searched for the solution i found that all my friends must grant a user_friends permission to me , but these 25 friends doesn't give me any permissions yet why they returned and others no ?

is there is a way to return all my friends id's without their permission ?

2 Answers2

2

I assume you did not select YOUR App in the API Explorer, but the default API Explorer App. Which means that at least 25 of your friends authorized the API Explorer App with the user_friends permission. If you want to get more data, use the limit parameter or paging: https://developers.facebook.com/docs/graph-api/using-graph-api/#paging

For example: /me/friends?limit=50

Keep in mind that the API Explorer App is for testing only. In general, it is impossible to get all friends without their permission, you would not be allowed to do anything with their data anyway for privacy reasons. More information: Facebook Graph Api v2.0+ - /me/friends returns empty, or only friends who also use my app

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • ok i tried everything .. tried to use limit parameter but nothing happen . is it possible that only 25 of 950 friends used an app before which need user_friends permission ?? @luschn – Mohamed Elhabbab Aug 25 '17 at 00:04
  • yes, of course. and it´s not "an" app, it´s the api explorer app. for example, if you create a new app and none of your friends authorized it yet, the list will be completely empty. – andyrandy Aug 25 '17 at 06:46
  • Thank you for your reply .. so you mean that everyone one in the list tried before to use api explorer or gave it the permissions ?? but there are friends i'm sure they didn't , cause they can't even easily deal with technology ! – Mohamed Elhabbab Aug 25 '17 at 11:17
  • everyone in the list must have authorized the api explorer app, yes. you don´t need to be a developer for that, a lot of people tried the api explorer. – andyrandy Aug 25 '17 at 12:24
  • thank you again ,, but i'm sure they didn't used it before , if they are not developers how they will try api explorer and generating an access token with the needed permissions successfully ? – Mohamed Elhabbab Aug 25 '17 at 13:35
  • don´t ask me, ask them ;) - it is quite easy to use the api explorer. you don´t even need to know about access tokens and you can just select permissions easily in a popup. either way, they DID authorize the app someday in the past. – andyrandy Aug 25 '17 at 13:38
0

Try adding a limit query parameter to the request as suggested in this question.

Facebook graph API 'friends' request now only returning 25 friends per page? What's going on?

Ananth Rao
  • 1,232
  • 1
  • 9
  • 19