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 (optional: any address gets 2,500 requests a day with no key; put your My Geocode key here for credit, packages and a usage history) |
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 a free key covers the first 2,500 calls a day, and the price after that is €0.0001 per request or a flat €50 a month.
Same free allowance, key or not. Requests to gapi.mygeocode.com count toward the same 2,500 free requests a day your address, or your key, gets on our own endpoints. Above that, prepaid credit at €0.0001 per request, or €50 a month for an Unlimited key. Signing up takes a name and an email address, and no card.
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 | 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 Pkwy",
"short_name": "Amphitheatre Pkwy",
"types": ["route"]
},
{
"long_name": "Mountain View",
"short_name": "Mountain View",
"types": ["locality", "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, United States",
"geometry": {
"location": {
"lat": 37.4230649,
"lng": -122.0835246
},
"location_type": "RANGE_INTERPOLATED",
"viewport": {
"northeast": {
"lat": 37.4235677250937,
"lng": -122.0830221992237
},
"southwest": {
"lat": 37.4225690616641,
"lng": -122.0840243607796
}
}
},
"place_id": "07arLXhL2m9G8QYbXmbCjQ2wz_s4cuLF1s3-o0s",
"plus_code": {
"compound_code": "CWF8+6H Mountain View, CA, United States",
"global_code": "849VCWF8+6H"
},
"types": ["street_address"]
}
],
"status": "OK"
}Details and differences
No key is needed for the first 2,500 requests a day. To use a My Geocode key, put it where your Google key went: the key query parameter, or the X-Goog-Api-Key header. The X-API-Key header, Authorization: Bearer and HTTP Basic authentication (the key as the user name) work on every host too, so client libraries that authenticate their own way keep working unchanged.
- Error bodies match the API you called: the Time Zone API answers
errorMessagewithstatus, the otherserror_message, the empty result list, thenstatus. - Time zone answers use
ZERO_RESULTSover open water, as Google does, and honourlanguage. - Elevation accepts
locations, anenc:encoded polyline, andpathwithsamples, up to 512 points as Google allows; each point counts as one request here. - Every endpoint also answers in XML: put
xmlwhere the path saysjson(/maps/api/geocode/xml,/maps/api/place/autocomplete/xml,/maps/api/timezone/xml,/maps/api/elevation/xml). - Geocoding results carry
plus_code(global_codeandcompound_code), as Google’s do.
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.