{"uid":"cap_Agc7RKmMrxFsKqoJ-cLHD","slug":"format-address-api-country-formatting-rules-6a099514","name":"Format Address API – Country Formatting Rules","description":"Verified postal address formatting for 252 countries based on Google's libaddressinput metadata: per-country format rules, address-block composition, verification of your own output, and subdivision lists. Address formatting per Google's libaddressinput metadata — informational, not legal or postal advice.","url":"https://formataddress.com/v1/rules","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["country"],"properties":{"script":{"type":"string","description":"local (default) | latin — latin uses the romanized format where the country has one (JP, CN, KR, TW …)"},"country":{"type":"string","description":"ISO 3166-1 alpha-2 country code, e.g. DE, US, JP, BR"},"subdivision":{"type":"string","description":"subdivision as ISO 3166-2 code, native or latin name (e.g. US-CA, CA, California, 東京都, Tokyo)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"required":["streetAddress","city","postalCode"],"template":"%N%n%O%n%A%n%Z %C","fieldOrder":["name","organization","streetAddress","postalCode","city"],"postalCode":{"example":"26133","pattern":"\\d{5}"},"countryName":"GERMANY"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_r_baATAgl1ba2vLQd7T9H","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns per-country postal address format rules, field order, postal code patterns, and subdivision metadata for a given ISO 3166-1 alpha-2 country code.","exampleAgentPrompt":"What are the postal address formatting rules for Japan in Latin script — including which fields are required, what order they go in, and what the postal code pattern looks like?","exampleUseCases":[{"title":"E-commerce checkout address validation","prompt":"I'm building a checkout form and need to know which address fields are required and in what order for Germany — can you pull the official formatting rules including the postal code pattern?"},{"title":"Localized address block for shipping label","prompt":"I need to print a shipping label for a package going to South Korea — can you get me the correct address format template in Latin script so I know how to arrange the recipient's name, street, city, and postal code?"},{"title":"CRM address field configuration by country","prompt":"We're setting up our CRM to collect addresses from customers in Brazil — what fields are required, what's the correct field order, and what should the postal code look like?"}],"resultDescription":"A JSON object containing the address template string (using format tokens like %N, %O, %A, %Z, %C), an ordered list of address fields, which fields are required, a postal code regex pattern and example, the country name, and optionally subdivision data — everything needed to render or validate an address form for that country.","failureModes":["Missing or invalid country code returns an error","Unsupported country code (outside 252 supported) may return empty or error response","Invalid subdivision code may be ignored or return an error","Requesting latin script for a country without a romanized format may fall back to local format","Network or payment failure (HTTP 402 if USDC payment not processed)"],"whenToPreferThis":"Choose this endpoint when you need authoritative, per-country postal address formatting rules derived from Google's libaddressinput metadata — particularly when building address forms, validating address output, printing shipping labels, or configuring CRM/ERP systems for international use. Prefer this over generic address validation APIs when you specifically need format templates, required-field lists, field ordering, and postal code patterns rather than geocoding or address correction.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:39:48.507Z","isFirstParty":false}