AddressFormat
Format postal addresses into perfectly formatted, country-conformant labels for 36 countries.
AddressFormat reference
AddressFormat turns structured address fields into a correctly formatted postal label for 30+ countries, following each country's local convention and UPU rules. Deterministic and stateless: the same input always returns the same label, and nothing is ever stored.
- 30+ countries, each with its own local postal convention
- UPU-compliant country names for international mail
- Deterministic output — same input, same label, every time
- Bulk endpoint: up to 1000 addresses per request
- Three output formats: label, html and oneline
- No database and no data retention
URL base: https://addressformat.p.rapidapi.com
Authentication
AddressFormat is served through RapidAPI. Subscribe to a plan, then send your RapidAPI key on every request — RapidAPI injects the upstream credentials for you.
| Header | Value |
|---|---|
X-RapidAPI-Key | YOUR_RAPIDAPI_KEY |
X-RapidAPI-Host | addressformat.p.rapidapi.com |
Content-Type | application/json |
Início rápido
Endpoints
| GET | /v1/health | Health check |
| GET | /v1/countries | List countries |
| GET | /v1/countries/{country} | Country metadata |
| POST | /v1/format | Format one address |
| POST | /v1/format/batch | Format up to 1000 addresses |
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
recipient | string | Required | Name of the addressee. |
company | string | Optional | Company / organisation line. |
street | string | Required | Street name. |
house_number | string | Required | House or building number. |
apartment | string | Optional | Apartment / unit / suite. |
postal_code | string | Required | Postal/ZIP code; normalised to the local format. |
city | string | Required | City or town. |
state_region | string | Conditional | State/province/region. Required for US, CA, BR, MX, AU, JP and IN. |
country | string (ISO-2) | Required | Destination country as a 2-letter ISO code (NL, DE, US, ...). |
source_country | string (ISO-2) | Optional | Sender country. When it differs from country, the label is formatted for international mail. |
output | label | html | oneline | Optional | Output format. Defaults to label. |
Output formats
label | Newline-separated label, ready to print (default). |
html | Same lines joined with <br> for web display. |
oneline | Comma-separated single line. |
Example
Need many at once? POST /v1/format/batch accepts { "addresses": [ ... ] } (up to 1000). Each address uses the same schema and is validated independently — one invalid address won't fail the whole batch. The response is { count, results }, where every result carries its index.
Supported countries
Call GET /v1/countries for the authoritative live list.
New to APIs? No problem. AddressFormat takes the parts of an address and gives you back a clean, country-correct label. Here's how to start in minutes — no coding needed to try it.
1. What it does
You send the parts of an address (name, street, house number, postal code, city, country). You get back a properly formatted label for that country — ready to print on a parcel or show on screen.
2. Who it's for
Online shops, shipping and logistics tools, checkout forms and CRMs — anyone who needs addresses to look right per country without learning every country's rules.
3. Get access on RapidAPI
Open the RapidAPI listing and click Subscribe. Start on the free BASIC plan. RapidAPI gives you a personal API key automatically — nothing to install.
4. Try it without code
On the RapidAPI page there is a 'Test Endpoint' playground. Fill in the fields and press Test — you'll instantly see the formatted address in the response.
5. Drop it into your app
When you're ready, RapidAPI shows ready-made code in your language (JavaScript, Python, PHP and more) with your key already filled in. Copy, paste, done.
6. That's it
Send an address, get back a label. Need the full field list and examples? Switch to 'For developers' above.
Preços
Plans are billed through RapidAPI — subscribe there to get your API key.
FAQ
Is my address data stored?
No. Requests are processed in memory and never persisted.
Is the output deterministic?
Yes — the same input always returns the same label. No randomness, no external lookups.
Which fields are required?
recipient, street, house_number, postal_code, city and country. Some countries also need state_region (US, CA, BR, MX, AU, JP, IN).
How do I format international mail?
Provide source_country. When it differs from country, the label switches to international format: the city is uppercased and the destination country name is added.
How do I authenticate?
Subscribe on RapidAPI and send your X-RapidAPI-Key header.