Facebook fql stream table limit - facebook-fql

On facebook API reference for FQL stream table you can find that "Each query of the stream table is limited to the previous 30 days or 50 posts, whichever is greater, however you can use time-specific fields such as created_time along with FQL operators (such as < or >) to retrieve a much greater range of posts."
But if I use siple query
SELECT message FROM stream WHERE source_id = me() LIMIT 500
I get far more than 50 posts. So is it enough only to use LIMIT to get more than 50 posts?

Related

Giving Multiple Ids for stream in facebook FQL

select post_id, message from stream where source_id IN (..., ..., ...) LIMIT 500
I'm using this fql query but it is returning just few posts. While the below query is returning more than 200 posts.
select post_id, message from stream where source_id = ... LIMIT 500
but giving same id with other id is returning 4 to 5 posts.
I know fql support is not available in v2.0 but still I want to do this using fql.
This seems strange... Have you tried doing this via pure Graph API? What kind of objects are you using as source_ids?
GET /?ids={object_id_1},{object_id_2},{object_id_3}&fields=feed.fields(id,message).limit(100)

Getting from Facebook API total number of likes per post

I'm working with the following Facebook API endpoints: /statuses, /links, /photos
For each returned object I'm only getting likes and comments objects which display top25 results, and a pagination that leads to the next 25.
I'm only interested in the number of likes. Is there a way to get that number through a different API call which doesn't require multiple pagination calls?
You can return the total number of likes for various objects using FQL. Here's the documentation for how to get the total number of likes for a comment:
https://developers.facebook.com/docs/reference/fql/comment
The query itself would look like this:
SELECT likes FROM comment WHERE post_id = xyx
SELECT like_info.like_count FROM stream WHERE source_id = '<id>'
or
SELECT like_info.like_count FROM stream WHERE source_id = '<id>' and and actor_id = '<id>'
More: https://developers.facebook.com/docs/reference/fql/stream/

FQL query on stream table returns empty using created_time

I have a FQL query for the stream table as follows
SELECT post_id FROM stream WHERE filter_key ='nf' AND created_time < 1335500000
Where the filter_key grabs the news feed. This query returns no data (for my account)
Where as, this query (using unix set at April 30 2012)
SELECT post_id FROM stream WHERE filter_key ='nf' AND created_time < 1335758400
Returns data.
I can keep pushing the unix time back to a point until it just stops showing data, yet there is data there from just browsing my news feed manually through the Facebook UI.
The stream docs state
Each query of the stream table is limited to the previous 30 days or 50 posts, whichever is greater, however you can use time-specific fields such as created_time along with FQL operators (such as < or >) to retrieve a much greater range of posts.
So to me, it means I can do "pagination" with created_time and limit.
This isn't the case.
Even using the alternative /me/home returns the first set but when I use the pagination links there is no data returned.
Is there something I missing here? Maybe some explanation as to why the previous data is empty for both the FQL and Graph API calls?

Query every liked object using FQL

I'm trying to query every object which the user has liked since joining facebook by running this query:
SELECT user_id, object_id, post_id FROM like WHERE user_id=me()
This query runs fine and returns some results, but the number of them is a lot less than I estimated. I tried it on different, real user accounts, and for a friend of mine who has joined facebook around 2006 the number of returned results is still only around 65.
I tried this query through the official javascript sdk and through the graph api explorer which gave identical results.
The documentation doesn't state any limit imposed upon querying the like table.
Is there anything, I should be aware when doing a query on this table?
Thank you very much!
According to this documentation :
Each query of the stream table is limited to the previous 30 days or
50 posts, whichever is greater, however you can use time-specific
fields such as created_time along with FQL operators (such as < or >)
to retrieve a much greater range of posts.
Although not explicitly mentioned in the doucmentation for likes, I guess this will be the same limit. So try to add created_time in a where clause.

FQL query: query with multiple stream_id gives too few records

I would like to query public posts from multiple Pages.
My FQL query looks like this:
SELECT post_id, source_id FROM stream WHERE source_id in (157528807603192, 127531603328)
This query returns only about 6 records.
However, if I use the two source_id in two separate query I got more than 20 item for both of them:
SELECT post_id, source_id FROM stream WHERE source_id in = 157528807603192
I couldn't find anything in the documentation stating that if you query multiple source_id you need different permissions.
Can anyone explain me what is happening here?
I've found the answer in the documentation. :(
http://developers.facebook.com/docs/reference/rest/stream.get/
"If you specify only one user ID in the source_ids array, you can
return, at minimum, the last 50 posts from that user's profile stream
(Wall) for the last 180 days (it likely can be more).
If you specify more than one user ID in the source_ids array, you can
return posts in those streams only from the last few days (about one
week)."