Skip to content

Google Map API Key

How to Generate a Google Maps API Key

Official Google Pages

Steps to Generate a Google Maps API Key

  1. Sign in to Google Cloud Console.
  2. Create a new project or select an existing project.
  3. Enable billing for the selected project.
  4. Enable the required API(s), such as:
    • Maps JavaScript API
    • Places API
    • Geocoding API
    • Maps SDK for Android
    • Maps SDK for iOS
  5. Go to APIs & Services > Credentials.
  6. Click Create Credentials.
  7. Select API Key.
  8. Copy the generated API key.
  9. Restrict the API key for security:
    • Application restrictions
      • HTTP referrers for websites
      • IP addresses for servers
      • Android apps
      • iOS apps
    • API restrictions
      • Limit the key to only the APIs you need
  10. Use the key in your application.
  • https://yourdomain.com/*
  • https://www.yourdomain.com/*
  • http://localhost:*/*

Notes

  • Make sure billing is enabled.
  • Make sure the required API is enabled.
  • Always restrict your API key before using it in production.