只是分享一些我在测试我的应用程序时遇到的信息。
Facebook Graph API 按照其 documentation page 中的描述实现速率限制.今天我试图从 CNN facebook 页面检索提要,但出现以下 500 错误:
{"error":{"code":1,"message":"请减少您请求的数据量,然后重试您的请求"}}
这是我试图测试的查询:
https://graph.facebook.com/v2.3/5550296508/feed?fields=id,actions,application,caption,created_time,description,from,icon,is_hidden,link,message,message_tags,name,object_id,picture,地方,隐私,属性,来源,status_type,故事,story_tags,to,type,updated_time,with_tags,shares,likes.limit(50),comments.filter(stream)。limit(50){attachment,created_time,from,id ,like_count,message,message_tags,comments{attachment,created_time,from,id,like_count,message,message_tags}}&access_token=xxxxxxx
最佳答案
我尝试设置不同的 limit
值来减小大小,最终成功了。通过检查响应大小并稍微尝试一下,我发现当响应达到(大约)200k 阈值时会引发错误。
我使用 Graph API 版本 2.3 - 2.4 - 2.5 - 2.6 进行了测试
我在 facebook API 文档中没有找到关于此响应大小限制的文档,因此将来可能会对其进行更改。
只是觉得如果您正在使用他们的 API 建模某些东西,分享可能会有用。
关于Facebook 图形 API 响应大小限制(错误代码 1),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36730867/