The Google Maps JavaScript API writes error and warning messages to
window.console .
The following tables list the possible error codes returned by the
Google Maps JavaScript API, with a description of the cause and how you can
fix the problem.
For help on finding the error messages, see the section on
checking errors in your browser.
Google Maps JavaScript API Error Codes
If you encounter an error while loading the Google Maps JavaScript API, please see the table below to find explanations for the error codes.
| Error Code | Message | Description |
|---|---|---|
InvalidKeyOrNotAuthorizedMapError
|
The provided Google API key is invalid or this site is not authorized to use it. |
The API key included in the script element that loads the API is invalid, or the current URL loading the Google Maps JavaScript API has not been added to the list of allowed referrers. You may need to enable the Google Maps JavaScript API under APIs in the Google API Console. See Obtaining an API key. |
NotLoadingAPIFromGoogleMapError
|
The Google Maps JavaScript API must be downloaded directly from Google's servers. |
The script element that loads the Google Maps JavaScript API is not being included correctly on your page. In order for the API to work correctly, it must be loaded directly from https://maps.googleapis.com. See Loading the Maps API. |
TOSViolationMapError
|
This website appears to violate the Google Maps API Terms of Service. The Google Maps API has been disabled for this website. |
Your usage appears to be outside the Terms of Service. Please see Google Maps API and Free Public Access or contact us if you feel this is incorrect. |
UnauthorizedURLForClientIdMapError
|
This URL is not authorized to use the Google Maps Client ID provided. |
The Maps for Work client ID included in the script load is invalid, expired, or the current address loading the Google Maps JavaScript API has not been added to the list of authorized URLs. |
Google Maps JavaScript API Error Codes for Developers
If you find an error on Chrome JavaScript Console, Firefox Web Console or any other equivalent tools on your browsers, please see the table below to find explanations for the error codes.
There are 2 types of error codes, errors and warnings. An error indicates a severe issue which occurred while loading the Google Maps JavaScript API. Your page cannot load the API correctly, and the API will not work on that page. A warning is a supplemental message about the loading of the Google Maps JavaScript API. The warning describes the possible reasons for an error, or suggests potential issues in your code that loads the Google Maps JavaScript API. If you receive only warnings without any errors, the API will work correctly on that page. But we recommend that you fix the potential issues as well.
| Developer Error Code | Type | Description |
|---|---|---|
ApiNotActivatedMapError
|
Error |
The Google Maps JavaScript API is not activated on your API project. You may need to enable the Google Maps JavaScript API under APIs in the Google API Console. See Obtaining an API key. |
DeletedApiProjectMapError
|
Error |
Your API project may have been deleted from the Google API Console. Please check the project for which you generated the API key that's included in JavaScript API loader. You can create a new API project and get a new key on the Google API Console. See Obtaining an API key. |
ExpiredKeyMapError
|
Error |
The API key included in the script element that loads the API has expired. You may need to generate a new API key in the Google API Console. See Obtaining an API key. |
InvalidClientIdMapError
|
Error |
The client ID included in the script element that loads the API is invalid, or expired. Please make sure you are using your client ID correctly. The client ID should start with "gme-" prefix. If you see this error even when using your client ID correctly, the client ID may have expired. Please contact your Google Account Manager.
If you do not have Google Maps for Work license, you need to use a
See Your client ID. |
InvalidKeyMapError
|
Error |
The API key included in the script element that loads the API is not found. Please make sure you are using a correct API key. You can generate a new API key on the Google API Console. See Obtaining an API key. |
MissingKeyMapError
|
Error |
The script element that loads the API is missing the required authentication
parameter. If you are using the standard Maps JavaScript API,
you must use a See the guide to API keys and client IDs. |
ProjectDeniedMapError
|
Error |
Your request has not been completed. You may be able to find the more details about the error in the Google API Console. See Google API Console. |
RefererDeniedMapError
|
Error |
Your request has not been completed. You may be able to find the more details about the error in the Google API Console. See Google API Console. |
RefererNotAllowedMapError
|
Error |
The current URL loading the Google Maps JavaScript API has not been added to the list of allowed referrers. Please check the referrer settings of your API key on the Google API Console. See API keys in the Google API Console. For more information, see Best practices for securely using API keys. |
ClientIdLooksLikeCryptoKey
|
Warning |
You may have supplied a cryptographic key in the See the guide to client IDs for Google Maps for Work customers. |
ClientIdLooksLikeKey
|
Warning |
You may have supplied an API key in the See the guide to client IDs and API keys. |
InvalidChannel
|
Warning |
You may have supplied an invalid |
InvalidClientId
|
Warning |
The See the guide to client IDs for Google Maps for Work customers. |
InvalidKey
|
Warning |
The API key included in the script element that loads the API does not look correct. Please make sure you are using a correct API key. You can generate a new API key on the Google API Console. See Obtaining an API key. |
InvalidVersion
|
Warning |
You may have supplied an incorrect version number in your script element. Please make sure you are using a correct version number. |
KeyLooksLikeClientId
|
Warning |
You may have supplied a client ID as a key parameter. If you
have a Google Maps for Work license, please specify your client ID as a
client parameter instead of the key parameter. If you have a
Google Maps APIs Premium Plan, you can use a client parameter
or a key parameter. If you don't have any licenses,
you must use a key parameter, instead of a client
parameter.
See the guide to client IDs and API keys |
KeyLooksLikeCryptoKey
|
Warning |
You may have supplied a cryptographic key as a See the guide to client IDs and API keys |
KeyLooksLikeProjectNumber
|
Warning |
You may have supplied a project number as a See Obtaining an API key. |
NoApiKeys
|
Warning |
The script element that loads the API has no API key. Please make sure
you include a valid API key as a See Obtaining an API key. |
RetiredVersion
|
Warning |
You may have supplied a retired version in your script element. The versions 3.0 - 3.19 have been retired, and you might be receiving 3.20 instead. Please update your application to use one of the available versions. |
SensorNotRequired
|
Warning |
The |
SignatureNotRequired
|
Warning |
The |
Checking Errors in Your Browser
The Google Maps JavaScript API writes error messages to
window.console. This section explains how you can check the
window.console output in Google Chrome. If you are using any other
browsers, please check the developer documentation for your browser. For your
reference, this is a list of tools to check window.console output
in some other browsers.
- Console for Internet Explorer.
- Web Console for Firefox.
- Remote debugging for Android.
- Web Inspector for iOS.
In Chrome, you can use the
JavaScript Console
to check window.console output as follows.
- To open the Developer Tools, select the menu icon > More Tools > Developer Tools.
- To open the JavaScript Console, press the ESC key on your keyboard. The ESC key will toggle the JavaScript Console. If you close the console, press the ESC key again to open it.
If any errors or warnings occurred when loading the Google Maps JavaScript API, they appear as one or more lines in the console. An error or warning message has the following format:
Google Maps API error: [ERROR CODE] [Link to API document]
or
Google Maps API warning: [ERROR CODE] [Link to API document]
You can check the error codes table above to find the error code in the error message. You can also find the details about the error message in the API document linked from the message.
Note: You can listen for authentication errors programmatically.
