> For the complete documentation index, see [llms.txt](https://uxper.gitbook.io/togo-wordpress/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://uxper.gitbook.io/togo-wordpress/guide-to-obtaining-an-api-key-for-google-maps-javascript-api.md).

# Guide to Obtaining an API Key for Google Maps JavaScript API

### Requirements

* A Google account (Gmail or Google Workspace).
* A credit card or payment method to enable Google Cloud Platform (GCP). Note: Google offers a $200 free credit for new users, typically sufficient for testing within the free tier.

### Steps

#### Step 1: Create a Project in Google Cloud Platform

1. **Access Google Cloud Console**:
   * Open a browser and navigate to [Google Cloud Console](https://console.cloud.google.com/).
   * Sign in with your Google account.
2. **Create a new project**:
   * Click the project dropdown menu (top-left corner, typically showing the current project name).
   * Select **New Project**.
   * Name the project, e.g., AnimatingSymbolsDemo.
   * Click **Create**.
3. **Select the project**:
   * After creation, select the newly created project from the project dropdown menu.

#### Step 2: Enable Google Maps JavaScript API

1. **Open Library**:
   * In Google Cloud Console, click **Navigation Menu** (☰) > **APIs & Services** > **Library**.
2. **Find and enable API**:
   * Search for **Maps JavaScript API** in the search bar.
   * Click **Maps JavaScript API** and select **Enable**.
   * If the **Enable** button is not visible, the API is already enabled.

#### Step 3: Create an API Key

1. **Access Credentials**:
   * From **APIs & Services**, select **Credentials**.
2. **Generate API Key**:
   * Click **Create Credentials** > **API Key**.
   * An API Key will be generated and displayed. Copy this key for later use.
3. **Secure the API Key (recommended)**:
   * Click **Restrict Key** on the Credentials page.
   * Under **Application restrictions**, select **HTTP referrers (web sites)** and add the URLs where the API will be used (e.g., <http://localhost/\\>\* for local testing or your website’s URL).
   * Under **API restrictions**, select **Restrict key** and choose **Maps JavaScript API** from the list to limit the key’s usage.

#### Step 4: Enable Billing

1. **Link a billing account**:
   * In Google Cloud Console, go to **Billing** via the **Navigation Menu**.
   * Click **Link a billing account** and follow the prompts to add a payment method.
   * Note: Billing must be enabled to use the Maps JavaScript API, but Google’s $200 free monthly credit is usually sufficient for testing.

#### Step 5: Use the API Key in Customizer

1. **Enter the API Key**:
   * Navigate to **Customizer** > **Advanced** > **Google Map API**.
   * Paste the copied API Key into the provided **Google Map API** field.
   * Save the settings to apply the API Key.

#### Notes

* **Free tier limits**: Google provides $200 in free credits monthly for Google Maps Platform. Review the pricing table to ensure usage stays within the free tier.
* **Security**: Do not expose the API Key publicly. Restrict its usage to specific domains.
* **Troubleshooting**: If the map fails to load, verify the API Key restrictions and ensure the Maps JavaScript API is enabled.
* **References**: Consult the Google Maps JavaScript API documentation and API setup guide for further details.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://uxper.gitbook.io/togo-wordpress/guide-to-obtaining-an-api-key-for-google-maps-javascript-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
