<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error: 429 Client Error: Too Many Requests in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444312#M6897</link>
    <description>&lt;P&gt;Assume you are using the Meraki Python library.&lt;/P&gt;&lt;P&gt;Are you telling the library to &lt;STRONG&gt;wait on retry&lt;/STRONG&gt;? This is important to avoid retries being made too fast.&lt;/P&gt;&lt;P&gt;Combined with setting a generous retry limit should ensure calls eventually complete ok.&lt;/P&gt;&lt;PRE&gt;        wait_on_rate_limit=True,
        maximum_retries=100&lt;/PRE&gt;&lt;P&gt;For instance...&lt;/P&gt;&lt;PRE&gt;    async with meraki.aio.AsyncDashboardAPI(
        api_key=API_KEY,
        base_url='https://api.meraki.com/api/v1/',
        print_console=False,
        output_log=False,
        suppress_logging=True,
        wait_on_rate_limit=True,
        maximum_retries=100
    ) as aiomeraki:&lt;/PRE&gt;&lt;P&gt;If you are using some different code to handle 429s, make sure it is obeying the &lt;SPAN&gt;Retry-After header&lt;/SPAN&gt; in the 429 response, see &lt;A href="https://developer.cisco.com/meraki/api-v1/rate-limit/" target="_blank" rel="noopener nofollow noreferrer"&gt;https://developer.cisco.com/meraki/api-v1/rate-limit/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Sep 2023 10:57:11 GMT</pubDate>
    <dc:creator>sungod</dc:creator>
    <dc:date>2023-09-01T10:57:11Z</dc:date>
    <item>
      <title>Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444311#M6896</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Recently I have been running into this unexpectantly. If I wait 5 or 10 mins it goes away but it kept happening so I ran the API requests summary endpoint each time it happened and I saw thousands of requests with a 429 response.&lt;BR /&gt;&lt;BR /&gt;Since 429 is the too many requests error, I assumed a first call 429 and then it re-try's a thousands times immediately after until it gives up which is what gives me all those 429?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I tried to dig deeper into where they were coming from....&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Adrian4_0-1693553890708.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/263125iEB1D3DF5783BFBBA/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;all the 429 requests were apparently &lt;SPAN&gt;getNetworkWirelessClientCountHistory ?!? - that doesn't make any sense as i only ran that once and it was successful.&lt;BR /&gt;&lt;BR /&gt;also - in the thousands, they seem to alternate from ssid 4 to ssid14 over and over - not sure what that is about as I am not jumping around SSIDs and the one im connected to isnt 4 or 14.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;can anyone shed some light?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 07:37:43 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444311#M6896</guid>
      <dc:creator>Adrian41</dc:creator>
      <dc:date>2023-09-01T07:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444312#M6897</link>
      <description>&lt;P&gt;Assume you are using the Meraki Python library.&lt;/P&gt;&lt;P&gt;Are you telling the library to &lt;STRONG&gt;wait on retry&lt;/STRONG&gt;? This is important to avoid retries being made too fast.&lt;/P&gt;&lt;P&gt;Combined with setting a generous retry limit should ensure calls eventually complete ok.&lt;/P&gt;&lt;PRE&gt;        wait_on_rate_limit=True,
        maximum_retries=100&lt;/PRE&gt;&lt;P&gt;For instance...&lt;/P&gt;&lt;PRE&gt;    async with meraki.aio.AsyncDashboardAPI(
        api_key=API_KEY,
        base_url='https://api.meraki.com/api/v1/',
        print_console=False,
        output_log=False,
        suppress_logging=True,
        wait_on_rate_limit=True,
        maximum_retries=100
    ) as aiomeraki:&lt;/PRE&gt;&lt;P&gt;If you are using some different code to handle 429s, make sure it is obeying the &lt;SPAN&gt;Retry-After header&lt;/SPAN&gt; in the 429 response, see &lt;A href="https://developer.cisco.com/meraki/api-v1/rate-limit/" target="_blank" rel="noopener nofollow noreferrer"&gt;https://developer.cisco.com/meraki/api-v1/rate-limit/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 10:57:11 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444312#M6897</guid>
      <dc:creator>sungod</dc:creator>
      <dc:date>2023-09-01T10:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444313#M6898</link>
      <description>&lt;P&gt;thank you! to be honest I had never come across 429 errors until a day or two ago &lt;SPAN class="lia-unicode-emoji" title=":face_with_tongue:"&gt;&lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 14:29:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444313#M6898</guid>
      <dc:creator>Adrian41</dc:creator>
      <dc:date>2023-09-01T14:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444314#M6899</link>
      <description>&lt;P&gt;I haven't checked - but are you saying wait_on_rate_limit is not True by default?  I'm gobsmacked.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Sep 2023 20:40:39 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444314#M6899</guid>
      <dc:creator>Philip D'Ath</dc:creator>
      <dc:date>2023-09-03T20:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444315#M6900</link>
      <description>&lt;P&gt;Tbh I think it defaults to on, but decades of coding paranoia leads me to always set it explicitly in my scripts &lt;SPAN class="lia-unicode-emoji" title=":grinning_face:"&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2023 05:33:31 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444315#M6900</guid>
      <dc:creator>sungod</dc:creator>
      <dc:date>2023-09-04T05:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444316#M6901</link>
      <description>&lt;P&gt;the problem has returned &lt;SPAN class="lia-unicode-emoji" title=":disappointed_face:"&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;every so often getting 429 errors and when I check the summary I see this  &lt;SPAN class=""&gt;"429"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;1307&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;So two things - one, when it gets a 429, it is clearly re-trying over thousand times in tiny time frame - &lt;BR /&gt;not sure I am using these variable properly&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;wait_on_rate_limit=&lt;SPAN&gt;True,&lt;BR /&gt;&lt;/SPAN&gt;maximum_retries=&lt;SPAN&gt;100&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Am I supposed to pass them as part of the API headers or something?&lt;BR /&gt;&lt;BR /&gt;Secondly, I must still be doing something to trigger the 429 rate limit in the first place. The limit is 5 requests per second I think? After each and every request call I have put in a 0.3 second delay which should mean I cant be sending more than 4 a second so how is this happening?&lt;BR /&gt;&lt;BR /&gt;To produce the delay I am using the time module and setting a global variable of&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;DELAY = &lt;SPAN&gt;0.3&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;then after every request putting the line &lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;time.sleep(DELAY)&lt;/PRE&gt;&lt;DIV&gt;&lt;PRE&gt;networks = requests.get(networks_url&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;headers&lt;/SPAN&gt;=headers&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;verify&lt;/SPAN&gt;=&lt;SPAN&gt;f"&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;root_path&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;/Cisco Umbrella Root CA.crt"&lt;/SPAN&gt;)&lt;BR /&gt;time.sleep(DELAY)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 08 Sep 2023 13:36:23 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444316#M6901</guid>
      <dc:creator>Adrian41</dc:creator>
      <dc:date>2023-09-08T13:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444317#M6902</link>
      <description>&lt;P&gt;Are you using the Meraki Python library?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 13:57:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444317#M6902</guid>
      <dc:creator>sungod</dc:creator>
      <dc:date>2023-09-08T13:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444318#M6903</link>
      <description>&lt;P&gt;Im using "requests" HTTP library&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 14:22:56 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444318#M6903</guid>
      <dc:creator>Adrian41</dc:creator>
      <dc:date>2023-09-08T14:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444319#M6904</link>
      <description>&lt;P&gt;Then you are not using the Meraki Python library.&lt;/P&gt;&lt;P&gt;These set behaviour of the library, if you are not using it then they will not help you.&lt;/P&gt;&lt;PRE&gt;wait_on_rate_limit=&lt;SPAN&gt;True,&lt;BR /&gt;&lt;/SPAN&gt;maximum_retries=&lt;SPAN&gt;100&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;I recommend using the library.&lt;/P&gt;&lt;P&gt;If don't want to use it, you will need to do as suggested above and make sure you code to obey the &lt;SPAN&gt;Retry-After header&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;in the 429 response, see &lt;A href="https://developer.cisco.com/meraki/api-v1/rate-limit/" target="_blank" rel="noopener nofollow noreferrer"&gt;https://developer.cisco.com/meraki/api-v1/rate-limit/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For instance based on the example on the linked page...&lt;/P&gt;&lt;PRE class="lia-code-sample language-python"&gt;&lt;CODE&gt;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&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Sep 2023 14:42:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444319#M6904</guid>
      <dc:creator>sungod</dc:creator>
      <dc:date>2023-09-08T14:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444320#M6905</link>
      <description>&lt;P&gt;I checked, and wait_on_rate_limit is on by default.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/meraki/dashboard-api-python/blob/main/meraki/config.py#L19" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/meraki/dashboard-api-python/blob/main/meraki/config.py#L19&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and maximum_retries defaults to 2.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/meraki/dashboard-api-python/blob/main/meraki/config.py#L37" target="_self" rel="nofollow noopener noreferrer"&gt;https://github.com/meraki/dashboard-api-python/blob/main/meraki/config.py#L37&lt;/A&gt; &lt;/P&gt;&lt;P&gt;And for anyone finding this using Google, here are all the Meraki Python library defaults:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/meraki/dashboard-api-python/blob/main/meraki/config.py" target="_self" rel="nofollow noopener noreferrer"&gt;https://github.com/meraki/dashboard-api-python/blob/main/meraki/config.py&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 22:39:15 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444320#M6905</guid>
      <dc:creator>Philip D'Ath</dc:creator>
      <dc:date>2023-09-08T22:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444321#M6906</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply! makes sense.&lt;BR /&gt;&lt;BR /&gt;However, the 429 error means iv already hit the rate limit, so adding a sleep timer on that code will help reduce the amount of time i have to wait before i can send again (by preventing the re-try spam) but I still have the issue of hitting the limit in the first place &lt;SPAN class="lia-unicode-emoji" title=":disappointed_face:"&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 07:48:23 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444321#M6906</guid>
      <dc:creator>Adrian41</dc:creator>
      <dc:date>2023-09-11T07:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444322#M6907</link>
      <description>&lt;P&gt;The rate limit is just a fact of life, but if you use the back-off and retry mechanism your calls will eventually succeed.&lt;/P&gt;&lt;P&gt;For example, I have scripts using the Meraki Python library aio functions that could potentially make thousands*** of calls 'at once', but the rate limit and retry handling kicks in, things back off and retry, resulting in throughput at the rate limit, the library handles it all for me.&lt;/P&gt;&lt;P&gt;The alternative is to set timers and not issue calls any faster than the limit, but that is unreliable as someone else may make calls on the org at the same time as you and then rate limiting can still occur.&lt;/P&gt;&lt;P&gt;For some purposes you can use action batches, giving higher throughput...&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.cisco.com/meraki/api-v1/action-batches-overview/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developer.cisco.com/meraki/api-v1/action-batches-overview/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;***if I am doing something that will generate high call volumes, I generally split it into smaller chunks to avoid just hammering on the org.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 08:10:27 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444322#M6907</guid>
      <dc:creator>sungod</dc:creator>
      <dc:date>2023-09-11T08:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444323#M6908</link>
      <description>&lt;P&gt;I really wouldn't suggest changing the code to anyone. Requests Retry-After will give you the identical results. I've built all my python codes using Meraki library and when I tried converting it to Requests with the IF statement I still get the same error 429 with a Retry-After in 59 or 60 seconds. Nothing greater or less and I had a max retry of 10. I thought  the Retry-After would give off random seconds, but it was consistently 59 or 60.&lt;/P&gt;&lt;P&gt;Because of this result, I'm adding time.sleep() with a random integer in between API calls and use this setting for my dashboard.&lt;/P&gt;&lt;PRE class="lia-code-sample language-python"&gt;&lt;CODE&gt;dashboard = meraki.DashboardAPI(API_KEY, suppress_logging=True,wait_on_rate_limit=True,maximum_retries=10)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Supposedly Meraki is looking into increasing the API calls to 50, but this was in early Alpha stages when I asked my rep.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 17:01:12 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444323#M6908</guid>
      <dc:creator>RC0008</dc:creator>
      <dc:date>2023-09-18T17:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444324#M6909</link>
      <description>&lt;P&gt;Question to the group. When you hit 429, how do you investigate/troubleshoot/workaround it?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 05:22:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444324#M6909</guid>
      <dc:creator>obrigg</dc:creator>
      <dc:date>2023-09-27T05:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444325#M6910</link>
      <description>&lt;P&gt;I am using the meraki library, with an semaphore of 10 conccurent workers on top. Even so, when i check the number of calls, the 429 are hundreds. I don't know how to stop it. Once it start getting them, it seems it's never stopping&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 09:33:12 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444325#M6910</guid>
      <dc:creator>rares-pauna</dc:creator>
      <dc:date>2025-02-05T09:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444326#M6911</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    async &lt;/SPAN&gt;&lt;SPAN&gt;def&lt;/SPAN&gt; &lt;SPAN&gt;getNetworkAppliancevlansMeraki&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;self&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;id&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class="lia-unicode-emoji" title=":disappointed_face:"&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        async &lt;/SPAN&gt;&lt;SPAN&gt;with&lt;/SPAN&gt; &lt;SPAN&gt;self&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;semaphore&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;            &lt;/SPAN&gt;&lt;SPAN&gt;try:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                async &lt;/SPAN&gt;&lt;SPAN&gt;with&lt;/SPAN&gt; &lt;SPAN&gt;meraki&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;aio&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;AsyncDashboardAPI&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;self&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;api_key&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;self&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;base_url&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;output_log&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;False&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;print_console&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;suppress_logging&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;wait_on_rate_limit&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;maximum_retries&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;10&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;aiomeraki&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                    &lt;/SPAN&gt;&lt;SPAN&gt;vlans&lt;/SPAN&gt;&lt;SPAN&gt; = await &lt;/SPAN&gt;&lt;SPAN&gt;aiomeraki&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;appliance&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;getNetworkApplianceVlans&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;id&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                    &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;vlans&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;            &lt;/SPAN&gt;&lt;SPAN&gt;except&lt;/SPAN&gt; &lt;SPAN&gt;meraki&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;AsyncAPIError&lt;/SPAN&gt; &lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;e&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt; &lt;SPAN&gt;e&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;status&lt;/SPAN&gt;&lt;SPAN&gt; == &lt;/SPAN&gt;&lt;SPAN&gt;429&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                    &lt;/SPAN&gt;&lt;SPAN&gt;retry_after&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;int&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;e&lt;/SPAN&gt;&lt;SPAN&gt;.response_headers.get(&lt;/SPAN&gt;&lt;SPAN&gt;'Retry-After'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                    &lt;/SPAN&gt;&lt;SPAN&gt;log&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;info&lt;/SPAN&gt;&lt;SPAN&gt;(f&lt;/SPAN&gt;&lt;SPAN&gt;"Rate limit exceeded. Retrying after &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;retry_after&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt; seconds."&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                    await &lt;/SPAN&gt;&lt;SPAN&gt;asyncio&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;sleep&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;retry_after&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                &lt;/SPAN&gt;&lt;SPAN&gt;else&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                    &lt;/SPAN&gt;&lt;SPAN&gt;vlans&lt;/SPAN&gt;&lt;SPAN&gt;= []&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                    &lt;/SPAN&gt;&lt;SPAN&gt;log&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;info&lt;/SPAN&gt;&lt;SPAN&gt;(f&lt;/SPAN&gt;&lt;SPAN&gt;"Couldn't get Vlans , error: &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;e&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                    &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;vlans&lt;BR /&gt;Even if i see hundreds of 429 calls, nothing raises my exception&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Feb 2025 09:56:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444326#M6911</guid>
      <dc:creator>rares-pauna</dc:creator>
      <dc:date>2025-02-05T09:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444327#M6912</link>
      <description>&lt;P&gt;The Meraki Python library call does the wait on rate limit itself.&lt;/P&gt;&lt;P&gt;You specify maximum retries 10, so as long as the library call needs fewer retries you would not get a 429 exception.&lt;/P&gt;&lt;P&gt;I.e. ideally you should not need to do the extra wait/retry in your exception handler.&lt;/P&gt;&lt;P&gt;At a high enough rate, I think the 429 mechanism breaks down, so if I know I'll be exceeding the rate limit I tend to add code to limit concurrent calls and/or add some additional back-off/retry that increases retry time exponentially.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 12:34:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444327#M6912</guid>
      <dc:creator>sungod</dc:creator>
      <dc:date>2025-02-05T12:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444328#M6913</link>
      <description>&lt;P&gt;Your script may be using 10 calls per second, but there might be other integrations/script consuming more calls at the same time - resulting in the organization exceeding the rate limit. &lt;BR /&gt;You can use &lt;SPAN&gt;&lt;A href="https://developer.cisco.com/meraki/api-v1/get-organization-api-requests/" target="_blank" rel="noopener nofollow noreferrer"&gt;getOrganizationApiRequests&lt;/A&gt; to examine who/what else is making API calls to the organization.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 13:20:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444328#M6913</guid>
      <dc:creator>obrigg</dc:creator>
      <dc:date>2025-02-05T13:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444329#M6914</link>
      <description>&lt;P&gt;Put your code in chatgpt or any other AI and ask it to help continue the script with 429 errors. It can adjust the script to add some back off timers in between calls. Keep trying until you have a script running without any interruptions.  It will error out and it will give you 429, but the script will continue to run until completed. &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I’ve done this with the meraki and other APIs&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 14:12:21 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444329#M6914</guid>
      <dc:creator>RC0008</dc:creator>
      <dc:date>2025-02-05T14:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Error: 429 Client Error: Too Many Requests</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444330#M6915</link>
      <description>&lt;P&gt;Thanks for the input, that's how i'm already checking the numer of calls by status code. All are provided by my script thst generates an output of aprox. 500 calls(200+429) for an organization with 120 networks, so the number of calls should be 120. My guess it's that meraki's library parameter wait_on_rate_limit and maximum_retries are causing many duplicates that are unnecessary. May the problem be that i initialize the meraki.aio for every call and it is unaware that it has other instances that are already doing the same thing&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 15:55:22 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-429-client-error-too-many-requests/m-p/5444330#M6915</guid>
      <dc:creator>rares-pauna</dc:creator>
      <dc:date>2025-02-05T15:55:22Z</dc:date>
    </item>
  </channel>
</rss>

