Facebook的5000 Post API限制 [英] Facebook's 5000 Post API Limit

查看:180
本文介绍了Facebook的5000 Post API限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于Facebook限制你的api电话的方式的问题。



在本文的底部: http://developers.facebook.com/blog/post/478/ facebook说:


除了上面列出的每个表和连接的文档中提到的限制之外,知道在运行可见性检查之前我们将获取的最大结果数是5,000。


我想知道如何浏览这样的公共数据。例如,采用夏奇拉:她在上传的每张照片上获得了许多喜欢,这个api电话:



https://graph.facebook.com/5027904559_10150854808869560/likes?format=json&limit=1000&offset=0&__after_id = 100002349968919



最终停在5000喜欢。



https://graph.facebook.com/5027904559_10150854808869560/likes?format=json&limit=1000&offset=5000&__after_id=100000881924617



一有趣的是,这些数据都是公开的,我不必登录到Facebook上看到它。我知道有关使用数据的有隐私政策,这不是我的问题。如果数据是公开的,这个数据是什么,为什么我们不能得到它,如果可以的话,怎么办?



主要问题是:


  1. 您可以获得超过5000个特定API调用的结果,如上所述?


  2. 是最近5000个喜欢的人吗?所以,如果你立即开始收集这个帖子的数据,然后每10分钟左右回去寻找新的喜好,你可以使用这种防止5000限制的方法获取所有数据吗?


  3. 这是API调用的限制,还是只发送一个用户的结果数,还是对某个帖子发回的结果数量等。 / p>


  4. 这是否适用于帖子,标记和评论,如分页?


我知道这个问题有点开放,但是我已经看到了整个地方的答案,它没有很好的记录。任何帮助都会很好,我认为很多人可能会在将来提到这些信息。



更新:



运行此API调用时:



https://graph.facebook.com/5027904559_10150854808869560/likes?format=json&limit=1000&offset=4964&__after_id=100000881924617



你得到一个结果,因此达到极限(至少接近它)。有人建议使用FQL,可能会返回更多。但是我尝试使用FQL在PHP中做同样的事情,只返回1条记录。

  $ select = urlencode(SELECT user_id ,object_id,post_id FROM like WHERE post_id ='5027904559_10150854808869560'LIMIT 1000 OFFSET 4964); 
$ fql_query_url ='https://graph.facebook.com/fql?q='。 $选择;
$ fql_query_result = file_get_contents($ fql_query_url);
$ fql_query_obj = json_decode($ fql_query_result,true);

所以,到目前为止,唯一的答案是不,你总是局限于5000个结果。而且我不认为/知道某个特定权限的具体access_token是否有帮助。



还有一个更新,当我去Shakira的页面并点击' x这样的人数,并开始向下滚动列表,我也达到了极限。所以不仅Facebook限制了API和FQL的回报,而且限制了自己的页面。



我有兴趣看看有没有人知道为什么?他们一次只有5k缓存,如果人们遇到这么多请求,数据库就不能处理这个规模?只是一个猜测。

解决方案

可惜没有办法获得超过最后5000个对象。



除非您所说,否则您保留它的时间比LESS低于5000,并存储它们。 :)



它可能或可能不是故意的(也许他们试图让旧消息死亡,不容易被发现),或者它可能与你被允许在Facebook上的朋友,5000。


I have a question about the way Facebook limits your api calls.

Toward the bottom of this article: http://developers.facebook.com/blog/post/478/ facebook says:

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.

I am wondering how one would page through public data like this. For example, take Shakira: she gets many, many likes on each photo she uploads, this api call:

https://graph.facebook.com/5027904559_10150854808869560/likes?format=json&limit=1000&offset=0&__after_id=100002349968919

ends up stopping at 5000 likes.

https://graph.facebook.com/5027904559_10150854808869560/likes?format=json&limit=1000&offset=5000&__after_id=100000881924617

One interesting point is, this data is all public, I do not have to be logged into Facebook to see it. I know there are privacy policies on how you use the data, that is not my question. If the data is public, which this data is, why can't we get it all, and if we can, how?

The main questions are:

  1. Can you get more than 5000 results for a specific API call, as in the one above?

  2. Is it the most recent 5000 likes? So if you started collecting data on this post right away and then went back every 10 minutes or so to look for new likes, would you be able to get all the data with this method of preventing the 5000 limit?

  3. Is it a limit on API calls, or on just the number of results they send one user, or on the amount of results they send back for a certain post, etc.?

  4. Does this apply to posts, tagged and the comments and like paging?

I know this question is a bit open-ended, but I have looked all over the place for an answer and it is not well documented. Any help would be great, and I think a lot of people may refer to this information in the future.

UPDATE:

When running this API call:

https://graph.facebook.com/5027904559_10150854808869560/likes?format=json&limit=1000&offset=4964&__after_id=100000881924617

You get back one result, and thus hit the limit (well at least close to it). Someone suggested using FQL and that might return more. But I tried doing the same thing in PHP with FQL and got back only 1 record.

$select = urlencode("SELECT user_id, object_id, post_id FROM like WHERE post_id='5027904559_10150854808869560' LIMIT 1000 OFFSET 4964");
        $fql_query_url = 'https://graph.facebook.com/fql?q=' . $select;
        $fql_query_result = file_get_contents($fql_query_url);
        $fql_query_obj = json_decode($fql_query_result, true);

So, so far, the only answer is 'no', you are always limited to 5000 results. And I do not think/know if a specific access_token with some specific permission helps.

One more update, when I go to Shakira's page and click on 'x amount of people like this' and start scrolling down through the list, I also hit a limit. So not only is Facebook limiting the API and FQL returns, they are limiting their own pages.

I would be interested to see if anyone knows why? They only have 5k in cache at a time, and they would not be able to handle the scale if people were hitting the database with so many requests? Just a guess.

解决方案

There is no way to get more than the last 5000 objects, sadly.

Unless, as you said, you maintained it from a time when there were LESS than 5000, and stored them. :)

It may or may not be intentional (maybe they are trying to let old news die and not be found easily), or, it may coincide with the amount of friends you're allowed on Facebook, 5000.

这篇关于Facebook的5000 Post API限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