Buy

MapKey Creation & Restriction Guide

 

1.Overview

This guide provides step-by-step instructions to create a Google Maps API key, enable necessary APIs, and set restrictions for secure usage.

2.Create a MapKey

  1. Go to Google Cloud Console.
  2. Navigate to Menu → Billing and link a billing account.
    • If billing is not enabled, add a billing account first, then enable it.
  3. Go to APIs & Services → Library and enable the following APIs:
    • Mandatory: Maps SDK for Android, Maps SDK for iOS, Maps JavaScript API, Places API (New), Routes API, Geolocation API, Geocoding API, Cloud Translation API.
    • Optional: Directions API, Distance Matrix API, Places API (Legacy).
  4. Once all required APIs are enabled, go to APIs & Services → Credentials → Create Credentials → API Key.
  5. Your API key is now created.

3.Restrict the MapKey

  1. Go to Edit API Key.
  2. Under Application restrictions, select one of the following:
    • Android apps: Add package name and SHA1 key.
    • iOS apps: Add bundle ID.
    • IP addresses: Add allowed IP addresses.
    • Websites: Add allowed website URLs.
  3. Under API restrictions, select Restrict key and choose APIs according to restriction type:
    • Android: Geocoding API, Geolocation API, Maps SDK for Android, Routes API, Places API (New).
    • iOS: Geocoding API, Geolocation API, Maps SDK for iOS, Routes API, Places API (New).
    • Website / IP address: Geocoding API, Geolocation API, Maps JavaScript API, Routes API, Places API (New), Cloud Translation API.
  4. Save your changes.