How to use Google Maps Platform — a practical guide

If you're here, you probably want working code in five minutes. That's exactly what this guide does.

Five steps to get started

  1. 1
    Create a project in Google Cloud Console.
  2. 2
    Enable the specific APIs you need (Maps JS, Places, Directions…).
  3. 3
    Create an API key and restrict it (HTTP referrer / IP).
  4. 4
    Mind the $200/month credit — roughly 28,500 Places calls.

Shortest snippet that will actually run

curl "https://maps.googleapis.com/maps/api/geocode/json?address=Dizengoff+99,Tel+Aviv&key=YOUR_KEY"

Common mistakes (the honest list)

Always restrict keys to specific domains.
For business search use Places API; for autocomplete use Places Autocomplete (cheaper).
Cache previously-geocoded addresses — saves ~70% of cost.