Address Search, Typos & Verification
Real-world address inputs are messy. Users mistype street names (4865 Mision St, 10 Dwoning Street), swap letters in city names (Lnodon, Califronia, San Fransisco), forget commas, append apartment numbers in arbitrary places, or type the wrong neighboring city next to a valid postal code.
texspace handles all of these automatically without requiring you to pre-clean or parse addresses yourself — and gives you structured signals (match_level, deliverable, corrections, conflicting_tokens) so your app can decide whether to accept an address automatically or ask the user to confirm.
What Works Out of the Box#
- Automatic typo correction: Recovers dropped letters, extra letters, wrong letters, and swapped adjacent letters across both street names and global cities/states — with zero performance penalty on cleanly spelled addresses.
- Apartment & unit extraction: Pulls out
Apt 4B,Suite 250,#12,Floor 10, and international CJK floor/unit markers cleanly intocomponents.unitwithout breaking street matching. - Wrong-city conflict detection: If a user enters
"4865 Mission St Apt 4B 94112 Oakland",texspaceresolves the exact San Francisco parcel matching4865 Mission St+94112and flagsconflicting_tokens: ["oakland"]andcorrections: ["corrected_city"]. - Cross-street intersections: Queries like
"Market St & 4th St, San Francisco"or"Broadway & W 42nd St, New York"snap to the exact corner (match_level: "intersection"). - International & non-Latin addresses: Works across 128 global regions including CJK (
114臺北市內湖區瑞光路192號10樓), German street compounds (Friedrichstraße 43, Berlin), UK/Canadian/Dutch fine postcodes (SW1A 2AA,H3B 2Y5), and automatic romanization.
Verifying Deliverability (geo.verify())#
import { Texspace } from "texspace";
const geo = await Texspace.open("https://shards.texspace.dev/txg/v2");
const ver = await geo.verify("4865 Mission St Apt 4B 94112 Oakland");
console.log({
verified: ver.verified, // true
deliverable: ver.deliverable, // true
status: ver.status, // "verified_parcel"
apn: ver.apn, // "6272-015B"
formatted_lines: ver.formatted_lines, // ["4865 Mission Street Apt 4B", "San Francisco, CA 94112"]
corrections: ver.corrections, // ["corrected_city"]
conflicting_tokens: ver.conflicting_tokens, // ["oakland"]
});Understanding Verification Statuses#
status | deliverable | Meaning | Recommended UI Action |
|---|---|---|---|
verified_parcel | true | Matched an exact cadastral parcel (includes apn where available) | Accept automatically |
verified_rooftop | true | Matched an exact rooftop address point | Accept automatically |
verified_interpolated | true | Interpolated along the street segment between real neighbor numbers | Accept automatically (show subtle confirmation if conflicting_tokens is non-empty) |
street_only | false | Street matched, but house number was missing or could not be verified | Prompt user to confirm house number |
postcode_only | false | Only postal code matched | Prompt user for street address |
locality_only | false | Only city or region matched | Prompt user for full address |
unverified | false | No confident match found | Ask user to check input or pick from alternatives |
Test spelling mistakes, swapped letters, wrong-city mismatches, and unit extraction directly against the global index.
// Output appears here
Structured Fielded Search (geo.structured())#
When your data is already split into separate columns (housenumber, street, locality, region, postcode), use geo.structured() to get per-field agreement (field_matches) and discrepancy diagnostics (field_conflicts):
const res = await geo.structured({
housenumber: "2750",
street: "Middlefield Rd",
locality: "Palo Alto",
region: "CA",
postcode: "94306",
});
console.log(res.results[0].field_matches, res.results[0].field_conflicts);Go Deeper#
- Checkout & Address Verification — Drop verification directly into a
<form>. - JavaScript & TypeScript SDK Reference — Full
TxgVerifyResponseandTxgStructuredResponseschemas. - Architecture — How spatial-first intersection and fuzzy typo rescue work under the hood.