0

I am using the facebook sdk from https://github.com/pythonforfacebook/facebook-sdk

I am unable to paginate the results. I see the first page of results, but can't seem to understand how to get the next page of results using the next link.

{
      "data": [
        {
          "name": "AB", 
          "id": "1"
        }, 
        {
          "name": "CD", 
          "id": "1"
        }
      ], 
      "paging": {
        "next": "https://graph.facebook.com/../friends?access_token=<>&limit=5000&offset=5000&__after_id=<>"
      }
}

How to retrieve the next page of results with this kind of offset based pagination?

PS:I did find some similar questions here, but they were all unanswered, hence reposting this question.

Ojas
  • 483
  • 1
  • 4
  • 11
  • Just do a request to the next-link – WizKid Jul 11 '14 at 19:12
  • That isn't working. It just gives a result with the "data" field blank, and the "paging" field with a "previous" link . – Ojas Jul 11 '14 at 19:14
  • Are you sure there's supposed to be more than two results? are you using v1.0 or v2.0 of the API? v2.0 /friends contains only friends that also use the app, so it'll be a lot lower than the raw friends count – Igy Jul 11 '14 at 19:23
  • I tried using v1.0 also. That isn't working either. – Ojas Jul 11 '14 at 19:28
  • @Igy, I am not sure whether there are more results. All I want to do, is get my complete friend list. How do you suggest I do that? – Ojas Jul 11 '14 at 19:36
  • When did you create the app ID? trying to call /v1.0 on an app created after v2.0 was launched will implicitly call v2.0 - it uses the oldest available version to your app - https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_versions_and_path – Igy Jul 11 '14 at 19:58
  • @Igy, Yes you are right. I created the app ID recently. Can you suggest me some other way to fetch the list then? – Ojas Jul 12 '14 at 04:13
  • 1
    No, in v2.0 it's not possible to fetch the entire friends list - this is mentioned on the changelog as one of the main changes from v1 to v2 - merging question – Igy Jul 12 '14 at 04:26
  • @Igy Thanks for your time! I would have wasted a lot of time over this issue otherwise! – Ojas Jul 12 '14 at 04:32

0 Answers0