> For the complete documentation index, see [llms.txt](https://help.spicegems.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.spicegems.com/esl-easy-store-locator/google-maps/secure-your-google-maps-api-key.md).

# Secure Your Google Maps API Key

Google offers a robust and secure method for using your API key, making it easy to manage while ensuring it is only utilized on your designated websites. This approach enhances both security and ease of use, providing peace of mind as you integrate your API.

If you have already created the API key, follow the below steps to apply the restrictions for utilising it only on specified websites :

### Step 1: Access API Credentials

1. Open **Google Cloud Console**.
2. Navigate to **APIs & Services** → **Credentials**.
3. Locate your **API key** and click on it to edit the restrictions.

<figure><img src="/files/0wiREaE48H3j3yVU16T7" alt=""><figcaption></figcaption></figure>

### Step 2: Set Application Restrictions

1. In the **Application restrictions** section, select **Websites**.
2. This limits the API key usage to specific domains only.

<figure><img src="/files/NLPkdfofn5ufGO55UWgZ" alt=""><figcaption></figcaption></figure>

### Step 3: Add Website Restrictions

In the **Website restrictions** field, enter your store domains **without** `https://`, as shown below.

<figure><img src="/files/06OMmu0KUshL64vAgyHA" alt=""><figcaption></figcaption></figure>

Example entries:

```
example.com
*.example.com
```

Required domains for Shopify and the app:

```
example.myshopify.com
*.shopifypreview.com
*.spicegems.com
```

{% hint style="info" %}
**Important notes:**

* Replace `example.com` with your actual store domain.
* If your store uses a `www` prefix (e.g., `www.example.com)` you do **not** need to add it separately. Using `example.com` is sufficient.
  {% endhint %}

### Step 4: Apply API Restrictions

1. Scroll to the **API restrictions** section.
2. Select the **Restrict key**.
3. Choose the required **API services** from the list (based on your integration needs).

<figure><img src="/files/OojGdfRP8FNxnAWfi63C" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Note: Following API services must be added.

Geolocation API\
Geocoding API\
Maps Javascript API\
Places API\
Places API (new)
{% endhint %}

### Step 5: Save Your Changes

1. Click **Save** at the bottom of the page.
2. Your API key restrictions will now be applied and enforced.

<figure><img src="/files/fj2W8dOzLBNKrvghllM7" alt=""><figcaption></figcaption></figure>
