Restricting API Keys

After successfully generating and setting up your API key, there are a few additional steps to complete. These include configuring security measures to prevent unauthorized use of your key, and setting a budget to ensure you don’t exceed your spending limits.

To avoid this, please follow the steps below:

  1. Access Google APIs → Click Credentials.

  1. Navigate to API key → Click the pencil icon to edit.

  1. Now in the API key settings site, there are some adjustments that need to be done. In the Key restrictions, you can see 2 tabs:

Application restrictions

Select the option HTTP referrers (websites) and enter the website domain in the field. Use the format *.example.com/. Any string can replace the asterisk, which means that it is even for subdomains.

API restrictions

Check for any limitations applied to your key. Make sure that "Restrict key" is enabled — that all four required services are included in the allowed list: Maps JavaScript API, Geocoding API, Geolocation API, and Places API.

→ Click Save.

Last updated

Was this helpful?