Getting better accuracy
There is one change worth making before any other, and it is not a parameter. It is sending the postcode — as the text after the last comma of q.
The measurement
7,361 numbered Mexico City addresses were held out of the index before it was built, so the question each one asks is the field case: how well is an address placed whose house number the data has never seen? The street is still there; the exact number is not. The tables are over 2,000 of those addresses, geocoded with different context.
| Context sent | ≤10 m | ≤50 m | ≤250 m | Median | p90 | p50 latency |
|---|---|---|---|---|---|---|
| A city | 3.5% | 19.6% | 39.5% | 673 m | 18.1 km | 22.3 ms |
| The postcode | 6.1% | 35.3% | 73.2% | 93 m | 566 m | 2.7 ms |
Both runs answered every address. Those two rows were measured with interpolation off, because it did not exist yet. It is on by default now, and with it the same addresses place like this:
| Context sent | Interpolation | ≤10 m | ≤50 m | ≤250 m | Median |
|---|---|---|---|---|---|
| A city | off | 3.5% | 19.6% | 39.5% | 673 m |
| A city | on | 23.4% | 41.1% | 52.2% | 162 m |
| The postcode | off | 6.1% | 35.3% | 73.2% | 93 m |
| The postcode | on | 38.2% | 67.2% | 86.7% | 19 m |
Interpolation added 0.7 ms to a postcode-scoped query and 5.6 ms to a city-scoped one, because the second search it runs along the street has a whole city to look through. These are Mexico City addresses; how an address elsewhere does depends on what address data is loaded there, and on the same thing this page is about — what you send with it.
Why the gap is that large
Send a street and a city, and the engine is choosing between every same-named street in a metropolis of nine million. Mexico City has dozens of streets called Emiliano Zapata, several of them with a number 14, andCiudad de México covers all of them. Broken down, the city-context failures had a telling shape: when the answer carried the exact house number asked for, it was usually on the wrong one of those streets, a median of 4 km away; when it fell back to a neighbouring number, it was usually on the right street. The tail — 18 km at p90 — is that ambiguity, not missing data, and the p90 is the number your users complain about.
A postcode removes it. It is one of the three things an address row is indexed by — locality, postcode and country — so it narrows the search before anything is scored rather than filtering the answers afterwards. That is why it is both seven times closer and eight times faster. The same address with each context shows the work it saves:
With the postcode
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 299
ratelimit-reset: 1
{
"query": "Avenida Insurgentes Sur 1602, 03940",
"name": "Avenida Insurgentes Sur 1602",
"context": "03940",
"parse": {
"name": "Avenida Insurgentes Sur 1602",
"context": "03940",
"house_number": "1602",
"street": "Avenida Insurgentes Sur",
"postcode": "03940",
"method": "comma_parts"
},
"context_resolution": {
"terms": [
"03940"
],
"divisions": [],
"known": true,
"fallback": false
},
"near": null,
"results": [
{
"doc": 1645192,
"name": "AVENIDA INSURGENTES SUR 1602",
"lat": 19.364069672979937,
"lon": -99.18198831998704,
"bbox": [
19.3639356260916,
19.36420371987013,
-99.18211741026626,
-99.18185922973113
],
"precision": "rooftop",
"precision_m": 6.756173533775122,
"hierarchy": {
"locality": "Ciudad de México",
"region": null,
"country": "MX",
"category": null,
"postcode": "03940",
"street": "AVENIDA INSURGENTES SUR"
},
"normalized": {
"house_number": "1602",
"street": "AVENIDA INSURGENTES SUR",
"locality": "Ciudad de México",
"postcode": "03940",
"country": "MX",
"formatted": "AVENIDA INSURGENTES SUR 1602, Ciudad de México, 03940, MX"
},
"components": {
"name": "exact",
"house_number": "exact",
"street": "exact",
"locality": "exact",
"region": "missing",
"postcode": "exact",
"country": "missing"
},
"confidence": 0.72772276,
"why": {
"tokens": [
"1602",
"avenida",
"insurgentes",
"sur"
],
"matched": 4,
"extra": 0,
"mode": "all",
"tied": false,
"prominence": 0,
"rerank": 100
},
"provenance": {
"name": "overture-addresses",
"release": "2026-08-19.0",
"license": "permissive (per-source, see record)"
},
"attributes": null
}
],
"mode": "all",
"tied_at_top": 1,
"tie_probe": 16,
"interpolated": false,
"decision": {
"action": "act",
"margin": 0.18940592
},
"epoch": 30,
"release": "2026-08-19.0",
"examined": 1612,
"postings": 3471,
"segments": 2,
"store_requests": 0,
"store_bytes": 0,
"took_us": 15244
}A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.
With the city
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 299
ratelimit-reset: 1
{
"query": "Avenida Insurgentes Sur 1602, Ciudad de México",
"name": "Avenida Insurgentes Sur 1602",
"context": "Ciudad de México",
"parse": {
"name": "Avenida Insurgentes Sur 1602",
"context": "Ciudad de México",
"house_number": "1602",
"street": "Avenida Insurgentes Sur",
"locality": "Ciudad de México",
"method": "comma_parts"
},
"context_resolution": {
"terms": [
"Ciudad de México",
"MX-CMX",
"CMX"
],
"divisions": [
{
"doc": 1560,
"id": "bc8dbc34-544b-47c4-bdb1-d3f5ecfc6af7",
"name": "Ciudad de México",
"subtype": "region",
"country": "MX",
"region": "MX-CMX",
"admin_level": 1,
"via": "interior",
"provenance": {
"name": "overture-divisions",
"release": "2026-08-19.0",
"license": "ODbL-1.0"
}
},
{
"doc": 1522,
"id": "2b1d49e2-98ef-4665-b9f6-1ce96c9f015b",
"name": "Ciudad de México",
"subtype": "locality",
"country": "MX",
"region": "MX-CMX",
"admin_level": null,
"via": "interior",
"provenance": {
"name": "overture-divisions",
"release": "2026-08-19.0",
"license": "ODbL-1.0"
}
}
],
"known": true,
"fallback": false
},
"near": null,
"results": [
{
"doc": 1645192,
"name": "AVENIDA INSURGENTES SUR 1602",
"lat": 19.364069672979937,
"lon": -99.18198831998704,
"bbox": [
19.3639356260916,
19.36420371987013,
-99.18211741026626,
-99.18185922973113
],
"precision": "rooftop",
"precision_m": 6.756173533775122,
"hierarchy": {
"locality": "Ciudad de México",
"region": null,
"country": "MX",
"category": null,
"postcode": "03940",
"street": "AVENIDA INSURGENTES SUR"
},
"normalized": {
"house_number": "1602",
"street": "AVENIDA INSURGENTES SUR",
"locality": "Ciudad de México",
"postcode": "03940",
"country": "MX",
"formatted": "AVENIDA INSURGENTES SUR 1602, Ciudad de México, 03940, MX"
},
"components": {
"name": "exact",
"house_number": "exact",
"street": "exact",
"locality": "exact",
"region": "missing",
"postcode": "missing",
"country": "missing"
},
"confidence": 0.3960396,
"why": {
"tokens": [
"1602",
"avenida",
"insurgentes",
"sur"
],
"matched": 4,
"extra": 0,
"mode": "all",
"tied": false,
"prominence": 0,
"rerank": 89
},
"provenance": {
"name": "overture-addresses",
"release": "2026-08-19.0",
"license": "permissive (per-source, see record)"
},
"attributes": null
},
{
"doc": 131752,
"name": "AVENIDA INSURGENTES SUR",
"lat": 19.306485580000658,
"lon": -99.18666049037793,
"bbox": [
19.30635154353446,
19.306619616468854,
-99.18678958317274,
-99.18653139760642
],
"precision": "street",
"precision_m": 6.756173533775122,
"hierarchy": {
"locality": "Ciudad de México",
"region": null,
"country": "MX",
"category": null,
"postcode": "04530",
"street": "AVENIDA INSURGENTES SUR"
},
"normalized": {
"street": "AVENIDA INSURGENTES SUR",
"locality": "Ciudad de México",
"postcode": "04530",
"country": "MX",
"formatted": "AVENIDA INSURGENTES SUR, Ciudad de México, 04530, MX"
},
"components": {
"name": "partial",
"house_number": "missing",
"street": "partial",
"locality": "exact",
"region": "missing",
"postcode": "missing",
"country": "missing"
},
"confidence": 0.35,
"why": {
"tokens": [
"1602",
"avenida",
"insurgentes",
"sur"
],
"matched": 3,
"extra": 0,
"mode": "all",
"tied": true,
"prominence": 0,
"rerank": 67
},
"provenance": {
"name": "overture-addresses",
"release": "2026-08-19.0",
"license": "permissive (per-source, see record)"
},
"attributes": null
},
{
"doc": 131754,
"name": "AVENIDA INSURGENTES SUR",
"lat": 19.305591323802492,
"lon": -99.18614134691849,
"bbox": [
19.30545728760145,
19.305725360005535,
-99.18627043943381,
-99.18601225442644
],
"precision": "street",
"precision_m": 6.756173533775122,
"hierarchy": {
"locality": "Ciudad de México",
"region": null,
"country": "MX",
"category": null,
"postcode": "04530",
"street": "AVENIDA INSURGENTES SUR"
},
"normalized": {
"street": "AVENIDA INSURGENTES SUR",
"locality": "Ciudad de México",
"postcode": "04530",
"country": "MX",
"formatted": "AVENIDA INSURGENTES SUR, Ciudad de México, 04530, MX"
},
"components": {
"name": "partial",
"house_number": "missing",
"street": "partial",
"locality": "exact",
"region": "missing",
"postcode": "missing",
"country": "missing"
},
"confidence": 0.35,
"why": {
"tokens": [
"1602",
"avenida",
"insurgentes",
"sur"
],
"matched": 3,
"extra": 0,
"mode": "all",
"tied": true,
"prominence": 0,
"rerank": 67
},
"provenance": {
"name": "overture-addresses",
"release": "2026-08-19.0",
"license": "permissive (per-source, see record)"
},
"attributes": null
}
],
"mode": "all",
"tied_at_top": 1,
"tie_probe": 371,
"interpolated": false,
"decision": {
"action": "refuse",
"margin": 0.076227725,
"ask_for": [
"postcode"
]
},
"epoch": 30,
"release": "2026-08-19.0",
"examined": 29202,
"postings": 353658,
"segments": 2,
"store_requests": 0,
"store_bytes": 0,
"took_us": 22012
}A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.
Both find Avenida Insurgentes Sur 1602, because that number is in the data. Look at what each had to do to find it. With the postcode, the search scored 1,612 documents (examined) from 3,471 postings and kept 16 candidates (tie_probe). With the city, the context resolved to a region and a locality and two ISO spellings, and the search scored 29,202 documents from 353,658 postings — a hundred times the postings — and kept 371. The alternates it offers are rows of the same avenue in another postcode, 6 km south. On a number the data does not hold, that is the difference between the right block and the wrong end of the avenue.
The answers say so themselves. With the postcode, confidence is 0.73 and decision.action isact. With the city, the same rooftop comes back at 0.40, and decision isrefuse with ask_for: ["postcode"]: an address's confidence is the share of answers like it that landed within 250 m in the measurement above, so it carries the 73% and the 40% of the table into each answer.
How to send the postcode
There is no postcode parameter, and no country parameter; a parameter the route does not take is silently dropped. The postcode goes in q, as the text after the lastcomma — and only the last comma counts.
q | What the service reads | |
|---|---|---|
Avenida Insurgentes Sur 1602, 03940 | Right | Name Avenida Insurgentes Sur 1602, context 03940. |
Avenida Insurgentes Sur 1602, 03940, MX | Wrong | Context MX only. 03940 becomes a word of the name that no address row carries, so the match is partial. |
Avenida Insurgentes Sur 1602, Benito Juárez, 03940 | Wrong | Context 03940, but the borough is now two more words of the name that the address row does not have. |
Avenida Insurgentes Sur 1602 with &postcode=03940 | Wrong | No context at all. postcode is not a parameter and is ignored. |
If your data has the address in columns, build q from two of them: street and number, a comma, the postcode. Leave out the colonia, the borough, the city and the country. The answer's name andcontext fields echo how q was split, and context_resolution.fallback says whether the postcode matched anything; if it did not, the results are the best matches for the street anywhere.
q = f"{row['street']} {row['number']}, {row['postcode']}"
answer = client.geocode(q, limit=1)
if answer["context_resolution"] and answer["context_resolution"]["fallback"]:
... # the postcode matched nothing: the answer ignores itA postcode narrows addresses, not places. A museum or a shop is indexed by its locality, region and country, so for a named place send the city as context instead.
So, in order of value
- Send the postcode after the last comma when you have it. Nothing else you can do compares.
- Otherwise send the smallest area you have — a borough before a city, a city before a country. A country as context only narrows to the country, which helps when your addresses span several and does little within one.
- Keep the house number. It is what takes an answer from
streettorooftop, and it is what interpolation places when the data does not hold it. Of the typos measured below, the costliest by far is an address cut short before its number. - Leave interpolation on. It is the default, and on a postcode-scoped query it took the median from 93 m to 19 m for under a millisecond.
precision: interpolatedandbetweensay when it was used. - Use
nearonly as a hard boundary. It keeps candidates inside the grid cell of about 10 km that holds the point and drops everything else — it does not prefer nearer answers. It is right when the address must be in the user's city; it silently loses the answer when the address is in the next cell. - Check
decision. It costs nothing.refusesays when no amount of ranking could have helped, because the query as sent names more than one place or two too closely;asknames the field that would settle it, usuallypostcode. The fix then is more context, not a retry.
What a typo costs
Measured the same way — 2,000 held-out addresses, the postcode as context, interpolation on — with one kind of typo applied to every query in a run. The share of real typos is from a public corpus of misspelt addresses.
| Typo | Share of real typos | ≤10 m | ≤250 m | Median |
|---|---|---|---|---|
| None | — | 38.2% | 86.7% | 19 m |
| Two characters transposed | not observed | 38.3% | 86.5% | 19 m |
| One character substituted | under 1% | 37.9% | 86.5% | 19 m |
| One character dropped | 48% | 37.2% | 85.2% | 21 m |
| Two words glued together | 7% | 28.9% | 75.0% | 43 m |
| Cut short, keeping the number | 21% | 25.6% | 72.2% | 54 m |
| Cut short, losing the number | 21% | 4.7% | 68.5% | 119 m |
Single-character mistakes are absorbed. What costs accuracy is losing words — above all the house number — which is why the advice above is about what to send, not how to spell it. How misspellings are repaired, and how a repaired answer is labelled, is in geocoding an address.
What we did not do, and why it is here
Transposed characters — the failure a reranking model is usually proposed for — were measured at a cost of 0.1 points within 50 m. The model would have been built for a problem the engine does not have, so it was not built.The full benchmark includes the rows that do not flatter us, which is the only kind worth publishing.