Google Maps Platform drop-in replacement
The Geocoding, Places Autocomplete, Time Zone and Elevation web services all answer at the same paths on gapi.mygeocode.com, with the same JSON shape Google returns. Change the host, put your My Geocode key in the key parameter, and the rest of your code stays as it is.
Change one hostname
| Original host |
|
|---|---|
| Use instead | gapi.mygeocode.com |
| Key parameter | key (put your My Geocode key here, or leave it out for the free 2,500 a day) |
curl "https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=YOUR_GOOGLE_KEY"curl "https://gapi.mygeocode.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=YOUR_MYGEOCODE_KEY"Why people move
Google requires a billing account and a key on every call, and bills per request across each SKU. Here the first 2,500 calls a day need neither, and the price after that is $0.001 per request or a flat €50 a month.
Try it before you sign up for anything. Requests to gapi.mygeocode.com count toward the same 2,500 a day you get on our own endpoints, with no key and no account. Above that, credits at $0.001 per request or €50 a month unlimited. Signing up takes an email address and nothing else.
Endpoints
| Path on gapi.mygeocode.com | What it does | Backed by |
|---|---|---|
/maps/api/geocode/json?address=... | Forward geocoding | Forward geocoding |
/maps/api/geocode/json?latlng=lat,lng | Reverse geocoding | Reverse geocoding |
/maps/api/place/autocomplete/json?input=... | Places Autocomplete (predictions with coordinates) | Address autocomplete |
/maps/api/timezone/json?location=lat,lng×tamp=... | Time Zone API | Timezone lookup |
/maps/api/elevation/json?locations=lat,lng|lat,lng | Elevation API | Elevation lookup |
Example response
This is what the request above returns. Field names, nesting and types follow Google Maps. Only the data behind them is ours.
{
"results": [
{
"address_components": [
{ "long_name": "1600", "short_name": "1600", "types": ["street_number"] },
{ "long_name": "Amphitheatre Parkway", "short_name": "Amphitheatre Pkwy", "types": ["route"] },
{ "long_name": "Mountain View", "short_name": "Mountain View", "types": ["locality", "political"] },
{ "long_name": "Santa Clara County", "short_name": "Santa Clara County", "types": ["administrative_area_level_2", "political"] },
{ "long_name": "California", "short_name": "CA", "types": ["administrative_area_level_1", "political"] },
{ "long_name": "United States", "short_name": "US", "types": ["country", "political"] },
{ "long_name": "94043", "short_name": "94043", "types": ["postal_code"] }
],
"formatted_address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
"geometry": {
"location": { "lat": 37.4224428, "lng": -122.0842467 },
"location_type": "ROOFTOP",
"viewport": {
"northeast": { "lat": 37.4237918, "lng": -122.0828977 },
"southwest": { "lat": 37.4210938, "lng": -122.0855957 }
}
},
"place_id": "mg.us.addr.5e1b2c7a9f",
"plus_code": { "compound_code": "CWC8+W5 Mountain View, CA, USA", "global_code": "849VCWC8+W5" },
"types": ["street_address"]
}
],
"status": "OK"
}Details and differences
- status values follow Google's list: OK, ZERO_RESULTS, OVER_QUERY_LIMIT, REQUEST_DENIED, INVALID_REQUEST. When your free quota is used up and no account is attached you get OVER_QUERY_LIMIT with HTTP 200, exactly as Google's clients expect.
- place_id values are ours and are stable, but they are not Google place IDs. Do not mix them with a Google Places Details call.
- components, region, bounds and language parameters are honoured. The result_type and location_type filters on reverse requests are honoured too.
- plus_code is computed from the coordinates, so it is always present.
- The Google Maps JavaScript API has its own drop-in loader. See the JavaScript drop-ins page.
If your client depends on a field or behaviour that is not listed here, tell us. Compatibility gaps get fixed quickly because they are usually small.
Other drop-in hosts
- Bing Maps
- HERE
- Mapbox
- Geocode.Farm
- Nominatim (OSM)
- OpenCage
- LocationIQ
- Geoapify
- TomTom
- MapQuest
- Geocodio
- PositionStack
- ip-api
- ipinfo
- ipstack
- Open-Elevation
How the drop-ins work, the overview, and the JavaScript library drop-ins.