Search last 7 days in facebook search api - facebook

I need a solution in graph api or fql to search a specific keyword for last 7 days or a way to count the no of total search results.
Right now,
I am applying a heavy limit. It works if result is single page, but fails on pagination.
http://graph.facebook.com/search?type=post&q=wonders&since=2012-01-13&limit=99999999999999
I want to gather data for statisticall purposes.

The pagination issue is a current bug listed http://developers.facebook.com/bugs
Per Jashwant's comments below, he has found that the API limits 500 per request and there's no way around this designed limitation.

Related

How to get more than 100 retweets of the specific tweet?

I use Twitter REST API. Is there any way to get more than 100 retweets of the specific tweet? The default methods may return only 100 retweets.
Ok. GET statuses/retweets/:id does not allow pagination, indeed.
You could consider getting the retweets indirectly, in the following way:
You do a GET search/tweets making sure that you include in the query some keywords of the tweet for which you want to get the retweets
You filter the output in order to find your tweet
However, you are going to find quite a few problems:
Depending on the content of your tweet, it might be difficult to find it with this method. In any case, you'll have to paginate and to use the max_id parameter, as explained here
If you have to paginate a lot or if you have a big number of tweets that you need to know the number of retweets, you will face twitter rate limits. For how many tweets you want to do this? You will need to take into account that you will only be able to do 180/450 per 15 minutes (depending on the type of authentication)
And finally twitter does not guarantee that you are going to get all tweets, in particular if they are old (where old could even mean "older than a week"). So it might be you don't find more than 100 retweets just because the api is not providing the ones you are interested in
In conclusion: I'm not sure it is worth it! Instead, when you collect your tweets, you would need to make sure that you get the retweets as well (or for that matter, any other parameter you need). When you collect tweets, you do it either with the REST api or the Streaming api and you can get it from there.
Hope it helps.

How to search Facebook's "invitable_friends" results

I have a Facebook app, and I'd like to allow my users to invite their Facebook friends to my app. The proper endpoint is /me/invitable_friends which is working well. But towards the bottom of that doc page, they recommend implementing a "search box" to filter the results, yet they don't offer any example of how to do this. I've searched around and haven't found anything.
It doesn't appear as though you can pass additional params for filtering the results. Obviously I can filter the results after the fact, but that's not scalable since the API only returns ~20 users at a time. That limit is modifiable (I believe), though it's of course not wise to bump it too high.
So how can I build a search box interface if I can't pass the search text to the endpoint? I must be missing something.
Thanks in advance.
PS - I'm using the JS SDK.
You should probably file a bug.
Based on the documentation the default size is 1000 records (average Facebook friend list size is 300-400)
If you don't see the next parameter at the end of the result under paging then there are no more results.

Graph API bug? /{group-id}/feed endpoint gives inconsistent results

tl;dr getting a group's feed returns inconsistent #s of posts
This apparent bug seems to affect both v1.0 and v2.0 of the Facebook Graph API.
I am an admin of a closed Facebook group with ~1800 posts. I would like to return all of the posts in that group.
To do this, I am calling /{group-id}/feed and following the URL in paging.next. This does in fact return posts, but the results are inconsistent, and usually returns ~150 less posts than are actually in the group (I have independently verified and double-checked this #) .
A base call of /{group-id}/feed, when all paging.next links are followed, yields 1652 posts.
A base call of /{group-id}/feed?limit=10, when all paging.next links are followed, yields 1606 posts.
A base call of /{group-id}/feed?limit=50, when all paging.next links are followed, yields 1687 posts.
Of note, each of the above cases is internally consistent. (e.g. the limit=10 call always returns the same (incorrect) number of posts.)
I have been scouring Google and SO trying to troubleshoot. Some things I've tried:
Variations on the permissions of the access token: using either the max. or min. needed do not resolve the issue.
Isolating language binding bugs: I have written test code in both Go and Node.js, and both experience the same issue.
Using different versions of the api: both 1.0 and 2.0 demonstrate the same issue.
I'm really at my wits end here. I don't know to troubleshoot further. Any ideas?
This is not necessarily a "bug" - it is sort of documented: https://developers.facebook.com/blog/post/478/
In essence the limit is applied BEFORE filtering the results (like deleted posts or visibility) and thus the limit does not always match the number of posts you're getting. Even worse is you can get empty pages within your result set and you'll need to check for a few pages further in the empty space to be sure that nothing is left.
Posts can get pretty sparse when you're reaching back a lot of time because of deleted user accounts and such stuff. So you might get slots of 200 or something where nothing is returned because all the posts there are gone.

Get old Facebook posts from public FB page

For a university research project I need to view some old posts on public Facebook pages from a specific date range (January 22-31 2014.) I was planning just to copy and paste each post but I have run into a problem with some of the pages that generate a very high volume of posts. Facebook will not display past a certain date. Even with scrolling down, at a certain point the posts stop displaying (this is true by month, so it jumps from January 25 directly to December 31 for example).
Here are the pages I am interested in:
https://www.facebook.com/Syrian.Revolution
https://www.facebook.com/Syrian.Truth
I have read about Facebook's Graph API but have had some trouble using it (I don't have a developer's background.) Also the posts are mostly in Arabic so that may be a problem.
I just need the pages' posts, not the comments sections.
Thanks anyone so much for your help, it is very appreciated.
Really depends on what language/environment you're using. As a simplest case, you can just use Graph API Explorer (https://developers.facebook.com/tools/explorer) and make a call:
{{page_id}}/posts
There are a lot of ways you can improve this call for your benefit. For example, you can use a limit parameter to increase the default number of results it retruns.
{{page_id}}/posts?limit=200
By default, this returns a lot of fields, you can limit the fields.
{{page_id}}/posts?limit=200&fields=id,message,created_time
You can visit https://developers.facebook.com/docs/graph-api/reference/page/feed/ to find out which fields are supported.
In order to get results during a certain time-range, you can use the created_time field to determine if a post belongs to a certain time interval.

Getting old records from Facebook using the API

I want to fetch some historical data using the api. But when I access older and older pages, I suddenly hit one that's returning me empty data.
For example, call to this url: https://graph.facebook.com/kenderken/posts?limit=100&until=2010-06-01T09:10:53%2B0000 returns me empty data even that there are posts on my wall that are older then 2010-06-01... (here's the last one that API returns to me: http://www.facebook.com/kenderken/posts/134367776579392 and this one http://www.facebook.com/kenderken/posts/271650467287 is from January 2010, no way to get it via API)...
Any clues on that?
That is a fairly common bug with Facebook. If you search http://bugs.developers.facebook.net/ you will find many similar reports.