Enrico Susatyo
Enrico Susatyo

Reputation: 19790

Facebook Graph API does not give any data earlier than 2011?

I'm the author of Fazzle app on iPhone. What my app does is basically download user status updates and sort them in various orders (e.g. most liked, most commented).

I have been wondering if Facebook allow developers to get user's status updates since the day they joined Facebook, because when I launched the app I can only get user statuses from 2009. Today I just discovered that Facebook limits Graph API calls down to just since 2011.

I tried looking at documentations, asked around here, and contacted Facebook through their forum. However so far there is no word on this limitation in Graph API. Did I miss something? Is there any other way for me to get data for status updates earlier than 2011?

You can test it yourself here. Use this GET request:

https://graph.facebook.com/(your_user_id)/statuses?limit=99999

Scroll down and you'll find out that not everything's downloaded.

Is this because of conflict of interest with Facebook Timeline? If so, that sucks.

Logged as a bug here. Still hoping someone can point out my mistakes if there's any.

Upvotes: 4

Views: 4810

Answers (3)

jches
jches

Reputation: 4527

Absolutely you can get older posts from Graph API; there is no limit (at least not that I am aware of). Use the since and until parameters to page back through results, instead of offset:

https://graph.facebook.com/me/feed?access_token=[token]&until=1165474447

Documentation for Paging doesn't go very in-depth on since and until:

When querying connections, there are several useful parameters that enable you to filter and page through connection data:

But basically, until is like saying "Give me posts up until this date", and since is similar, "Give me posts since this date". So you can scroll all the way back through a user's feed using a loop something like this:

// pseudocode
timestamp = now
do {
  posts = graph.get(/me/feed?until=timestamp)
  if posts.length == 0: break;
  // process posts
  timestamp = posts[0].created_time // first should be the oldest, in theory
} while (1)

Replace until with since and oldest created_time with the newest to go forwards in time, e.g. to grab any newer posts since the last time the user ran the app.

Upvotes: 10

bkaid
bkaid

Reputation: 52063

Facebook has since confirmed this as a bug. If you have followed Facebook's bug tracker ever, unfortunately that means there is very little if any chance they will actually fix this.

Upvotes: 2

DMCS
DMCS

Reputation: 31860

You will need to paginate. Limit is limited. Please read http://developers.facebook.com/blog/post/478/

Upvotes: 0

Related Questions