OpenCage drop-in replacement

OpenCage uses one endpoint for forward and reverse geocoding and returns a rich annotations block. opencage.mygeocode.com does the same, including the timezone, currency, calling code, sun and location code annotations that OpenCage users read.

Change one hostname

Original host
  • api.opencagedata.com
Use insteadopencage.mygeocode.com
Key parameterkey (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)
Before
curl "https://api.opencagedata.com/geocode/v1/json?q=Colosseum+Rome&key=YOUR_OPENCAGE_KEY"
After
curl "https://opencage.mygeocode.com/geocode/v1/json?q=Colosseum+Rome&key=YOUR_MYGEOCODE_KEY"

Why people move

Same request, same response shape, 2,500 free requests a day per account with no attribution requirement or non-commercial clause.

Same free allowance, key or not. Requests to opencage.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.

See pricing Get a free key

Endpoints

Path on opencage.mygeocode.comWhat it doesBacked by
/geocode/v1/json?q=...Forward geocodingForward geocoding
/geocode/v1/json?q=lat,lngReverse geocodingReverse geocoding
/geocode/v1/geojson?q=...GeoJSON outputForward geocoding
/geocode/v1/xml?q=...XML outputForward geocoding

Example response

This is what the request above returns. Field names, nesting and types follow OpenCage. Only the data behind them is ours.

Response from opencage.mygeocode.com
{
  "documentation": "https://www.mygeocode.com/compatibility/opencage/",
  "licenses": [
    {
      "name": "My Geocode Terms",
      "url": "https://www.mygeocode.com/terms/"
    }
  ],
  "rate": {
    "limit": 2500,
    "remaining": 2479,
    "reset": 1791158400
  },
  "results": [
    {
      "annotations": {
        "DMS": {
          "lat": "41° 53' 24.64656'' N",
          "lng": "12° 29' 32.31204'' E"
        },
        "H3": null,
        "MGRS": "33TTG9195440624",
        "Maidenhead": "JN61fv93bp",
        "Mercator": {
          "x": 1390637.466,
          "y": 5116005.188
        },
        "NUTS": {
          "NUTS0": {
            "code": "IT"
          },
          "NUTS1": {
            "code": "ITI"
          },
          "NUTS2": {
            "code": "ITI4"
          },
          "NUTS3": {
            "code": "ITI43"
          }
        },
        "OSM": {
          "note_url": "https://www.openstreetmap.org/note/new#map=16/41.89018/12.49231&layers=N",
          "url": "https://www.openstreetmap.org/?mlat=41.89018&mlon=12.49231#map=16/41.89018/12.49231"
        },
        "UN_M49": {
          "regions": {
            "EUROPE": "150",
            "IT": "380",
            "SOUTHERN_EUROPE": "039",
            "WORLD": "001"
          },
          "statistical_groupings": ["MEDC"]
        },
        "callingcode": 39,
        "currency": {
          "alternate_symbols": [],
          "decimal_mark": ",",
          "html_entity": "€",
          "iso_code": "EUR",
          "iso_numeric": "978",
          "name": "Euro",
          "smallest_denomination": 1,
          "subunit": "Cent",
          "subunit_to_unit": 100,
          "symbol": "€",
          "symbol_first": 1,
          "thousands_separator": "."
        },
        "flag": "🇮🇹",
        "geohash": "sr2yk3begzkwszr7rp57",
        "qibla": 123.25,
        "roadinfo": {
          "drive_on": "right",
          "speed_in": "km/h"
        },
        "sun": {
          "rise": {
            "apparent": 1791090610,
            "astronomical": 1791085058,
            "civil": 1791088947,
            "nautical": 1791087011
          },
          "set": {
            "apparent": 1791132439,
            "astronomical": 1791137991,
            "civil": 1791134102,
            "nautical": 1791136038
          }
        },
        "timezone": {
          "name": "Europe/Rome",
          "now_in_dst": 1,
          "offset_sec": 7200,
          "offset_string": "+0200",
          "short_name": "CEST"
        },
        "what3words": null
      },
      "bounds": { "northeast": { "lat": 41.8921795, "lng": 12.4943109 }, "southwest": { "lat": 41.8881809, "lng": 12.4903121 } },
      "components": {
        "ISO_3166-1_alpha-2": "IT",
        "ISO_3166-1_alpha-3": "ITA",
        "_category": "poi",
        "_normalized_city": "Rome",
        "_type": "attraction",
        "attraction": "Colosseum",
        "city": "Rome",
        "country": "Italy",
        "country_code": "it",
        "county": "Città metropolitana di Roma Capitale",
        "state": "Lazio"
      },
      "confidence": 10,
      "formatted": "Colosseum, Rome, Lazio, Italy",
      "geometry": {
        "lat": 41.8901796,
        "lng": 12.4923089
      }
    }
  ],
  "status": {
    "code": 200,
    "message": "OK"
  },
  "stay_informed": {
    "blog": "https://www.mygeocode.com/blog/"
  },
  "thanks": "For using My Geocode",
  "timestamp": {
    "created_http": "Sun, 04 Oct 2026 07:35:02 GMT",
    "created_unix": 1791099302
  },
  "total_results": 3
}

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 OpenCage key went: the key query parameter. 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.

Copyright lines, licence names, terms and privacy links in the response are ours rather than the original provider’s. Everything else keeps the original shape.

  • The rate block reports your real free allowance, what is left and when it resets.
  • Both the json and geojson endpoints are served.
  • No batch endpoint, because the original has none. For bulk work use POST /v1/forward or /v1/reverse on api.mygeocode.com (up to 100 per call, one request each).
  • Annotations are on unless you send no_annotations=1, as with OpenCage: DMS, MGRS, Maidenhead, Mercator, ITM (Ireland), FIPS (US states), callingcode, currency, flag, geohash, qibla, roadinfo (side of the road and speed unit), sun, timezone and wikidata where known. what3words and H3 are present but always null, because neither is available from an open source.
  • /geocode/v1/xml answers in OpenCage’s XML.
  • NUTS (EU regions), UN_M49, OSM links, FIPS with the county, UN/LOCODE for a LOCODE: query and DIGIPIN in India are filled in where we have the data. roadinfo=1 adds the road’s speed limit, one-way and tunnel flags from OpenStreetMap.

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

How the drop-ins work, the overview, and the JavaScript library drop-ins.