Do Facebook Graph API calls using field expansion count differently against the rate limits than batch calls

给你一囗甜甜゛ 提交于 2019-12-01 03:38:19

Unfortunately, each call in the batch is counted as an api call, it's just faster to call them within a batch since it will be 1 request. See here documentation on Facebook API:

Limits
We currently limit the number of requests which can be in a batch to 50, but each call within the batch is counted separately for the purposes of calculating API call limits and resource limits. For example, a batch of 10 API calls will count as 10 calls and each call within the batch contributes to CPU resource limits in the same manner.

Source: https://developers.facebook.com/docs/reference/api/batch/

Based on real-world testing, I've found that field expansion can count for multiple uses under the rate limit. For example, starting from a quiet state, a sequence of 63 field-expanded calls to a single api (graph.facebook.com/IDENTITY/posts) brought us to the 600 call rate limit.

According to the Facebook Docs,

The Field Expansion feature of the Graph API, allows you to effectively "join" multiple graph queries into a single call.

So your queries above would represent four calls in the Batch form, and one call in the Field Expanded form.

As I noted in a comment above: A batch sends multiple-but-not-necessarily-related queries to Facebook in a single request. Field expansion is like doing joins in SQL through a single query.

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