I'm testing my app based on a friend list of about 350 people, and not seeing any pagination on /me/friends/
.
What's unclear to me (by testing & documentation) is the following:
At how many friends do the graph.facebook.com/me/friends
or graph.facebook.com/ID/friends
open graph calls starts to paginate, if at all?
Time-based PaginationTime pagination is used to navigate through results data using Unix timestamps which point to specific times in a list of data. To get all a users posts you keep iterating back in time.
Facebook API is a bundle of solutions used as a primary way to get data in and out of the platform. It enables developers and app users to access the functionality of this network: user information, photos and videos, messages and more.
Try executing the default query that appears when you first load the Graph API Explorer. If you haven't already, open the Graph API Explorer in a new window, select the app you want to test from the application dropdown menu, and get a User access token.
PHP Code to Read Facebook DataThis code uses PHP file_get_contents() function to read Facebook data from server. This function will return JSON array which will be decoded to display to the user. <? php if (isset($_POST["submit"])) { $url = $_POST["profile_url"]; $facebook_data = file_get_contents($url .
look at Graph API Explorer: https://developers.facebook.com/tools/explorer?method=GET&path=me%2Ffriends and scroll to the very bottom - you will there something like:
"paging": { "next": "https://graph.facebook.com/me/friends?format=json&limit=5000&offset=5000&__after_id=XXX" }
which leads me to believe that default page size is 5000
you can set that limit explicitly if you want to: https://developers.facebook.com/tools/explorer?method=GET&path=me%2Ffriends%26limit%3D1
Set the limit yourself using limit=5000 for max limit. I.e so /me/friends?limit=5000
With the JavaScript SDK, two fields are returned, data and paging. Just hit the nextPage URL, and on the next result, there will be no more paging variable/next variable, indicating that you've hit the end.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With