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 and what3words style annotations that OpenCage users read.

Change one hostname

Original host
  • api.opencagedata.com
Use insteadopencage.mygeocode.com
Key parameterkey (put your My Geocode key here, or leave it out for the free 2,500 a day)
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 instead of 2,500 a day with attribution and non-commercial limits.

Try it before you sign up for anything. Requests to opencage.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.

See pricing Sign up with an email

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

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://mygeocode.com/compatibility/opencage/",
  "licenses": [ { "name": "My Geocode Terms", "url": "https://mygeocode.com/terms/" } ],
  "rate": { "limit": 2500, "remaining": 2483, "reset": 1756339200 },
  "results": [
    {
      "annotations": {
        "DMS": { "lat": "41° 53' 24.72'' N", "lng": "12° 29' 31.92'' E" },
        "callingcode": 39,
        "currency": { "iso_code": "EUR", "name": "Euro", "symbol": "€" },
        "flag": "🇮🇹",
        "timezone": { "name": "Europe/Rome", "now_in_dst": 1, "offset_sec": 7200, "offset_string": "+0200", "short_name": "CEST" }
      },
      "bounds": {
        "northeast": { "lat": 41.8905, "lng": 12.4932 },
        "southwest": { "lat": 41.8897, "lng": 12.4914 }
      },
      "components": {
        "ISO_3166-1_alpha-2": "IT",
        "ISO_3166-1_alpha-3": "ITA",
        "_category": "travel/tourism",
        "_type": "attraction",
        "attraction": "Colosseo",
        "city": "Roma",
        "continent": "Europe",
        "country": "Italia",
        "country_code": "it",
        "postcode": "00184",
        "road": "Piazza del Colosseo",
        "state": "Lazio"
      },
      "confidence": 9,
      "formatted": "Colosseo, Piazza del Colosseo, 00184 Roma RM, Italia",
      "geometry": { "lat": 41.8902, "lng": 12.4922 }
    }
  ],
  "status": { "code": 200, "message": "OK" },
  "total_results": 1
}

Details and differences

  • confidence is OpenCage's 1 to 10 scale, derived from the size of the bounding box as in their documentation.
  • The rate block reports our daily quota. On the Unlimited plan, limit and remaining are reported as -1.
  • countrycode, bounds, proximity, language, limit, no_annotations, roadinfo and abbrv are honoured.

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

All REST drop-ins and JavaScript library drop-ins.