Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting more than 25 photos from the Facebook Graph API

I'm trying to retrieve all the photos a user is tagged in using the Graph API but I can only get the latest 25.

Is it possible to get more, and if so, how?

like image 852
Brewer Avatar asked Jul 16 '11 15:07

Brewer


People also ask

What data can I get from Facebook Graph API?

The Graph API is the primary way to get data into and out of the Facebook platform. It's an HTTP-based API that apps can use to programmatically query data, post new stories, manage ads, upload photos, and perform a wide variety of other tasks.

How do I upgrade Facebook Graph API?

Implement a New VersionIn the App Dashboard Settings > Advanced, scroll to the Upgrade API Version section.

Is Facebook Graph API rest?

Because the Facebook Graph API is a restful JSON API, you can run queries directly in any standard browser; you'd simply be making HTTP calls.


2 Answers

Have you tried adding a limit and offset parameters? Quoting the documentation:

Paging

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

  • limit, offset: https://graph.facebook.com/me/likes?limit=3
  • until, since (a unix timestamp or any date accepted by strtotime): https://graph.facebook.com/search?until=yesterday&q=orange
like image 180
sagi Avatar answered Oct 18 '22 17:10

sagi


Currently there is 100 items limitation per query both on photos and likes: However, 100 pics query takes so much time to run for me.

The following API call:

https://graph.facebook.com/me/photos?limit=500

gives only 100 results with paging link.

Run in FQL explorer (If you have more than 100 pic on your account): https://developers.facebook.com/tools/explorer/?method=GET&path=me%2Fphotos%3Flimit%3D500

like image 42
Mark Vital Avatar answered Oct 18 '22 16:10

Mark Vital