Facebook Open Graph API: weird behavior of parameter limit while getting a paginated user's news feed

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 23:43:14
Jashwant

Its not in documentation but personally I have tested following for my project.

Facebook limit is limited to 500 posts. No matter you put a limit higher than 500 it will fetch only 500 results max. Try with 500 (or more), you will get maximum posts.

You wont get 500 posts every time but will get above 490 posts in general. Some posts get filtered by various reasons (like privacy, blocked user, not suitable for specific region and other things)

This answers your 1st and 4th quetion.

For question no. 2 , I do not work in java, so I cant say if there's a prob in your code/logic or what your code is doing.

For question no. 3 , God help facebook !

Edit

For 4th problem, you may be hitting the queries/hour limit of graph api (facebook uses it to prevent spamming, you cant query apis frequently in quick succession)

Also,

this is why, you do not get all results returned by facebook.

(if you specified a limit of “5” but the five posts returned are not visible to the viewer, you will get an empty result set.)

In addition to the limits mentioned in the documentation for each of the tables and connections listed above, it is helpful to know that the maximum number of results we will fetch before running the visibility checks is 5,000.

Reference: Paging with graph api and fql

Also, there is a limit on no of results for a particular table. You can get a detail about them on respective fql tables.

For stream table (the one for posts/feed),

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.

Reference: Fql stream table

Look here too: Facebook FQL stream limit?

B Zion

There is an ongoing bug in Facebook open graph API paging having to do with the limit parameter. The higher the limit, the more pages of posts --- as if a lower limit also culls a sampling of posts. The problem has surfaced and retreated ever since the post search function was down for a month in September.

A new bug has surfaced: at present a post search without an access_token and a small limit (like 12) will return few and sparsely populated results pages. The same search made with the access_token given in the API documentation example will give full pages of 12 results +/- and no skipping. I have no idea what kind of access_token they use, but no attempts on my part have duplicated their results. The post search without access token is more or less non-functional (again)!

There could be some logic on facebook side to prevent data mining. Try add some delay while going through pages and see if better.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!