> [!CAUTION]
> **Reminder:** To use the Maps JavaScript API:
>
> - All Maps JavaScript API requests must include an API key; we no longer support keyless access.
> - You must [enable billing](https://console.cloud.google.com/project/_/billing/enable?utm_source=Docs_BillingNudge) on each of your projects.

### API Key and Billing Errors


Under certain circumstances, a darkened map, or 'negative' Street View image,
watermarked with the text "for development purposes only", may be displayed.
This behavior typically indicates issues with either an API key or billing.
In order to use Google Maps Platform products, billing must be enabled on your account,
and all requests must include a valid API key. The following flow will help troubleshoot this:

#### Are you using an API key?

#### I'm not sure. How can I check if I am using an API key?

An API key is passed as the `key` parameter in the URL that is used to load the
Maps JavaScript API. Here are a few options to check if you are using an API key:

- Use the [Google Maps Platform API Checker](https://chrome.google.com/webstore/detail/google-maps-platform-api/mlikepnkghhlnkgeejmlkfeheihlehne) Chrome extension. This allows you to determine if your website is properly implementing Google's licensed Maps APIs.
- If you are using a library or plugin to load the Maps JavaScript API, check the settings for that library and look for an API key option.
- Check [errors in your browser](https://developers.google.com/maps/documentation/javascript/error-messages.md.txt#checking-errors). If you see the following messages, you are not using your API key correctly:
  - Google Maps JavaScript API warning: [NoApiKeys](https://developers.google.com/maps/documentation/javascript/error-messages.md.txt#no-api-keys)
  - Google Maps JavaScript API error: [MissingKeyMapError](https://developers.google.com/maps/documentation/javascript/error-messages.md.txt#missing-key-map-error)

#### For web developers:

- If you have access to the source code of your application, look for the `<script>` tag which is used to load the Maps JavaScript API. When loading the Maps JavaScript API, substitute `YOUR_API_KEY` in the code below with your API key.

  ```html
    <script async defer
      src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">
    </script>
  ```
- Check the network traffic generated by your website in the browser. In Chrome, this can be viewed using the [DevTools](https://developers.google.com/web/tools/chrome-devtools) **Network** tab. Here you will see the network requests made by your website. Requests made using the Maps JavaScript API will be under the path `maps/api/js`. Here you can confirm if the requests are using the `key` parameter. It may be helpful to [filter your network traffic](https://developer.chrome.com/docs/devtools/network/reference#filter) by `maps/api/js` when viewing the **Network** tab.

#### No, I am not using an API key.

To get an API key, click the button below. If you do not see a guided setup, follow the
full instructions at [Get Started with Google Maps
Platform](https://developers.google.com/maps/get-started#quickstart).


[Get Started](https://developers.google.com/maps/get-started.md.txt)

#### Yes, I am using an API key.

Great! Let's move on and check if a billing account is attached to your project.

#### Is a billing account attached to your project?

#### I'm not sure. How can I check if a billing account is attached to my project?

Go to the [Billing page](https://console.cloud.google.com/project/_/billing/enable?utm_source=Docs_BillingNudge) in the Google Cloud console and select the project under which your API key was created.
To confirm the key is associated with the project:

1. Go to the **Credentials** section, which can be accessed from the left side bar under **Google Maps Platform \> Credentials**.
2. Check that the API key you currently use on your website is listed. If that's not the case, switch to a different project, and check the credentials there.
3. If you cannot locate the project for your API key, you may have lost access to this project. Ask others in your organization for help. If the original project cannot be located, you should:
   1. Create a new project. This can be done by selecting **New Project** from the projects list, or by selecting **Create Project** via the [Resource Manager page](https://console.cloud.google.com/cloud-resource-manager).
   2. Create a new API key. This can be done on the **Credentials** page. Once there click **Create credentials** and then select **API key**.


Once you have located your project in the Cloud console,
check if a billing account is attached by navigating to the [Billing](https://console.cloud.google.com/project/_/billing) section in the left side menu.

#### No, a billing account is not attached to my project.

Go to the [Enable Billing](https://console.cloud.google.com/project/_/billing/enable?utm_source=Docs_BillingNudge) page in the Cloud console
and add a billing account to your project. For additional information, see
[Get Started with Google Maps Platform](https://developers.google.com/maps/get-started.md.txt).

#### Yes, a billing account is attached to my project.

Great! Let's make sure the provided billing method is valid.

#### Is the provided billing method no longer valid (for example, an expired credit card)?

You [can add, remove, or update a payment method](https://cloud.google.com/billing/docs/how-to/payment-methods) in the Cloud console.

#### Is there an exceeded self-imposed daily limit on the API?

If you have set a daily limit on any of your APIs, which is common to prevent unexpected increases,
you can resolve this by [increasing your daily limit](https://developers.google.com/maps/faq.md.txt#usage_cap).

You can check your daily limits by going to the
[APIs \& Services Dashboard](https://console.cloud.google.com/project/_/apiui/apis/enabled?utm_source=Docs_EnabledAPIsView) in the
Cloud console. Once there:

1. Select a project if prompted.
2. Select an API from the list, then click the **Quotas** tab.

#### Does your API key have an IP addresses restriction?

API keys with an **IP addresses** restriction can only be used with web services that are
intended for use from the server side (such as the
[Geocoding API](https://developers.google.com/maps/documentation/geocoding/start)
and other [Web Service APIs](https://developers.google.com/maps/apis-by-platform.md.txt)).
Most of these web services have equivalent services within the Maps JavaScript API (for example, see the
[Geocoding Service](https://developers.google.com/maps/documentation/javascript/geocoding.md.txt)).
To use the Maps JavaScript API client side services, you will need to create a separate API key which
can be secured with an **HTTP referrers** restriction (see
[Get, add, and restrict an API key](https://developers.google.com/maps/get-started.md.txt#api-key)).

### If your code isn't working:

To help you get your maps code up and running, Brendan Kenny and Mano Marks point out
some common mistakes and how to fix them in this video.
[Video](https://www.youtube.com/watch?v=21PDd17dnnI)

- Look for typos. Remember that JavaScript is a case-sensitive language.
- Check the basics - some of the most common problems occur with the initial map creation. Such as:
  - Confirm that you've specified the `zoom` and `center` properties in your map options.
  - Ensure that you have declared a div element in which the map will appear on the screen.
  - Ensure that the `div` element for the map has an explicit non-zero CSS height (for example, `height: 400px`). By default, `div` elements are created with a height of 0, and are therefore invisible.

  Refer to our examples for a [reference
  implementation](https://developers.google.com/maps/documentation/javascript/examples/map-simple).
- Use a JavaScript debugger to help identify problems, like the one available in the [Chrome
  Developer Tools](https://developers.google.com/chrome-developer-tools/docs/javascript-debugging). Start by looking in the JavaScript console for errors such as [`InvalidKeyMapError`](https://developers.google.com/maps/documentation/javascript/error-messages.md.txt#invalid-key-map-error) or [`ApiNotActivatedMapError`](https://developers.google.com/maps/documentation/javascript/error-messages.md.txt#api-not-activated-map-error), and see the [Error Messages](https://developers.google.com/maps/documentation/javascript/error-messages.md.txt) guide to resolve them.
- Post questions to [Stack
  Overflow](https://stackoverflow.com/questions/ask?tags=google-maps-api-3,google-maps). Guidelines on how to post great questions are available on the [Support](https://developers.google.com/maps/support.md.txt) page.