{"uid":"cap_Wz6sr2T7hByQ3l3apJwJb","slug":"format-address-api-dd7faa6b","name":"Format Address API","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/format","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":{"city":{"type":"string"},"name":{"type":"string"},"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"},"address1":{"type":"string","description":"street address line 1"},"address2":{"type":"string","description":"street address line 2"},"postalCode":{"type":"string"},"sortingCode":{"type":"string"},"subdivision":{"type":"string","description":"subdivision as ISO 3166-2 code, native or latin name (e.g. US-CA, CA, California, 東京都, Tokyo)"},"organization":{"type":"string"},"dependentLocality":{"type":"string","description":"neighborhood/suburb where used (e.g. BR bairro)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"lines":["Taro Yamada","1-9-1 Marunouchi","Chiyoda-ku, TOKYO","100-0005"],"warnings":[],"formatted":"Taro Yamada\n1-9-1 Marunouchi\nChiyoda-ku, TOKYO\n100-0005","resolvedSubdivision":{"code":"JP-13","name":"東京都","latinName":"Tokyo"}}},"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_xz7XXtumAD_NgpcHoSg9T","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":"Formats and validates postal addresses for 252 countries using Google's libaddressinput metadata, returning correctly structured address blocks with per-country formatting rules.","exampleAgentPrompt":"Format this address for Japan using the latin script: name Taro Yamada, organization Acme Corp, street 1-9-1 Marunouchi, city Chiyoda-ku, subdivision Tokyo, postal code 100-0005, country JP.","exampleUseCases":[{"title":"E-commerce shipping label generation","prompt":"I need to print a shipping label for a customer in Brazil — name Ana Souza, street Rua das Flores 123, bairro Centro, city São Paulo, state SP, postal code 01310-100. Format it correctly for Brazilian postal standards."},{"title":"International invoice address block","prompt":"Format a business address for our invoice going to a client in Germany: company Müller GmbH, street Unter den Linden 10, city Berlin, postal code 10117, country DE."},{"title":"CRM address normalization for Japan","prompt":"I have a Japanese address in our CRM that needs to be formatted properly for mailing — name Yuki Tanaka, street 2-1-1 Shinjuku, subdivision Tokyo, postal code 160-0022, country JP, and show it in latin script please."}],"resultDescription":"Returns a JSON object containing: an array of address lines in the correct country-specific order, a pre-formatted string with newline separators ready to print, a warnings array flagging any missing or unexpected fields, and a resolvedSubdivision object with the ISO 3166-2 code, native name, and latin name for the provided subdivision.","failureModes":["Missing required 'country' query parameter returns an error","Invalid or unrecognized ISO 3166-1 alpha-2 country code results in an error or empty format","Unrecognized subdivision name or code may produce a warning or leave subdivision unresolved","Fields irrelevant to the target country (e.g. postal code for a country that doesn't use them) generate warnings","Providing an unsupported 'script' value may fall back to default local script","Network or payment (x402) failure prevents the response from being returned"],"whenToPreferThis":"Choose this endpoint when you need authoritative, country-specific postal address formatting for any of 252 countries and want Google libaddressinput-backed rules rather than hand-coded templates. It is ideal for e-commerce checkout flows, CRM data normalization, shipping label generation, invoice address blocks, and any workflow where correctly ordered and formatted address lines matter. Prefer it over generic string concatenation or homegrown formatters when you need subdivision resolution, local vs. latin script switching (e.g. for Japan, China, Korea, Taiwan), or warnings about missing address components.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:30:29.429Z","isFirstParty":false}