Parse an unstructured address string into structured components — recipient, street, unit, city, state/region, postal code, and country. Optional country hint guides format expectations. Returns a confidence score.
Split a messy, free-form address string into clean structured components — recipient, street_address, unit, city, state_region, postal_code, country — with a confidence score. Handles the inconsistent, single-line addresses that regexes choke on.
| Entrypoint | Renders | Inputs |
|---|---|---|
systemPrompt | Instructions, component list + embedded schema | optional countryHint |
userPrompt | The delimited address string | address |
address (string, required) — the unstructured address to parse.countryHint (string, optional) — a country name or ISO code (e.g. "US", "United Kingdom") to guide format expectations when the string is ambiguous or omits the country.{
"reasoning": "Comma-delimited US address; unit split from the street line, state and ZIP recognized.",
"components": {
"recipient": "Acme Corp",
"street_address": "350 Fifth Avenue",
"unit": "Suite 2100",
"city": "New York",
"state_region": "NY",
"postal_code": "10118",
"country": "United States"
},
"confidence": 0.92
}
reasoning is emitted first (house convention).null — the prompt is told never to guess a postal code, city, or country that isn't present. The one licensed exception: country may be filled from countryHint.confidence is self-reported and ⚠️ not calibrated — a rough signal for flagging addresses that need review, not a probability.address so &, #, and other characters survive.<address> delimiters around the input.additionalProperties: false, confidence bounded 0–1.Verified by local render with and without countryHint. Suggested default claude-sonnet-4-6 at temperature: 0. For deliverability-critical use, follow up with a postal-validation API — this prompt structures an address, it does not verify it exists.