AddressFormat

Format postal addresses into perfectly formatted, country-conformant labels for 36 countries.

liveData Validation在 RapidAPI 订阅

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

HeaderValue
X-RapidAPI-KeyYOUR_RAPIDAPI_KEY
X-RapidAPI-Hostaddressformat.p.rapidapi.com
Content-Typeapplication/json

快速开始

cURL
curl -X POST 'https://addressformat.p.rapidapi.com/v1/format' \ -H 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \ -H 'X-RapidAPI-Host: addressformat.p.rapidapi.com' \ -H 'Content-Type: application/json' \ -d '{"recipient":"Jan de Vries","street":"Damrak","house_number":"70","postal_code":"1012LM","city":"Amsterdam","country":"NL"}'
Node.js (axios)
import axios from 'axios'; const { data } = await axios.post( 'https://addressformat.p.rapidapi.com/v1/format', { recipient: 'Jan de Vries', street: 'Damrak', house_number: '70', postal_code: '1012LM', city: 'Amsterdam', country: 'NL' }, { headers: { 'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY', 'X-RapidAPI-Host': 'addressformat.p.rapidapi.com', 'Content-Type': 'application/json', } }, ); console.log(data.formatted);
Python (requests)
import requests resp = requests.post( 'https://addressformat.p.rapidapi.com/v1/format', json={'recipient': 'Jan de Vries', 'street': 'Damrak', 'house_number': '70', 'postal_code': '1012LM', 'city': 'Amsterdam', 'country': 'NL'}, headers={ 'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY', 'X-RapidAPI-Host': 'addressformat.p.rapidapi.com', 'Content-Type': 'application/json', }, ) print(resp.json()['formatted'])

端点

GET/v1/healthHealth check
GET/v1/countriesList countries
GET/v1/countries/{country}Country metadata
POST/v1/formatFormat one address
POST/v1/format/batchFormat up to 1000 addresses

Request fields

FieldTypeRequiredDescription
recipientstringRequiredName of the addressee.
companystringOptionalCompany / organisation line.
streetstringRequiredStreet name.
house_numberstringRequiredHouse or building number.
apartmentstringOptionalApartment / unit / suite.
postal_codestringRequiredPostal/ZIP code; normalised to the local format.
citystringRequiredCity or town.
state_regionstringConditionalState/province/region. Required for US, CA, BR, MX, AU, JP and IN.
countrystring (ISO-2)RequiredDestination country as a 2-letter ISO code (NL, DE, US, ...).
source_countrystring (ISO-2)OptionalSender country. When it differs from country, the label is formatted for international mail.
outputlabel | html | onelineOptionalOutput format. Defaults to label.

Output formats

labelNewline-separated label, ready to print (default).
htmlSame lines joined with <br> for web display.
onelineComma-separated single line.

Example

Request body
{ "recipient": "Jan de Vries", "street": "Damrak", "house_number": "70", "postal_code": "1012LM", "city": "Amsterdam", "country": "NL" }
Response 200
{ "formatted": "Jan de Vries\nDamrak 70\n1012 LM Amsterdam", "lines": ["Jan de Vries", "Damrak 70", "1012 LM Amsterdam"], "warnings": [] }

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

AEATAUBEBRCACHCZDEDKESFIFRGBGRHKHUIEILINITJPLUMCMXNLNONZPLPTSESGUSZA

Call GET /v1/countries for the authoritative live list.

价格

BASIC
免费
50 请求 / 月
PRO
$9.99 /月
3,500 请求 / 月
ULTRA
$32.99 /月
30,000 请求 / 月

Plans are billed through RapidAPI — subscribe there to get your API key.

View plans on RapidAPI

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.

在 RapidAPI 订阅

‹ 所有 API