Guide · Search & Data Quality

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 into components.unit without breaking street matching.
  • Wrong-city conflict detection: If a user enters "4865 Mission St Apt 4B 94112 Oakland", texspace resolves the exact San Francisco parcel matching 4865 Mission St + 94112 and flags conflicting_tokens: ["oakland"] and corrections: ["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())#

ts
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#

statusdeliverableMeaningRecommended UI Action
verified_parceltrueMatched an exact cadastral parcel (includes apn where available)Accept automatically
verified_rooftoptrueMatched an exact rooftop address pointAccept automatically
verified_interpolatedtrueInterpolated along the street segment between real neighbor numbersAccept automatically (show subtle confirmation if conflicting_tokens is non-empty)
street_onlyfalseStreet matched, but house number was missing or could not be verifiedPrompt user to confirm house number
postcode_onlyfalseOnly postal code matchedPrompt user for street address
locality_onlyfalseOnly city or region matchedPrompt user for full address
unverifiedfalseNo confident match foundAsk user to check input or pick from alternatives

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):

ts
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#