Avoid hitting the API rate limit for high-scale

CiscoUser
Here to help

Avoid hitting the API rate limit for high-scale

Hi,

 

I am trying to commit many GET commands, in order to monitor a setup with many organizations, networks, devices, clients.

 

1. Is there a way to exceed the 5 calls a second limitation? maybe through a subscription / license / other way.

 

2. I noticed there is action batches option and API manual for it:

"Use Action Batches for bulk constructive/destructive operations (PUTPOSTDELETE)"

 

Does someone know if it supports or will support batched GET commands?

 

 

Thank you in advance

3 REPLIES 3
sungod
Getting noticed

Afaik acton batches don't support the monitoring calls.

 

I use Python scripts with the API package to gather stats for multiple organizations, some have hundreds of networks, it doesn't take too long.

 

Outline...

 

Use aio to issue all calls of a given type 'at once', i.e. for every network, or every device on a network.

 

Use the calls that retrieve data for an entire organization or network, avoid per-device calls whenever possible.

 

Rate limiting is inevitable, you can adjust the package parameters, but calls will still fail due to the sheer number. To cope with this, within the task code I add an extra retry loop that does progressive backoff, then it just keeps on trying until it succeeds.

 

It's not elegant, but it's proven to be reliable.

 

Thanks for the answer @sungod .

 

"Use the calls that retrieve data for an entire organization or network, avoid per-device calls whenever possible."

I noticed the API ability to fetch devices from an organization. The rest of the things can only be fetched at network level for now: such as Vlans, SSIDs, Clients.

 

"I use Python scripts with the API package to gather stats for multiple organizations, some have hundreds of networks, it doesn't take too long."

Too long is subjective 🙂
e.g. 10 organizations with 100 networks, collecting all Vlans would take 100 calls x 10 times per each = 1000 calls. 

Under the limit of 5 calls a seconds it is 200 seconds for Vlans, same for SSIDS and Clients, 600 seconds for all, still significant time I am trying to decrease.

Bettencourt
Meraki Employee

Happy Sunday @CiscoUser 

As per Cisco Meraki documentation, APIs are rate limited to 5 calls per second per organisation.


https://documentation.meraki.com/General_Administration/Other_Topics/Cisco_Meraki_Dashboard_API

 

This limit is Cisco Meraki wide and there is no way to increase this limit, at least for the time being.


Please make use to the Make-a-Wish button in your dashboard to give your feedback to the Cisco Meraki team.

 

Keep an eye out on the API documentation as it will be update whenever any changes are made, and on that note, also regularly check the Announcements button at the top of your dashboard and the new released features section under Help > New Features.


Have a good weekend!

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.