How Can I Reduce Facebook API Rate Limit Errors?
Question
Sometimes, Facebook's API rate limits can slow down a sync, leading to an alert in the dashboard.
How can I reduce Facebook API rate limit errors?
Environment
Connector: Facebook Ads
Answer
You can use the following methods to reduce this error:
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 connector 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
If you don’t need metadata tables, set the Sync all metadata toggle in your setup form to OFF. These tables have a large contribution to rate limits.
Reduce your sync frequency
Sync your connector less often to reduce the number of calls to the API, especially if you have multiple Facebook connectors with the same authentication method. See our Sync frequency and scheduling documentation for more information.
Cause
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 the connector hits these limits, it must wait until that period ends before it can query the API again.
Facebook's API rate limits are influenced by:
- Applications and users. See Facebook's Platform Rate Limits documentation to learn more.
- Specific requests made by the Ads Insights API. See Facebook's Use Case Rate Limits documentation to learn more.
- Time of the day. Every day at 4:00 AM UTC, Facebook limits the rate of the Ads Insights API. We recommend that users avoid scheduling syncs during that time.
For more best practices, see Facebook's API rate limit best practices documentation.