Drop-in compatibility
You do not have to learn this API to use it. For seventeen other geocoding and IP lookup APIs we run a host that accepts that provider's request format and answers in that provider's response format, with our data behind it. The same applies to the JavaScript map libraries those providers ship. Migration is a hostname change.
How it works
Each drop-in host is a full implementation of one provider's public HTTP interface: the same paths, the same query parameters, the same JSON field names, nesting and types, the same status vocabulary and the same error shapes. The values are ours. Your client code, your parsing code and your error handling do not change.
- Change the host.
maps.googleapis.combecomesgapi.mygeocode.com,dev.virtualearth.netbecomesbing.mygeocode.com, and so on. The table below has every pair. - Swap the key, or drop it. Put your My Geocode key in the parameter the old key used (
key,apiKey,access_token,token...). Any address gets 2,500 free requests a day with no key, and every key comes with 2,500 of its own, so migrating and testing costs nothing. - Compare. Run a sample of real requests against both hosts. Coordinates will differ slightly because the data is different; field names will not.
$ curl "https://maps.googleapis.com/maps/api/geocode/json?address=10+Downing+St+London&key=GOOGLE_KEY"$ curl "https://gapi.mygeocode.com/maps/api/geocode/json?address=10+Downing+St+London&key=MYGEOCODE_KEY"All drop-in hosts
Every host runs on the same infrastructure, the same data, the same free allowance and the same prices as api.mygeocode.com. Click a provider for its endpoint list, a sample response and the known differences.
| Provider and lookups | Original host | Drop-in host | Key parameter |
|---|---|---|---|
| Google Maps Platform Forward, Reverse, Autocomplete, Timezone, Elevation | maps.googleapis.com | gapi.mygeocode.com | key |
| Bing Maps REST Services Forward, Reverse, Autocomplete, Timezone, Elevation | dev.virtualearth.net | bing.mygeocode.com | key |
| HERE Geocoding and Search Forward, Reverse, Autocomplete | geocode.search.hereapi.comrevgeocode.search.hereapi.comautosuggest.search.hereapi.comautocomplete.search.hereapi.com | here.mygeocode.com | apiKey |
| Mapbox Geocoding Forward, Reverse, Autocomplete | api.mapbox.com | mapbox.mygeocode.com | access_token |
| Geocode.Farm Forward, Reverse | api.geocode.farmwww.geocode.farm | farm.mygeocode.com | key |
| OpenStreetMap Nominatim Forward, Reverse | nominatim.openstreetmap.org | osm.mygeocode.com | none; add key or the header |
| OpenCage Forward, Reverse | api.opencagedata.com | opencage.mygeocode.com | key |
| LocationIQ Forward, Reverse, Autocomplete, Timezone | us1.locationiq.comeu1.locationiq.com | locationiq.mygeocode.com | key |
| Geoapify Forward, Reverse, Autocomplete, IP lookup | api.geoapify.com | geoapify.mygeocode.com | apiKey |
| TomTom Search Forward, Reverse, Autocomplete | api.tomtom.com | tomtom.mygeocode.com | key |
| MapQuest Geocoding Forward, Reverse | www.mapquestapi.comopen.mapquestapi.com | mapquest.mygeocode.com | key |
| Geocodio Forward, Reverse | api.geocod.io | geocodio.mygeocode.com | api_key |
| PositionStack Forward, Reverse | api.positionstack.com | positionstack.mygeocode.com | access_key |
| ip-api.com IP lookup | ip-api.compro.ip-api.com | ipapi.mygeocode.com | key |
| ipinfo.io IP lookup | ipinfo.io | ipinfo.mygeocode.com | token |
| ipstack IP lookup | api.ipstack.com | ipstack.mygeocode.com | access_key |
| Open-Elevation Elevation | api.open-elevation.com | openelevation.mygeocode.com | none; add key or the header |
JavaScript map libraries
Provider changes hurt most in the browser, where the map, the geocoder widget and the billing are tangled together. For the libraries below, the library itself is loaded from our host (or, for MapLibre, Mapbox GL and Leaflet, pointed at our host by configuration) and keeps its public API: google.maps.Map, Microsoft.Maps.Map, H.Map and the rest. Tiles, geocoding, autocomplete and elevation come from us. Map loads and tiles are free; geocoding calls count as usual.
| Library | Loaded from | Load from instead | What keeps working |
|---|---|---|---|
| Google Maps JavaScript API | maps.googleapis.com | gapi.mygeocode.com | google.maps.Map with our tiles (roadmap, satellite and terrain map types) |
| Bing Maps V8 Web Control | www.bing.com | bing.mygeocode.com | Microsoft.Maps.Map, Location, LocationRect, Pushpin, Infobox, Polyline, Polygon, Layer |
| Mapbox GL JS and mapbox-gl-geocoder | | mapbox.mygeocode.com | Vector tile styles: streets, light, dark and outdoors, in the Mapbox style specification |
| Leaflet geocoder plugins | tile.openstreetmap.org | tiles.mygeocode.com | Leaflet Control Geocoder: nominatim, google, bing, mapbox, here, opencage, latLng and mapquest geocoders, each pointed at the matching www.mygeocode.com host |
| HERE Maps API for JavaScript | js.api.here.com | here.mygeocode.com | H.Map, H.map.Marker, H.map.Polyline, H.map.Polygon, H.map.Group |
| MapQuest.js | api.mqcdn.com | mapquest.mygeocode.com | L.mapquest.map, tileLayer (map, hybrid, satellite, light, dark) |
The JavaScript drop-ins page has the before-and-after snippets, the list of what is and is not included for each library, and the tile and style URLs.
Where the key goes
Each host accepts the key in the place the original provider expects it, and also in the X-API-Key header. A key is optional: 2,500 requests a day per address need none. A free one takes a minute to get and adds credit, packages and a usage history. A pay-as-you-go key may be used from two IP addresses per rolling 24 hours and an Unlimited key from three; use more keys or packages for more addresses (see authentication).
| Parameter | Used by |
|---|---|
key | Google Maps, Bing Maps, Geocode.Farm, OpenCage, LocationIQ, TomTom, MapQuest, ip-api (pro) |
apiKey | HERE, Geoapify |
access_token | Mapbox |
api_key | Geocodio |
access_key | PositionStack, ipstack |
token or Authorization: Bearer | ipinfo, HERE |
| none | Nominatim, Open-Elevation. Add key=... to the query or send the X-API-Key header. |
Quota and errors on the drop-in hosts
The daily allowance is the same as everywhere else and is counted per key, or per address when no key is sent, across api.mygeocode.com and every drop-in host: 2,500 free a day, then credit or an Unlimited key. The X-Quota-* and X-Key-IPs-* headers are sent on every host, so you can read the true state from the headers whatever the body format. In the body, limits are reported the way the provider reports them:
| Host | Out of credit (402) | Bad, missing or IP-limited key | Invalid request |
|---|---|---|---|
| gapi.mygeocode.com | HTTP 200, "status": "OVER_QUERY_LIMIT" | "status": "REQUEST_DENIED" | "status": "INVALID_REQUEST" |
| bing.mygeocode.com | "statusCode": 429 in the envelope | "statusCode": 401, authenticationResultCode: InvalidCredentials | "statusCode": 400 with errorDetails |
| here.mygeocode.com | HTTP 429, {"title": "Too Many Requests", "status": 429} | HTTP 401 with error_description | HTTP 400 with title and cause |
| mapbox.mygeocode.com | HTTP 429, {"message": "Rate limit exceeded"} | HTTP 401, {"message": "Not Authorized - Invalid Token"} | HTTP 422 with message |
| osm.mygeocode.com | HTTP 429, {"error": {"code": 429, "message": "..."}} | Not applicable | HTTP 400, {"error": {"code": 400, "message": "..."}} |
| ipapi.mygeocode.com | HTTP 200, {"status": "fail", "message": "quota"} | {"status": "fail", "message": "invalid key"} | {"status": "fail", "message": "invalid query"} |
| Others | As documented by the provider; see each host's page |
What matches and what does not
Identical
- Paths, methods and query parameters that the provider documents.
- Response structure: field names, nesting, arrays, types, coordinate order (including Mapbox's
[lon, lat]). - Status and confidence vocabularies (
ROOFTOP,High,houseNumber,EXACT_MATCH...), mapped from ourprecisionandconfidence. - Error shapes, so existing handling keeps working.
- Pricing and quota: nothing extra for using a drop-in host.
Different
- The data. Coordinates, formatted strings and confidence values are ours and will not match the original digit for digit. House-level coverage differs by country; see coverage.
- Identifiers. Place IDs are ours and are stable, but cannot be sent to the original provider.
- Anything outside geocoding, autocomplete, IP, timezone and elevation: routing, places details, photos, traffic, Street View. Each host's page lists what is missing.
- Keys: two IP addresses per rolling 24 hours on a pay-as-you-go key, three on an Unlimited key, as on our own endpoints.
Migration checklist
- Search your code and configuration for the provider's hostname. It is often in more than one place: server code, mobile apps, a CDN rule, a cached config.
- Change it to the drop-in host from the table above. Keep the path.
- Replace the key with a My Geocode key. Use one key per server or two at most; a pay-as-you-go key accepts two IP addresses per rolling 24 hours, an Unlimited key three.
- Run your existing test suite. It should pass unchanged. If a field you depend on is absent, check the host's page for known gaps and tell us.
- Replay a few hundred real requests against both hosts and compare coordinates and the fields you display. Look at
precisionwhere the drop-in exposes it (aslocation_type,accuracy,resultTypeand so on). - Watch
X-Quota-Usedfor a day to size your plan: credit below about 19,000 requests a day, an Unlimited key above. - Cancel the old billing.
Provider SDKs
Most official client libraries accept a custom base URL, so they work with the drop-in hosts too: the Google Maps Services clients (googlemaps for Python, @googlemaps/google-maps-services-js), the Mapbox SDKs (origin option), HERE's REST clients, ipinfo's libraries and Nominatim wrappers such as geopy (domain=). Point them at the host from the table and pass your My Geocode key where the provider key went.
A provider that is not listed
Adding a host is a few days of work when the provider's format is documented. If you are on a service that is not here, say which one and roughly how many requests a day you send. Recent additions were all requests from users.