oslew docs
Console
Menu

Migrating from another provider

Switching geocoder usually costs a week: every call site, every response parser, every test fixture. There are two ways to spend less than that here. /v1/migrate reads a request you already make and says what it becomes and what the month costs, with no key. The compatibility routes then answer Google, Mapbox, Nominatim and LocationIQ requests at their own paths and in their own shapes, so a client can switch by changing its host and its credential, and move to the native /v1 routes later, one call site at a time.

Read a request you already make: /v1/migrate

Free and unauthenticated, because somebody deciding whether to switch has no key yet. It takes no token from any bucket and sends no rate-limit headers.

ParameterDefaultIs
urlrequiredA request you make today, complete with its query string. Percent-encode it when you put it in a query string of its own.
volume100000Requests a month, for the price comparison.
basenoneA prefix for the URLs it writes back, such as https://api.oslew.com. Without it they are relative paths.

A Google request, credential and all:

curl
curl -G "https://api.oslew.com/v1/migrate" \
  --data-urlencode 'url=https://maps.googleapis.com/maps/api/geocode/json?address=Museo+Soumaya&language=es&key=AIzaDOCSEXAMPLE' \
  --data-urlencode 'volume=100000'
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.migrate(
    "https://maps.googleapis.com/maps/api/geocode/json?address=Museo+Soumaya&language=es&key=AIzaDOCSEXAMPLE",
    volume=100000,
)
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.migrate("https://maps.googleapis.com/maps/api/geocode/json?address=Museo+Soumaya&language=es&key=AIzaDOCSEXAMPLE", { volume: 100000 });
Response
HTTP/1.1 200 OK
content-type: application/json

