# Format Address API

> Format Address API is a paid API for AI agents from formataddress.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Formats and validates postal addresses for 252 countries using Google's libaddressinput metadata, returning correctly structured address blocks with per-country formatting rules.

## Facts

- Endpoint: GET https://formataddress.com/v1/format
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/format-address-api-dd7faa6b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Wz6sr2T7hByQ3l3apJwJb

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability format-address-api-dd7faa6b
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "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"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/format-address-api-dd7faa6b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from formataddress.com](https://www.zero.xyz/host/formataddress.com/llms.txt)
