Switching guide
How to migrate from LocationIQ
oslew serves LocationIQ’s search.php and reverse.php at a compatibility path, in the same Nominatim-style JSON LocationIQ returns, so a client moves by changing its base URL and sending its key in an Authorization header; the key query parameter is ignored. Results carry oslew’s licence and no OpenStreetMap identifiers, and any parameter beyond q, lat, lon, format and limit is not read. Replay your logged queries against both, shift traffic in stages, and move to the native geocoder when you want its precision and confidence fields.
Last reviewed
LocationIQ answers geocoding requests in the response shape Nominatim made familiar, and oslew serves that same rendering at LocationIQ’s own paths. For most clients that makes the move a configuration change followed by a careful test. This guide covers the parts that are specific to LocationIQ: the key, the daily-allowance habits in client code, the endpoints the compatibility path does not cover, and a cutover plan with a way back.
The same shape at LocationIQ’s paths
GET /compat/locationiq/v1/search.php and GET /compat/locationiq/v1/reverse.php keep the path suffixes LocationIQ uses, so a URL builder that appends /v1/search.php to a configurable base keeps working when only the base changes. The answers are built from oslew’s own index; nothing is forwarded to LocationIQ. Both routes belong to the Address product, available on every plan, and draw on the same rate as the native geocoder.
Field by field, the rendering is the one oslew uses for Nominatim, so the details — the licence field naming oslew’s source, null OpenStreetMap identifiers, coordinates as strings, a bounding box that is an error bar — are set out once, in the Nominatim migration guide, rather than repeated here.
Credentials, including the one in your test URL
Your LocationIQ key travels in the URL; an oslew key never does. oslew reads keys only from the Authorization header, and sends no CORS headers, so the call has to come from your server. While you evaluate, you will paste LocationIQ request URLs into the migration checker. /v1/migrate never echoes a credential from a pasted URL: key, access_token, apiKey, api_key and token come back as «redacted». The key still travels to oslew inside the pasted URL, though, so replace it with a placeholder or a revoked key before you paste.
Daily-allowance habits to remove
Client code written against a daily allowance tends to grow habits: a counter of requests made today, a guard that stops non-urgent work near the limit, a job that splits a large file across several days, alerting on usage as a share of the day’s total. None of it has anything to measure on oslew.
What replaces it is shorter. Each key has a token bucket per product that refills continuously; the plan sets its sustained rate and its burst. A request that finds the bucket empty gets HTTP 429 with a Retry-After header, and every admitted response carries RateLimit headers, so a client can read RateLimit-Remaining and slow down before it is refused. A large job simply runs at the plan’s rate until it is done, and batch geocoding will take the whole file in one upload. The right plan is the one whose rate covers your busiest second, not your busiest day. Rate limits against quotas explains the model.
Endpoints the compatibility path does not cover
Only forward and reverse geocoding have LocationIQ-shaped paths. Everything else moves to a native route with its own request and response:
- Autocomplete moves to
GET /v1/autocomplete, which is the Search product, so the key’s plan must include Search. Suggestions carry no confidence; geocode the one the person picks. - Map tiles and static maps move to oslew’s vector tiles, MapLibre style and static images, which are the Platform product. Static images are drawn without labels, and the attribution for the basemap has to be shown beside them.
- Routing and matrices move to the Routing product, where a whole matrix is one request and times are free-flow unless an Enterprise operator applies a traffic feed.
A key whose plan lacks the product a route belongs to is refused with 403, and the refusal names the plan that would answer.
Testing, then cutting over in stages
Start with replay rather than real users’ requests. Take a day of logged queries, strip the keys, and send each to LocationIQ and to oslew’s compatibility path. Compare three things: queries where one answered and the other came back empty, the distance between the two answers where both did, and — for the subset whose true positions you know — each answer’s distance from the truth. Sort the disagreements by address format and district; they usually point at a handful of input patterns, such as a second address line left in the query text, that are worth fixing whichever provider you use.
Then move production requests over gradually. Put the base URL behind a flag, send a small share of requests to oslew, and watch the empty-answer rate, HTTP 429 refusals and any user corrections your product records. Raise the share in steps, and keep the LocationIQ path and key until oslew has carried the whole load for long enough to trust it. Because both paths return the same shape, rolling back is a flag change.
From search.php to the native geocoder
The compatibility shape has no room for the fields that say how far to trust an answer. GET /v1/geocode returns lat and lon as numbers, normalized.formatted where display_name was, a precision level with an error radius in metres where type was, and a calibrated confidence beside tied_at_top, the count of candidates that scored equal first. The geocoding API page covers each field.
curl -H "Authorization: Bearer $OSLEW_KEY" \
"https://api.oslew.com/compat/locationiq/v1/search.php?q=Museo+Soumaya,+Miguel+Hidalgo&format=json"Bottom line
Change the base URL, move the key into a header, delete the daily-allowance bookkeeping, route non-geocoding calls to their native products, and cut over behind a flag after a replay test. Whether the move pays for itself is a separate question, answered on the LocationIQ comparison.
Moving from LocationIQ, step by step
1. List the LocationIQ endpoints you call
Only search.php and reverse.php have compatible paths. Search your code and gateway logs for every LocationIQ path in use; anything else, such as autocomplete or map tiles, moves to its own native oslew route rather than to the compatibility path.
2. Read one request through /v1/migrate
Paste a real search.php or reverse.php URL into /v1/migrate. It needs no key, recognises the request as LocationIQ’s, reports each parameter as carried or not, and writes the compatibility and native requests. It does not price the switch, because daily plans have no per-thousand list price.
3. Move the key from the URL to a header
The key parameter is accepted and ignored. Send Authorization: Bearer with an oslew key from your server instead, and strip the LocationIQ key out of the URL so it stops appearing in your logs.
4. Change the base URL
Replace the LocationIQ host and path prefix with https://api.oslew.com/compat/locationiq/v1/, keeping search.php or reverse.php and the q, lat, lon, format and limit parameters as they are. Only json and jsonv2 are answered, jsonv2 when no format is sent; a request for geojson or xml is refused with a 400.
5. Account for everything else your client sends
Any other filter is silently ignored rather than refused. Find requests that depended on one and move its meaning into the query text after the last comma, or into a check in your own code on the answer.
6. Replace daily-usage logic with rate handling
There is no daily count to track or run out of. Remove usage counters and midnight resets, handle HTTP 429 by waiting the Retry-After seconds, and let large jobs run at the plan’s rate.
7. Replay logged queries, then shift traffic in stages
Replay a day of logged queries against both services and compare the answers. Then route a small share of live requests to oslew behind a flag, raise it in steps while watching empty answers and HTTP 429 refusals, and keep the old path until the numbers hold.
8. Move call sites to /v1/geocode when you want more
When a call site needs precision in metres, a calibrated confidence and the count of tied candidates, move it to the native geocoder. The compatibility path can keep serving the rest.
What the LocationIQ search.php and reverse.php endpoint accepts
Served at GET /compat/locationiq/v1/search.php, GET /compat/locationiq/v1/reverse.php, returning at most 10 results. Parameters that carry over: q, lat, lon, format, limit.
| Parameter | What happens to it |
|---|---|
| key | Ignored: accepted and ignored: this service authenticates with Authorization: Bearer …, never a query parameter. |
| addressdetails | Ignored: accepted and ignored: the address object is always included. |
- The Nominatim rendering at LocationIQ’s paths, with the same caveats:
licenceis oslew’s,osm_typeandosm_idare null. limiton search.php defaults to 10, at most 10; reverse.php answers one object.
Should you switch at all?
This page is about how. Whether the move is worth making — price, data, licence, and where LocationIQ is the better choice — is on the oslew vs LocationIQ page.
Questions
Does oslew accept my LocationIQ API key?
No. The key parameter on search.php and reverse.php is accepted so an existing URL does not fail, and then ignored. You need an oslew key, created in the console, sent in the Authorization header from your server.
What happens to my daily request limit logic?
It can go. oslew plans are a sustained rate with a burst per product, so there is nothing to count through the day and nothing resets at midnight. A request over the rate gets HTTP 429 with a Retry-After header in whole seconds; waiting that long is the whole remedy.
Which LocationIQ endpoints can point at oslew unchanged?
Forward geocoding through search.php and reverse geocoding through reverse.php. They keep their paths under /compat/locationiq/v1/ and answer in the same Nominatim-style JSON. Other LocationIQ endpoints, such as autocomplete, move to oslew’s own routes and need code changes.
How do I roll back if the switch goes badly?
Keep the LocationIQ code path and its key in place behind a flag until oslew has carried all your traffic for long enough to trust it. Because the compatibility path returns the same response shape, flipping the flag back restores the old behaviour without a deploy of new parsing code.