A 429 error is related to rate limiting/throttling (queries per second/QPS). It looks like you are using Bing maps, not Azure Maps so the limits work a bit differently. In Bing Maps, all non-production keys are throttled at around 5 QPS, and the default for production keys is around 50 QPS. If using a production key (e.g. are paying for the service) you can contact the Bing Maps Enterprise Support team (https://www.microsoft.com/en-us/maps/support) and request the limit be raised on your account.
How to avoid getting a 429 error after several calls, eg using SpatialDataService.GeoDataAPIManager.getBoundary?

Hi, I'm trying to get several boundaries using the Bingmaps "Microsoft.Maps.SpatialDataService.GeoDataAPIManager.getBoundary" method. Something like 30/40 calls at the start when you get into the web page. I managed to convert those asynchronous calls into synchronous ones to split the number of calls. It works most of the time but sometimes, it raises a 429 GET error even at the first call that only gets boundaries of one country. When the page is right loaded then, I use layers and don't need to make those 30/40 calls again. I'm currently thinking that saving those results would be a possible solution. Is there a way to save those getboundaries results and load them at the start or any other solution?
Hi @Jonathan,
Yes, you are right about the 429 error!
Azure Maps QPS rate limits
When QPS limits are reached, an HTTP 429 error will be returned. If you are using the Gen 2 or Gen 1 S1 pricing tiers, you can create an Azure Maps Technical Support Request in the Azure portal to increase a specific QPS limit if needed. QPS limits for the Gen 1 S0 pricing tier cannot be increased.
To reduce the number of requests you make to Azure Maps and help you stay within the rate limit.
I may suggest to try different possible ways!!
In a previous QnA post, we saw few suggestions from the Community Subject Leaders as below,
Customer may not cache or store information delivered by the Azure Maps API including but not limited to geocodes and reverse geocodes, map data tiles and route information (the “Results”) for the purpose of scaling such Results to serve multiple users, or to circumvent any functionality in Azure Maps.
Caching and storing Results is permitted where the purpose of caching is to reduce latency times of Customer’s application. Results may not be stored for longer than: (i) the validity period indicated in returned headers; or (ii) 6 months, whichever is the shorter. Notwithstanding the foregoing, Customer may retain continual access to geocodes as long as Customer maintains an active Azure account. Reference
If this answers your query, do click Accept Answer and Yes for this answer as helpful. And, if you have any further query do let us know by commenting in the below section.
Hi @Jonathan, Can you please confirm on the service being used,
rbrundritt is right about the service and the below rate limits.
They mentioned in their post
Microsoft.Maps.SpatialDataService.GeoDataAPIManager.getBoundary
which is exposed by Bing Maps in Bing Maps V8 SDK through the Spatial Data Services module: https://learn.microsoft.com/en-us/bingmaps/v8-web-control/modules/spatial-data-service-module/geodataapimanager-class This module is a JavaScript client library that wraps this service: https://learn.microsoft.com/en-us/bingmaps/spatial-data-services/geodata-api Note that Bing Maps is managed by the Azure Maps team, thus why Bing Maps questions appear under the "Azure-Maps" tag.Sign in to comment