{
  "vendor": "google",
  "recognised": true,
  "direction": "forward",
  "query": "Museo Soumaya",
  "ours": "/v1/geocode?q=Museo%20Soumaya&limit=5",
  "compat": "/compat/google/maps/api/geocode/json?address=Museo%20Soumaya",
  "parameters": [
    {
      "name": "address",
      "value": "Museo Soumaya",
      "carried": true,
      "becomes": "q"
    },
    {
      "name": "key",
      "value": "«redacted»",
      "carried": false,
      "why": "this service authenticates with `Authorization: Bearer sk_live_…`, not a query parameter — which is also why a key in a URL is a key in every log it passes through"
    },
    {
      "name": "language",
      "value": "es",
      "carried": false,
      "why": "answers are in the language their source recorded; no translation layer exists"
    }
  ],
  "pricing": {
    "volume": 100000,
    "their_list_usd_per_1k": 5,
    "their_free_monthly": 10000,
    "their_bands": [
      {
        "up_to": 10000,
        "usd_per_1k": 0
      },
      {
        "up_to": 100000,
        "usd_per_1k": 5
      },
      {
        "up_to": 500000,
        "usd_per_1k": 4
      },
      {
        "up_to": 1000000,
        "usd_per_1k": 3
      },
      {
        "up_to": 5000000,
        "usd_per_1k": 1.5
      },
      {
        "usd_per_1k": 0.38
      }
    ],
    "their_tariff": "geocoding (essentials)",
    "their_price_source": "https://developers.google.com/maps/billing-and-pricing/pricing",
    "their_monthly_usd": 450,
    "our_monthly_usd": 99,
    "compared_plan": "address",
    "saving_usd": 351,
    "required_rps": 0.038580246913580245,
    "planning_rps": 0.038580246913580245,
    "fits_address_plan": true,
    "caveat": "list prices as published in 2026-09, summed band by band; this service cannot verify a price, a free tier or a caching restriction"
  },
  "next": [
    "Point your existing client at the `compat` URL and change only the host and the key: your response parser keeps working.",
    "Or call `ours` and read the `normalized` block, which has the address in parts as well as formatted.",
    "Check the parameters marked `carried: false` above: each one is a real limitation here, not a rename.",
    "Pass `peak_rps` with the rate your busiest stretch holds — an import, a month-start backfill — and the plan is chosen on that rather than on the month's average.",
    "Run `compare` from `geo-bench` on your own addresses before you switch. Our held-out accuracy is published and it is not flattering."
  ]
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

What the answer says

FieldSays
vendor, recognisedWhose request this is: mapbox, google, locationiq, nominatim, geoapify or photon, or unknown with recognised: false.
directionforward (text to a place), reverse (a point to places), or unknown when the URL carries neither.
queryThe text or point it pulled out of the request.
oursThe same question on this service's own routes: /v1/geocode?q=… or /v1/reverse?at=…, with your limit carried over (clamped to 1–50; 5 when you sent none).
compatThe compatibility route that takes the request in the vendor's own shape. Absent for Geoapify and Photon, which have no compatibility route.
parametersEvery parameter you sent, each with carried, and either becomes (what it is called here) or why (why it has no equivalent). Nothing is left out.
pricingThe month both ways; see below.
nextWhat to do next, in sentences.

A vendor is recognised by its host — mapbox.com, googleapis.com,locationiq.com, geoapify.com, a host containing photon ornominatim — or, failing that, by the shape of the path, so a request sent through your own gateway still reads correctly: /maps/api/geocode is Google, mapbox.places is Mapbox,search.php is LocationIQ, and a path ending in /search or /reverse is Nominatim.

Credentials are redacted, never echoed

A key, access_token, apiKey, api_key or token in the URL comes back with the value «redacted», carried: false, and the reason: this service reads its key from the Authorization header only. A key in a URL is a key in every log the URL passes through, which is why it is not read here and not repeated back to you. Your key does still travel to this service inside the url parameter, though — so use a revoked or placeholder key when you paste one in.

What does not carry, and why

Each parameter marked carried: false is a real limitation of this service, not a rename, and thewhy says so in a sentence you can take to whoever owns the call site:

Their parameterHere
limitCarried, as limit.
addressdetails, formatCarried: the address parts are always in the answer, and the answer is always JSON.
languageNot carried. Answers are in the language their source recorded; there is no translation layer.
typesNot carried. One index answers every kind of place; there is no feature-type filter.
bboxNot carried. There is no bounding-box filter; near constrains results to roughly a city instead.
country, countrycodesNot carried. Filtering is by administrative name, not ISO code: put the country after the last comma of the query.
componentsNot carried. Put the locality or postcode after a comma in the query instead.
anything elseNot carried, as "not a parameter this service has an equivalent for" — Mapbox's proximity, for example.

Most of these have a native equivalent that is not a filter: the text after the last comma of ageocoding query is resolved as administrative context — a city, a region, an ISO code or a postcode — and a near point confines results to about a city around it. Seegetting better accuracy.

The price, and the rate that actually decides the plan

FieldIs
volumeThe requests a month the comparison assumes.
their_bands, their_tariff, their_price_sourceEvery published volume band the bill is summed across, which of the vendor's prices it is, and the page it was read from. Mapbox's temporary and permanent geocoding are different tariffs: a mapbox.places-permanent path or permanent=true selects the permanent one. Only for Mapbox and Google; absent for the others.
their_list_usd_per_1k, their_free_monthlyTheir first price past the free allowance, and the free allowance itself.
their_monthly_usdWhat the volume costs them, band by band: each band's requests at that band's price. A volume discount is counted where the vendor publishes it.
compared_planThe cheapest plan here whose sustained Address rate carries planning_rps: address, scale, or enterprise when no listed plan does.
our_monthly_usdThe price of compared_plan, whatever the volume — a plan is a rate, not an allowance, so the bill does not grow with the month. For enterprise it is the top listed price, as a floor.
saving_usdThe difference. Negative when their free tier covers your volume, and it says so rather than hiding it. Absent when the plan that fits is negotiated.
required_rpsThe volume spread evenly over 30 days: volume ÷ 2,592,000, in requests a second.
peak_rps, planning_rpsThe peak you passed as peak_rps, echoed, and the busier of it and required_rps — the rate the plan was chosen on.
fits_address_planWhether planning_rps is at most 20, the Address plan's sustained rate.
caveatWhen the price list was written, that this service cannot verify a vendor's price, free tier or caching restriction, and — for an unpriced vendor — why there is no price.

Only Mapbox and Google are priced. LocationIQ and Geoapify sell daily tiers rather than a per-thousand list price, Nominatim's public instance is not for this kind of load, and Photon is software you run: each is reported unpriced, with the reason in caveat, rather than guessed at. The same comparison for a larger Mapbox volume:

Five million Mapbox requests a month

Response
HTTP/1.1 200 OK
content-type: application/json

{
  "vendor": "mapbox",
  "recognised": true,
  "direction": "forward",
  "query": "Museo Soumaya",
  "ours": "/v1/geocode?q=Museo%20Soumaya&limit=1",
  "compat": "/compat/mapbox/geocoding/v5/mapbox.places/Museo%20Soumaya.json",
  "parameters": [
    {
      "name": "access_token",
      "value": "«redacted»",
      "carried": false,
      "why": "this service authenticates with `Authorization: Bearer sk_live_…`, not a query parameter — which is also why a key in a URL is a key in every log it passes through"
    },
    {
      "name": "limit",
      "value": "1",
      "carried": true,
      "becomes": "limit"
    },
    {
      "name": "proximity",
      "value": "-99.2,19.4",
      "carried": false,
      "why": "not a parameter this service has an equivalent for"
    }
  ],
  "pricing": {
    "volume": 5000000,
    "their_list_usd_per_1k": 0.75,
    "their_free_monthly": 100000,
    "their_bands": [
      {
        "up_to": 100000,
        "usd_per_1k": 0
      },
      {
        "up_to": 500000,
        "usd_per_1k": 0.75
      },
      {
        "up_to": 1000000,
        "usd_per_1k": 0.6
      },
      {
        "usd_per_1k": 0.45
      }
    ],
    "their_tariff": "temporary geocoding",
    "their_price_source": "https://www.mapbox.com/pricing",
    "their_monthly_usd": 2400,
    "our_monthly_usd": 99,
    "compared_plan": "address",
    "saving_usd": 2301,
    "required_rps": 1.9290123456790123,
    "planning_rps": 1.9290123456790123,
    "fits_address_plan": true,
    "caveat": "list prices as published in 2026-09, summed band by band; this service cannot verify a price, a free tier or a caching restriction"
  },
  "next": [
    "Point your existing client at the `compat` URL and change only the host and the key: your response parser keeps working.",
    "Or call `ours` and read the `normalized` block, which has the address in parts as well as formatted.",
    "Check the parameters marked `carried: false` above: each one is a real limitation here, not a rename.",
    "Pass `peak_rps` with the rate your busiest stretch holds — an import, a month-start backfill — and the plan is chosen on that rather than on the month's average.",
    "Run `compare` from `geo-bench` on your own addresses before you switch. Our held-out accuracy is published and it is not flattering."
  ]
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

required_rps is an average. Traffic arrives in peaks — an import, a month-start backfill — and a plan's rate is a sustained rate with a burst on top, so pass peak_rps with the rate your busiest stretch holds and the comparison is made against the plan that carries it rather than the one the average fits. Seerate limits and products and plans for what each plan sustains.

Or change almost nothing: the compatibility routes

Four vendors' request and response shapes, at their own paths under /compat/, with this service's data inside. They are not proxies: nothing is sent to the vendor, and every answer says whose data it is.

VendorForwardReverse
Google/compat/google/maps/api/geocode/json?address=…the same path, ?latlng=lat,lng
Mapbox/compat/mapbox/geocoding/v5/mapbox.places/{search_text}the same path, with lon,lat as the search text
Nominatim/compat/nominatim/search?q=…/compat/nominatim/reverse?lat=…&lon=…
LocationIQ/compat/locationiq/v1/search.php?q=…/compat/locationiq/v1/reverse.php?lat=…&lon=…

What every compatibility route has in common

  • The key goes in the Authorization header. Their credential parameters — Google's key, Mapbox's access_token, LocationIQ's key — are accepted so that an existing request does not break, and ignored. A vendor SDK that cannot send a custom header cannot authenticate here; call the path from your own HTTP client. See authentication.
  • They are the Address product. Each request takes one token from the key's address bucket — the same bucket /v1/geocode draws on — so they are available on every self-serve plan, free included.
  • Forward is /v1/geocode, reverse is /v1/reverse. Forward runs with no near and with house-number interpolation on; the text after the last comma is still resolved as administrative context. At most 10 results, whatever the vendor's own ceiling.
  • Every result gains a provenance object the vendor's shape does not have:{name, release, licence, served_by}. It is spelled licence here, notlicense as on /v1. A parser ignores a field it does not know; a person who looks can see whose data this is and on what terms. See data and licensing.
  • Errors are this service's. A refusal is {"error": "…"} with a400, and 401, 403 and 429 are the same as everywhere else — except where the vendor's contract puts an error inside a 200, noted below. A vendor's error shape is not imitated: once you have switched, you should be debugging against this documentation, not theirs.
  • Identifiers are not theirs, and not durable. Google's place_id, Mapbox'sid and Nominatim's place_id carry the result's ordinal within the data segment that answered. Do not store one as a lasting key for a place, and never send one back to the vendor.
  • Boxes are the error bar, not the feature. Google's viewport, Mapbox'sbbox and Nominatim's boundingbox are a square reaching precision_m (at least 1 m) either side of the point — how far the position can be wrong — not the extent of a building or a city.
  • Coverage is this service's data, not the vendor's. What a query finds depends on what is loaded for that area. A field there is no data for is null or absent, never invented.

Google

ParameterHere
addressHonoured: free text, forward.
latlngHonoured: lat,lng, reverse. When both are sent, latlng wins.
limitNot Google's: results to return, default 5, at most 10.
key, language, componentsAccepted and ignored.
curl
curl -G "https://api.oslew.com/compat/google/maps/api/geocode/json" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'address=Museo Soumaya' \
  --data-urlencode 'limit=1'
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.compat_google_maps_api_geocode_json(address="Museo Soumaya", limit=1)
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.compat_google_maps_api_geocode_json({ address: "Museo Soumaya", limit: 1 });
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 299
ratelimit-reset: 1

{
  "results": [
    {
      "address_components": [
        {
          "long_name": "Miguel Hidalgo",
          "short_name": "Miguel Hidalgo",
          "types": [
            "locality",
            "political"
          ]
        },
        {
          "long_name": "CMX",
          "short_name": "CMX",
          "types": [
            "administrative_area_level_1",
            "political"
          ]
        },
        {
          "long_name": "MX",
          "short_name": "MX",
          "types": [
            "country",
            "political"
          ]
        }
      ],
      "confidence": 0.5,
      "formatted_address": "Museo Soumaya, Miguel Hidalgo, CMX, MX",
      "geometry": {
        "location": {
          "lat": 19.44062110346353,
          "lng": -99.20465953606559
        },
        "location_type": "GEOMETRIC_CENTER",
        "viewport": {
          "northeast": {
            "lat": 19.440681794925386,
            "lng": -99.20459517519265
          },
          "southwest": {
            "lat": 19.440560412001677,
            "lng": -99.20472389693853
          }
        }
      },
      "place_id": "geoalt:348329",
      "precision_m": 6.756173533775122,
      "provenance": {
        "licence": "CDLA-Permissive-2.0",
        "name": "overture-places",
        "release": "2026-08-19.0",
        "served_by": "geospatial-alt"
      },
      "types": [
        "point_of_interest",
        "establishment"
      ]
    }
  ],
  "status": "OK"
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

  • status is real and means what Google's does: OK,ZERO_RESULTS, or INVALID_REQUEST with an error_message — for neitheraddress nor latlng, or a latlng that does not parse — inside a200, as Google does it. It is never OVER_QUERY_LIMIT: going faster than your plan is a real 429 with Retry-After, before the route runs. A client that only ever looks at status needs to handle the HTTP status too.
  • place_id is prefixed geoalt:, on purpose not shaped like a Google place id, so that one stored and later sent to Google fails loudly instead of naming a different place.
  • address_components uses the types street_number, route,locality, administrative_area_level_1, postal_code andcountry. long_name and short_name are always the same value — the one the source recorded, which for a region or country is often a code, like CMX and MXabove.
  • types follows what matched: street_address for an address, route for a street, point_of_interest and establishment for a place, postal_code and the political types for areas.
  • Three fields are added: precision_m, confidence (null on a reverse lookup) and provenance.

location_type is mapped from this service's precision, never claiming more than matched:

precisionlocation_type
rooftopROOFTOP
interpolatedRANGE_INTERPOLATED
address, street, poiGEOMETRIC_CENTER
postcode, locality, region, countryAPPROXIMATE

Mapbox

Geocoding v5, at /compat/mapbox/geocoding/v5/mapbox.places/{search_text}. search_text may end in .json, as theirs does. Mapbox uses one path for both directions and so does this: search text that is two numbers, a valid longitude then a valid latitude, is a reverse lookup — lon,lat, Mapbox's order, the opposite of every /v1 route. Anything else is forward text.

ParameterHere
limitHonoured: default 5, at most 10.
proximityAccepted and ignored. It is not a bias here, and forward lookups run with no near.
countryAccepted and ignored; not a filter.
autocompleteAccepted and ignored: there is no autocomplete mode on this path. /v1/autocomplete is the route for that.
access_tokenAccepted and ignored.
curl
curl -G "https://api.oslew.com/compat/mapbox/geocoding/v5/mapbox.places/Museo%20Soumaya.json" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'limit=1'
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.compat_mapbox_geocoding_v5_mapbox_places(
    "Museo Soumaya.json",
    limit=1,
)
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.compat_mapbox_geocoding_v5_mapbox_places("Museo Soumaya.json", { limit: 1 });
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 298
ratelimit-reset: 1

{
  "attribution": "geospatial-alt; data: CDLA-Permissive-2.0",
  "features": [
    {
      "bbox": [
        -99.20472389693853,
        19.440560412001677,
        -99.20459517519265,
        19.440681794925386
      ],
      "center": [
        -99.20465953606559,
        19.44062110346353
      ],
      "context": [
        {
          "id": "place.0",
          "text": "Miguel Hidalgo"
        },
        {
          "id": "region.0",
          "text": "CMX"
        },
        {
          "id": "country.0",
          "short_code": "mx",
          "text": "MX"
        }
      ],
      "geometry": {
        "coordinates": [
          -99.20465953606559,
          19.44062110346353
        ],
        "type": "Point"
      },
      "id": "poi.348329",
      "place_name": "Museo Soumaya, Miguel Hidalgo, CMX, MX",
      "place_type": [
        "poi"
      ],
      "properties": {
        "accuracy": "poi",
        "accuracy_m": 6.756173533775122,
        "provenance": {
          "licence": "CDLA-Permissive-2.0",
          "name": "overture-places",
          "release": "2026-08-19.0",
          "served_by": "geospatial-alt"
        }
      },
      "relevance": 0.5,
      "text": "Museo Soumaya",
      "type": "Feature"
    }
  ],
  "query": [
    "museo",
    "soumaya"
  ],
  "type": "FeatureCollection"
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

  • center and geometry.coordinates are [lon, lat]; bbox is west, south, east, north.
  • place_type has one entry — address, street, postcode, place, region, country or poi — and id is that type, a dot and the result's ordinal.
  • relevance is the calibrated confidence, not a text-similarity score; on a reverse lookup it is 1.
  • properties carries accuracy (this service's precision value), accuracy_m and provenance.
  • context entries are postcode.0, place.0, region.0 and country.0; the country entry has a lower-case short_code. address is the house number, when there is one.
  • query is the search text as this index tokenised it, and attribution names this service and the licence codes of the data in the answer.

Nominatim

ParameterHere
qHonoured on /search; required.
lat, lonHonoured on /reverse; both required, as numbers.
formatjsonv2 (the default) or json. geojson and xml are refused with a 400 rather than answered in a shape you did not ask for.
limitHonoured on /search: default 10, at most 10. /reverse answers one place.
addressdetailsAccepted and ignored: the address object is always included.
countrycodesAccepted and ignored; not a filter.
curl
curl -G "https://api.oslew.com/compat/nominatim/search" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'q=Museo Soumaya' \
  --data-urlencode 'limit=1'
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.compat_nominatim_search("Museo Soumaya", limit=1)
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.compat_nominatim_search("Museo Soumaya", { limit: 1 });
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 297
ratelimit-reset: 1

[
  {
    "address": {
      "city": "Miguel Hidalgo",
      "country_code": "mx",
      "state": "CMX"
    },
    "addresstype": "yes",
    "boundingbox": [
      "19.440560412001677",
      "19.440681794925386",
      "-99.20472389693853",
      "-99.20459517519265"
    ],
    "category": "place",
    "display_name": "Museo Soumaya, Miguel Hidalgo, CMX, MX",
    "importance": 0.5,
    "lat": "19.44062110346353",
    "licence": "CDLA-Permissive-2.0 (overture-places)",
    "lon": "-99.20465953606559",
    "name": "Museo Soumaya",
    "osm_id": null,
    "osm_type": null,
    "place_id": 348329,
    "place_rank": 30,
    "precision_m": 6.756173533775122,
    "provenance": {
      "licence": "CDLA-Permissive-2.0",
      "name": "overture-places",
      "release": "2026-08-19.0",
      "served_by": "geospatial-alt"
    },
    "type": "yes"
  }
]

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

Two fields are deliberately not copied, and the rest are real:

  • licence is ours, as "<licence code> (<dataset>)" — the data is not OpenStreetMap's, and a field whose purpose is attribution is the last place to be careless.
  • osm_type and osm_id are null. There is no honest OSM object to name, and an invented one would make your data unreconcilable with the real thing.
  • lat and lon are strings, as this family has always written them, and boundingbox is four strings: south, north, west, east.
  • type describes the thing: house, road, postcode, city, state, country, or yes for a place.
  • importance is the calibrated confidence; 0 on a reverse lookup.
  • address has house_number, road, city, state, postcode and country_code (lower case), each only when known.
  • jsonv2 adds category (always place), addresstype, name and place_rank (30 for an address or a place, 26 a street, 21 a postcode, 16 a city, 8 a region, 4 a country).
  • precision_m and provenance are added; a reverse answer adds distance_m from the point asked about.

/reverse answers one object, not an array, as Nominatim does, and when nothing is near it answers200 with {"error": "Unable to geocode"} — Nominatim's own convention. Nominatim'szoom and other parameters are not read: the answer is the nearest address or place.

curl
curl -G "https://api.oslew.com/compat/nominatim/reverse" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'lat=19.4406' \
  --data-urlencode 'lon=-99.2047'
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.compat_nominatim_reverse(19.4406, -99.2047)
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.compat_nominatim_reverse(19.4406, -99.2047);
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 296
ratelimit-reset: 1

{
  "address": {
    "city": "Miguel Hidalgo",
    "country_code": "mx",
    "state": "CMX"
  },
  "addresstype": "yes",
  "boundingbox": [
    "19.440560412001677",
    "19.440681794925386",
    "-99.20472389693853",
    "-99.20459517519265"
  ],
  "category": "place",
  "display_name": "Museo Soumaya, Miguel Hidalgo, CMX, MX",
  "distance_m": 4.848551852818172,
  "importance": 0,
  "lat": "19.44062110346353",
  "licence": "CDLA-Permissive-2.0 (overture-places)",
  "lon": "-99.20465953606559",
  "name": "Museo Soumaya",
  "osm_id": null,
  "osm_type": null,
  "place_id": 348329,
  "place_rank": 30,
  "precision_m": 6.756173533775122,
  "provenance": {
    "licence": "CDLA-Permissive-2.0",
    "name": "overture-places",
    "release": "2026-08-19.0",
    "served_by": "geospatial-alt"
  },
  "type": "yes"
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

LocationIQ

LocationIQ serves the Nominatim shape, so this is the Nominatim rendering above at LocationIQ's paths, with LocationIQ's key accepted and ignored. /v1/search.php takes q,format, limit (default 10, at most 10) and addressdetails;/v1/reverse.php takes lat, lon and format. The same caveats hold: licence is ours, and osm_type and osm_id are null.

curl
curl -G "https://api.oslew.com/compat/locationiq/v1/search.php" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'q=Museo Soumaya' \
  --data-urlencode 'format=json' \
  --data-urlencode 'limit=1'
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.compat_locationiq_v1_search_php(
    "Museo Soumaya",
    format="json",
    limit=1,
)
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.compat_locationiq_v1_search_php("Museo Soumaya", { format: "json", limit: 1 });
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 295
ratelimit-reset: 1

[
  {
    "address": {
      "city": "Miguel Hidalgo",
      "country_code": "mx",
      "state": "CMX"
    },
    "boundingbox": [
      "19.440560412001677",
      "19.440681794925386",
      "-99.20472389693853",
      "-99.20459517519265"
    ],
    "display_name": "Museo Soumaya, Miguel Hidalgo, CMX, MX",
    "importance": 0.5,
    "lat": "19.44062110346353",
    "licence": "CDLA-Permissive-2.0 (overture-places)",
    "lon": "-99.20465953606559",
    "osm_id": null,
    "osm_type": null,
    "place_id": 348329,
    "precision_m": 6.756173533775122,
    "provenance": {
      "licence": "CDLA-Permissive-2.0",
      "name": "overture-places",
      "release": "2026-08-19.0",
      "served_by": "geospatial-alt"
    },
    "type": "yes"
  }
]

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

curl
curl -G "https://api.oslew.com/compat/locationiq/v1/reverse.php" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'lat=19.4406' \
  --data-urlencode 'lon=-99.2047' \
  --data-urlencode 'format=json'
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.compat_locationiq_v1_reverse_php(19.4406, -99.2047, format="json")
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.compat_locationiq_v1_reverse_php(19.4406, -99.2047, { format: "json" });
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 294
ratelimit-reset: 1

{
  "address": {
    "city": "Miguel Hidalgo",
    "country_code": "mx",
    "state": "CMX"
  },
  "boundingbox": [
    "19.440560412001677",
    "19.440681794925386",
    "-99.20472389693853",
    "-99.20459517519265"
  ],
  "display_name": "Museo Soumaya, Miguel Hidalgo, CMX, MX",
  "distance_m": 4.848551852818172,
  "importance": 0,
  "lat": "19.44062110346353",
  "licence": "CDLA-Permissive-2.0 (overture-places)",
  "lon": "-99.20465953606559",
  "osm_id": null,
  "osm_type": null,
  "place_id": 348329,
  "precision_m": 6.756173533775122,
  "provenance": {
    "licence": "CDLA-Permissive-2.0",
    "name": "overture-places",
    "release": "2026-08-19.0",
    "served_by": "geospatial-alt"
  },
  "type": "yes"
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

A migration plan

  1. Run /v1/migrate on one real request from each call site. Read everycarried: false: each is a behaviour your code may depend on.
  2. Point the base URL at the compatibility path and move the key into a header. Remove the vendor's credential from the URL while you are there: it is ignored, and it is still a secret in your logs.
  3. Compare answers on your own addresses before switching traffic. Coverage and accuracy depend on the data loaded for your area; getting better accuracy publishes how this service measures on held-out addresses.
  4. Move call sites to /v1 when you want what the vendor shapes cannot carry — not as a precondition of switching.
Before
curl "https://maps.googleapis.com/maps/api/geocode/json?address=Museo+Soumaya&key=$GOOGLE_KEY"
Compatibility
# The same path and parameters under /compat/google; the key in a header.
curl -H "Authorization: Bearer $GEO_API_KEY" \
  "https://api.oslew.com/compat/google/maps/api/geocode/json?address=Museo+Soumaya"
Native
curl -H "Authorization: Bearer $GEO_API_KEY" \
  "https://api.oslew.com/v1/geocode?q=Museo+Soumaya&limit=5"

What moving to /v1 buys

The vendor shapes have nowhere to put the fields that say whether an answer can be trusted. On/v1/geocode every answer carries them — see reading a result:

  • tied_at_top: how many candidates share the best score. More than 1 means the query does not name one place — the case a vendor shape silently answers with the first of many.
  • confidence, calibrated: how often answers like this one were right. The compatibility shapes carry it as relevance, importance or an extra field, but not the tie it depends on.
  • precision and precision_m: nine values from rooftop to country, and an honest radius, where location_type has four.
  • context_resolution: how the text after the last comma was matched, and fallback: true when nothing matched it and the answer ignores it.
  • normalized, the address in parts and formatted; near; limit up to 50; and interpolate=false when you want only recorded house numbers.

Where the fields you read today live on /v1/geocode:

GoogleMapboxNominatim/v1/geocode result
geometry.location.lat, .lngcenter[1], center[0]lat, lon (strings)lat, lon (numbers)
formatted_addressplace_namedisplay_namenormalized.formatted
geometry.location_typeproperties.accuracytypeprecision, precision_m
address_componentscontext, addressaddressnormalized, hierarchy
—relevanceimportanceconfidence, and tied_at_top on the answer
status——the HTTP status; an empty results is 200
Python
from oslew import Client

client = Client(base_url="https://api.oslew.com")
answer = client.geocode("Museo Soumaya, Miguel Hidalgo", limit=5)

if not answer["results"]:
    ...                                       # was status == "ZERO_RESULTS"
elif answer["tied_at_top"] > 1:
    ...                                       # several places fit: ask, or add context
else:
    top = answer["results"][0]
    lat, lon = top["lat"], top["lon"]         # was geometry.location.lat / .lng
    shown = top["normalized"]["formatted"]    # was formatted_address
    how_close = top["precision_m"]            # metres, where location_type was a word
TypeScript
import { Client } from "@oslew/client";

const client = new Client({ baseUrl: "https://api.oslew.com" });
const answer = await client.geocode("Museo Soumaya, Miguel Hidalgo", { limit: 5 });

if (answer.results.length === 0) {
  // was status === "ZERO_RESULTS"
} else if (answer.tied_at_top > 1) {
  // several places fit: ask, or add context
} else {
  const top = answer.results[0];
  const { lat, lon } = top;                   // was geometry.location.lat / .lng
  const shown = top.normalized.formatted;     // was formatted_address
  const howClose = top.precision_m;           // metres, where location_type was a word
}

Endpoints

GET/v1/migrateno key

Paste a request you already make to another provider; get this service's equivalent, every parameter that does not carry over and why, and what the month costs either way.

GET/compat/google/maps/api/geocode/jsonaddress

The Google Geocoding API's shape over this service's data: results and a status, at their path.

GET/compat/mapbox/geocoding/v5/mapbox.places/{search_text}address

Mapbox Geocoding v5's shape over this service's data: a FeatureCollection, at their path. Free text forward, lon,lat reverse, as they do it.

GET/compat/nominatim/searchaddress

Nominatim's search shape over this service's data: an array of objects with string coordinates and a boundingbox.

GET/compat/nominatim/reverseaddress

Nominatim's reverse shape: one object, not an array, as theirs is.

GET/compat/locationiq/v1/search.phpaddress

LocationIQ's search.php: the Nominatim shape at their path, with key accepted and ignored.

GET/compat/locationiq/v1/reverse.phpaddress

LocationIQ's reverse.php: one object, as theirs is.