Fix OverQuotaMapError on Google Maps
An intermittent map almost always means a limit has been reached. The map works until the quota runs out, then fails for everyone until it resets. The fix is to find what is using the requests before you raise anything.
How to tell this is your problem
- The map works early in the day and fails later, then works again the next morning.
- The console shows OverQuotaMapError, sometimes only on busy pages or at busy times.
- The usage graph in Cloud Console rises and then runs flat along a ceiling, instead of following your traffic.
- Request counts are far higher than your visitor numbers.
This is what the console shows:
Google's description: “The number of requests has exceeded the usage limits for the Maps JavaScript API.” For services such as the Geocoder, the same situation shows up as the status OVER_QUERY_LIMIT instead.
Why it happens
There are two kinds of limit, and they behave differently:
- A per-day quota. Google says that when a project reaches a daily limit, requests to that API fail for the rest of the day, and daily quotas reset at midnight Pacific time. For UK sites that means the map comes back at around 8am for most of the year. This produces the classic “works in the morning” pattern.
- A per-minute limit. Google lists limits of 30,000 map loads per minute per project and 300 map loads per minute per IP address. A single scraper or a runaway script on one IP can hit the second one while real visitors are fine.
Most daily caps that cause this error were set by someone on purpose, to control spend, and then traffic grew past them. What uses them up, most likely first:
- Bots and crawlers. Crawlers that run JavaScript, SEO tools, uptime monitors and scrapers each trigger a map load if the map is created as soon as the page opens.
- Duplicate loaders. Two plugins each loading the API and each creating a map on the same page.
- Maps on every page. A map in the footer or sidebar of every page, when it only needs to be on the contact page.
- A code loop. A script that recreates the map or geocodes the same address on every render.
- A leaked key. Someone else's site using your key because it has no website restriction.
- A cap that is simply too low for genuine traffic after a campaign or seasonal peak.
The fix, step by step
- 01In Cloud Console, open Google Maps Platform → Quotas for the project that owns the key. Select the API from the console error and look at each quota and its current usage. Note which one is at its limit and whether it is per day or per minute.
- 02Open Google Maps Platform → Metrics and group or filter the traffic by API and by credential. You want to know which key and which API make the requests, and at what times.
- 03Compare those numbers with your analytics. If map requests are many times your page views, something other than real visitors is creating them.
- 04Check the key's Application restrictions. If it is set to None, add website restrictions now, and treat the key as leaked. See rotating a leaked key.
- 05Open a page with a map and look at the network tab. Filter for maps/api/js. More than one loader request means a duplicate loader. See finding a duplicate Maps loader.
- 06Remove maps from pages that don't need them, and load the remaining ones when a visitor interacts. See lazy-loading a map without quota spikes.
- 07Only then adjust the cap. On the Quotas page, select the quota, click Edit, enter a new value and submit. Set it comfortably above your real daily peak.
Google says that visitors can't fix this error. If you see it on someone else's site, tell the owner. If you own the site and need maps back immediately, raising the cap is a stopgap. The traffic that drained it will drain a higher cap too.
Reading the pattern
| What you see | Likely cause |
|---|---|
| Fails at the same time each day, works after the Pacific midnight reset | Daily cap reached; check what uses it up |
| Fails in short bursts, then recovers within a minute | Per-minute limit, often one IP hammering the page |
| Requests spread over pages nobody visits | Crawlers or a scraper |
| Usage from an API or at a volume you don't recognise | A leaked or unrestricted key |
| Two map loads for each page view | Duplicate loaders or a script creating the map twice |
If you load the API in your own code
Create one map per page and reuse it. Google's cost guidance recommends consolidating maps and updating the viewport, zoom and markers of a single map instead of creating new ones. In single-page apps, create the map once and keep a reference, so route changes don't create a fresh map each time. Cache geocoding results for fixed addresses in your own code where Google's terms allow, or store the coordinates of your own premises once and skip the lookup.
Confirm it is fixed
Watch the metrics graph for a few days. Requests should follow your traffic and stay well below the cap. Load a page with a map at your busiest time and confirm the console is clean.
Run a scan of each page that has a map. It lists every Maps request the page makes, so a second loader or an unexpected API call stands out. Monitoring will email you if the error returns.
Common questions
When does the Google Maps daily quota reset?
Google says daily quotas reset at midnight Pacific time. In the UK that is 8am for most of the year, and 7am for a few weeks in spring and autumn when the US and UK clocks change on different dates.
Why does the map work for me but fail for customers in the afternoon?
A daily cap is being reached partway through the day. Once it runs out, every visitor gets the error until the reset, so testing in the morning can hide it.
Will raising the quota cost me money?
It can. A quota limits how many requests are accepted. Every request above the free usage is billed, so a higher cap allows a higher bill.
Do bots really use up my Maps quota?
Any client that runs your page's JavaScript and creates the map counts as a map load. Loading the map only when a visitor interacts stops most of this.
A scan tells you in about twelve seconds, from a clean session.