简体   繁体   English

使用 Facebook 广告库 API 是否有速率限制?

[英]Is there a rate limit for using Facebook Ad Library API?

I'm using Facebook Ad Library API but I can't figure out how rate limit works.我正在使用 Facebook 广告库 API 但我无法弄清楚速率限制是如何工作的。 On the application dashboard under "Application-Level Rate Limiting" the chart is always showing zero calls and when I make a new API call the header just shows this (the 'call_count' field is missing):在“应用程序级速率限制”下的应用程序仪表板上,图表始终显示零调用,当我进行新的 API 调用时,header 仅显示此(缺少“call_count”字段):

{
   'total_time'     : 0,
   'total_cputime'  : 0
}

I've read on a report by Mozilla developers that there is a rate limit (they were blocked a few times), someone can help?我读过 Mozilla 开发人员的 报告,说存在速率限制(他们被阻止了几次),有人可以帮忙吗?

Thanks谢谢

I was running into a similar issue and worked out the following solution:我遇到了类似的问题并制定了以下解决方案:

You can see the current usage of your rate limit for the Ad Library API by looking at the "object_count_pct" in the header.您可以通过查看 header 中的“object_count_pct”来查看广告库 API 的速率限制的当前使用情况。 API calls are blocked once it reaches a value of 100 (%). API 调用一旦达到 100 (%) 的值就会被阻止。

Avoiding the limit is then possible by pausing calls at a certain percentage until the object_count_pct goes down again.然后可以通过以一定百分比暂停调用直到object_count_pct再次下降来避免限制。 You can also build your API calls so that they use the "estimated_time_to_regain_access" value to restart the calls after Facebook unblocks your app.您还可以构建您的 API 调用,以便它们使用“estimated_time_to_regain_access”值在 Facebook 解锁您的应用程序后重新启动调用。

Unfortunately I could not find any documentation regarding the actual rate limit or at what speed the object_count_pct goes down once calls to the API are halted.不幸的是,一旦停止对 API 的调用,我找不到任何有关实际速率限制或 object_count_pct 下降速度的文档。 The 200 calls per hour as stated in the official docs is definitively not accurate as I have managed to make over 5.000 calls in ca. 官方文档中所述的每小时 200 次呼叫绝对不准确,因为我已经设法在 ca 中拨打了超过 5.000 次呼叫。 8 hours. 8小时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM