I'm just experimenting with opengraph a bit and I was trying to retrieve all the posts a user has ever made. And I noticed that when do
user_id/statuses?limit=200
it only returns 99 statusses, is this because i'm doing it trough the graph api explorer on developers.facebook.com? is there a way to get all the users posts with the extra information, like in graph(comments/likes...)?
the next/previous links didn't help they both returned an empty json string
there are some limitations enforced here - if a user has (hypothetically) seven million posts, Facebook's servers will be bogged down with your request. All requests have a limitation on them - even if not specifically set. Pay attention to the parameters in the next and prev pagination links. They contain values such as :
limit - how many items will be returned in each request
offset - an offset to start from, an offset of 15 will start returning posts from the 15th and onward.
since - epoch timestamp defining the begining of a timeframe
untill- epoch timestamp defining the end of a timeframe
Hope this info helps...
There is also a limit in the amount of information that Facebook allows to be gotten via the Graph API. The data stores for the public Graph API are not the same as the data stores Facebook uses for the normal GUI. If your app desperately needs full information, it is possible that becoming a Facebook partner might get you better results.
Related
Is there a metric that I can pull from the Facebook Graph API that would tell me either/both Response Rate and/or Average Response Time from a page?
I'll attach a screenshot as to what I'm referring to:
I'm seeing this when I go to Settings -> Insights -> Messages, but would love to know how to pull this information from Facebook.
Anyone know the specific metrics or queries I could use to obtain this information?
EDIT: For anyone who offers the displayed_message_response_time, this doesn't work because it is set by the user AND returns a string (not numeric value).
Afaik there is only one way to get the reaction time:
Use /page-id/feed?fields=id,from to get all posts with the info who created them
Filter out the user posts with the "from" field
Get the time between the user post and a page answer (if there is one) post by post
Calculate the average response time based on the resulting times
I believe Fanpage Karma does it that way.
I need to get ALL user likes at once without pagination.
I could hit: graph.facebook.com/me/likes ...however, is there a limit to the # of objects returned by facebook? if so, what is that limit and can it be overwritten?
The default limit is something like 25 results. You can specify a limit by providing a limit parameter to facebook:
https://graph.facebook.com/me/likes?limit=100
Checkout the API Documentation under the heading "Paging".
That said, there's never a guarantee that you'll get all the likes at once, even if you set the limit parameter to be greater than or equal to the number of likes on an object.
On top of that, you'll often find that the number of likes reported on the Facebook website or by the Graph API is higher than what you can get by fetching the /likes connection in the Graph API. I'm trying (and failing) to find the SO question that talked about why that is, but if I remember right that number sometimes includes shares and other actions, not just likes.
You should use the pagination to page thru all the data that the Graph API can return.
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.
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:
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
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.
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.
You will need to paginate. Limit is limited. Please read http://developers.facebook.com/blog/post/478/
I would like to retrieve the full newsfeed including historical data of a given user. In principal, this is straight forward using either an authenticated call to the Graph API or to the FQL API.
With the Graph API, I access the me/home endpoint. This results in 25 entries. I can iterate over the pages and retrieve around 8 pages back into history giving me around 200 entries. I write around 200 entries, because with each run through this I get a different number of total entries. Sometimes more, sometimes less.
With the FQL API, I call SELECT post_id, created_time, actor_id, message FROM stream WHERE filter_key = 'nf' AND is_hidden=0 AND created_time > 1262304000 LIMIT 500 where the created time reflects 1 Jan 2010. This gives me around 150 entries.
Both methods don't seem to allow to work your way backwards into history. In the FQL query, I also tried to play around with the created_time field and LIMIT to go backwards in small chunks but it didn't work.
The documentation of the stream table http://developers.facebook.com/docs/reference/fql/stream/ says somehow cryptically:
The profile view, unlike the homepage view, returns older data from our databases.
Homepage view - as far as I understand - is another word for Newsfeed, so that might mean that what I want is not even possible at all?
To make things worse (but that's not the main topic of this question) the returned datasets from the two methods differ. Both contain entries that the other does not show but they also have many entries in common. Even worse, the same is true in comparison to the real newsfeed on the Facebook website.
Does anyone have any experience or deeper insights on this?
Maybe I am mis-understanding your question, but can't you simply call the graph api with /me/home?limit=5000 and then ?limit=5000&offset=5000 or whatever the max limit value Facebook allows is?
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?
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
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
Setting limit=0 may not always work in the case that a user has a huge number of tagged photos. Also note that the tagged photos graph API can return a large number of embedded comments as well, so especially if you are developing a mobile app, it can take a long time to return all the photo data. Finally I find that sometimes Facebook will limit the number of entries it can return in times of high load.
So... perhaps the best way is to use the "paging" "next" url that appears at the end of the returned photo data. This gives you the next graphAPI call that you can then use to get the next x photos. It does this by using and pre-populating the limit and until parameters and incorporating them within the graph api call. Very handy.