Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Absolutely you can get older posts from Graph API; there is no limit (at least not that I am aware of). Use the <code>since</code> and <code>until</code> parameters to page back through results, instead of <code>offset</code>:</p> <pre><code>https://graph.facebook.com/me/feed?access_token=[token]&amp;until=1165474447 </code></pre> <p><a href="http://developers.facebook.com/docs/reference/api/">Documentation</a> for <strong>Paging</strong> doesn't go very in-depth on <code>since</code> and <code>until</code>:</p> <blockquote> <p>When querying connections, there are several useful parameters that enable you to filter and page through connection data:</p> <ul> <li>limit, offset: <a href="https://graph.facebook.com/me/likes?limit=3">https://graph.facebook.com/me/likes?limit=3</a>`</li> <li>until, since (a unix timestamp or any date accepted by <a href="http://php.net/manual/en/function.strtotime.php">strtotime</a>):<br> <a href="https://graph.facebook.com/search?until=yesterday&amp;q=orange">https://graph.facebook.com/search?until=yesterday&amp;q=orange</a></li> </ul> </blockquote> <p>But basically, <code>until</code> 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:</p> <pre><code>// 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) </code></pre> <p>Replace <code>until</code> with <code>since</code> and oldest <code>created_time</code> with the newest to go forwards in time, e.g. to grab any newer posts since the last time the user ran the app.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload