How Can I Reduce Facebook API Rate Limit Errors?
Facebook's API rate limits may slow down your sync, leading to an error similar to the following:
Facebook Rate Limits Affected
Discover the main causes of Facebook API rate limit errors, and how to optimize your Facebook Ads connection configuration to avoid them.
What causes Facebook API rate limit errors?
The Facebook API has a rate limit, or the number of API calls that can be made to the Facebook API within a certain time period. When your connection hits these limits, we must wait until that period ends before we can query the API again.
Facebook’s rate limits are influenced by:
- The number of requests made by a specific app or user access token. To learn more, see Facebook's Platform Rate Limits documentation.
- The type and volume of Ads Insights queries. More complex queries use more quota and are subject to Facebook's Business Use Case limits.
- Parallel processes using the same credentials. Multiple Fivetran connections or external tools sharing the same access token can quickly exhaust the shared quota.
- The number of active ads. Facebook increases your limit based on how many ads are running. However, having many active ads also increases the required API calls.
- The number of ad accounts synced by your connection. Configuring your connection to sync data for multiple ad accounts raises the risk of hitting quota limits.
- The inclusion of metadata tables. These tables generate additional API calls and can significantly increase quota usage.
- The authentication method used. Using Fivetran’s OAuth application grants a higher quota allocations than a system user token.
How to avoid Facebook API rate limit errors
We recommend the following methods to avoid Facebook's API rate limit:
Switch to OAuth authorization
Fivetran can use one of two options to access Facebook data:
- The Grant User Access option grants our Facebook OAuth application permission to request data on your behalf.
- The System User Access Token option uses the token that belongs to your Facebook OAuth application. All API calls go through it.
Select Grant User Access in the connection setup form so that Facebook calculates the rate limit based on the Fivetran application, not your advertising account. The Fivetran application has a higher rate limit than your advertising account.
Exclude metadata tables
Metadata tables contribute significantly to rate limits. If you don’t need to sync these tables, disable them from your connection setup form.
- In Fivetran, go to your Facebook Ads connection page.
- Select the Setup tab.
- Click Edit connection.
- Set the Sync all metadata toggle to OFF.
- Click Save & Test.
Reduce sync frequency
Sync your connection less often to reduce the number of calls to the API, especially if you have multiple Facebook connections with the same authentication method. For more information, see our Sync frequency and scheduling documentation.
Maintain a reasonable number of active ads
Your rate limit depends on the number of active ads. Pausing or deleting ads and campaigns lowers the quota. Keep legitimate ads running, but avoid creating dummy ads.
Ensure processes don’t run in parallel
Processes that use the same access token, including other Fivetran connections, pull from a single user-level quota bucket. If they run simultaneously, they can drain that bucket and trigger rate limit errors. Run them sequentially or authenticate each one with a different token.
Split large account lists across connections
If you configure your connection to sync multiple Facebook ad accounts, it can overwhelm your hourly quota. Split the ad accounts across several connections to spread traffic and reduce throttling.