Here's a quote from the docs that'll help:
Rate Limit
- The Dashboard API is limited to 5 requests per second, per organization.
- A burst of 5 additional calls are allowed in the first second, so a maximum of 15 calls in the first 2 seconds.
- The rate limiting technique is based off of the token bucket model.
- An error with a 429 status code will be returned when the rate limit has been exceeded.
RATE LIMIT ERRORS
If the defined rate limit is exceeded, Dashboard API will reply with the 429 (rate limit exceeded) error code. This response will also return a Retry-After header indicating how long the client should wait before making a follow-up request.
- The Retry-After key contains the number of seconds the client should delay. A simple example which minimizes rate limit errors:
response = requests.request("GET", url, headers=headers)
if response.status_code == 200:
# Success logic
elif response.status_code == 429:
time.sleep(int(response.headers["Retry-After"]))
else:
# Handle other response codes
- Expect to backoff for 1 - 2 seconds if the limit has been exceeded. You may have to wait potentially longer if a large number of requests were made within this timeframe.
Source:
https://documenter.getpostman.com/view/7928889/SVmsVg6K?version=latest
Another thing you should consider is using action batches. That'll help to optimize your workflow, thus lowering the amount of calls needed. Check this blog post for all info on that:
https://meraki.cisco.com/blog/2019/06/action-batches-a-recipe-for-success/