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.
  5. Google Map Keys and their restrictions are as follows

    Map Keys Application Restriction API Restriction
    Admin Panel Key (Javascript) Website ( Server Domain ) Geocoding API, Geolocation API, Maps JavaScript API, Routes API, Places API (New)
    Admin Panel Key (MyRoute) IP Addresses (Server IP Addresses [IPv4/IPv6 - IPv6 if IPv6 defined]) Cloud Translation API, Routes API
    Android Key Android apps ( add package name and SHA-1 [debug, release, Play Console] ) Maps SDK for Android, Places API (New), Geocoding API, Geolocation API, Routes API, Directions API
    IOS Key IOS apps ( add iOS bundle identifier [e.g., com.yourcompany.taxiapp]) Maps SDK for IOS, Places API (New), Geocoding API, Geolocation API, Routes API, Directions API