Google Maps API

Set up API access for Google Maps, including geocoding, directions, places, and map rendering.

⏱ 5 minutes maps location console.cloud.google.com
getapi google-maps

Prerequisites

  • A Google Cloud account with billing enabled

Credentials

Variable Description Sensitive
GOOGLE_MAPS_API_KEY API key for Google Maps Platform APIs Secret

Setup Steps

  1. 1 Info

    We'll set up a Google Maps API key. You'll need a Google Cloud project with billing enabled — Google provides a $200/month free credit for Maps usage.

  2. 2 Open URL

    Opening the Google Cloud API dashboard. Sign in if prompted.

    https://console.cloud.google.com/apis/dashboard
  3. 3 Choice

    Do you have a Google Cloud project with billing enabled?

  4. 4 Info

    Click the project dropdown at the top, then 'New Project'. Give it a name and create it. Then go to Billing in the sidebar and link a billing account (required for Maps APIs, but you get $200/month free).

  5. 5 Confirm

    Project created with billing enabled?

    Checkpoint — confirm before continuing
  6. 6 Open URL

    Opening the Maps API library. Enable the APIs you need (e.g. Maps JavaScript API, Geocoding API, Places API, Directions API).

    https://console.cloud.google.com/apis/library?filter=category:maps
  7. 7 Confirm

    Relevant Maps APIs enabled?

    Checkpoint — confirm before continuing
  8. 8 Open URL

    Opening the Credentials page. Click 'Create credentials' > 'API key'.

    https://console.cloud.google.com/apis/credentials
  9. 9 Info

    After creating the key, click 'Edit API key' to add restrictions. For web apps, add HTTP referrer restrictions. For server apps, add IP restrictions. Under 'API restrictions', select only the Maps APIs you enabled.

  10. 10 Input

    Copy your API key and paste it here:

    → GOOGLE_MAPS_API_KEY
    Starts with AIza. 35 characters
  11. 11 Validate

    Checking your API key works...

    API key verified. Google Maps is ready to use.
    Couldn't verify the API key. Make sure the Geocoding API is enabled and billing is set up.

Things to Know

  • Google Maps requires billing to be enabled, but you get $200/month in free usage (covers most development and small-scale production).
  • ALWAYS restrict your API key — unrestricted keys can be abused and run up charges on your billing account.
  • Different Maps APIs are billed separately. Check the pricing page for per-request costs.
  • API keys used in client-side JavaScript are visible in the browser. Use HTTP referrer restrictions to prevent abuse.
  • The $200/month free credit does NOT stack — unused credit does not roll over.