Does AWeber throttle or rate limit API requests?

Yes, there is a limit on the number of requests that can be made each minute to our API. This limit is there to ensure that the API is available for anyone who wishes to use it. 

You can make 120 requests each minute, per customer account. That means that if you have three AWeber customers using your integration each account gets its own 120 requests per minute.

There are no daily or monthly limits to the API, just the per minute limit as specified above.

 

Error Codes

If you make more than 120 requests to the API in a single 60 second window the API will return the following JSON formatted error:

{"error": {"status": 403, "message": "Rate Limit Error", "type": "ForbiddenError", 
"documentation_url": "https://labs.aweber.com/docs/troubleshooting#forbidden"}}

It is important that you check both the status code (403) and the message ("Rate Limit Error"). There are several kinds of 403 errors in our API the rate limit error has a unique message you can look for.

When you see this error you will be unable to make API requests for 60 seconds.

 

Reducing Rate Limit Errors

While the rate limit cannot be raised or removed, there are a few things you can do to avoid bumping into it.

If you are not already, you should catch the error in your code and then wait for 60 seconds before trying your request again. Doing so will prevent your integration from grinding to a halt when the error is returned. Here's a Python example using the Requests library:

try:
    response = oauth_session.get(url)
    response.raise_for_status()
except requests.exceptions.HTTPError:
    message = response.json()['error']['message']
    if (response.status_code == 403) and ('rate limit' in message.lower()):
        sleep(60)

You can also make use of caching to avoid making unnecessary API calls. For example, if you have to add 10 subscribers to a list you should cache or save the list ID so you don't have to look it up every time.

Finally if you plan to make many API calls you might try building an asynchronous queue or some other kind of throttling into your integration. If your integration can limit its own API calls to stay within AWeber's guidelines you can avoid hitting the limit in the first place.

Have more questions? Submit a request