Authentifizierung Ausser Health, Readiness und OpenAPI benoetigen alle Endpunkte ein Bearer-Token aus der Verwaltung. Tokens besitzen Lese- oder Erzeugungsrechte, Minutenlimits und Ablaufzeiten.
Authorization: Bearer YOUR_API_TOKENKopieren
GET /api/v1/health
Berechtigung: public Prueft, ob der API-Prozess verfuegbar ist.
Parameter Keine Anfrageparameter.
Aufrufbeispiele curl python JavaScript
curl "https://address.example/api/v1/health" \import json
from urllib.request import Request, urlopen
request = Request(
"https://address.example/api/v1/health",
method="GET"
)
with urlopen(request) as response:
print(json.load(response))const response = await fetch("https://address.example/api/v1/health");
const payload = await response.json();
console.log(payload);Kopieren Erfolgreiche Antwort {
"status": "ok"
}GET /api/v1/ready
Berechtigung: public Prueft die Einsatzbereitschaft von API und PostgreSQL.
Parameter Keine Anfrageparameter.
Aufrufbeispiele curl python JavaScript
curl "https://address.example/api/v1/ready" \import json
from urllib.request import Request, urlopen
request = Request(
"https://address.example/api/v1/ready",
method="GET"
)
with urlopen(request) as response:
print(json.load(response))const response = await fetch("https://address.example/api/v1/ready");
const payload = await response.json();
console.log(payload);Kopieren Erfolgreiche Antwort {
"status": "ready"
}GET /api/v1/countries
Berechtigung: read Listet Laender, Funktionen, Adresszahlen und Schnellzugriffe auf.
Parameter Keine Anfrageparameter.
Aufrufbeispiele curl python JavaScript
curl "https://address.example/api/v1/countries" \
-H "Authorization: Bearer YOUR_API_TOKEN" \import json
from urllib.request import Request, urlopen
request = Request(
"https://address.example/api/v1/countries",
headers={"Authorization":"Bearer YOUR_API_TOKEN"},
method="GET"
)
with urlopen(request) as response:
print(json.load(response))const response = await fetch("https://address.example/api/v1/countries", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN"
},
});
const payload = await response.json();
console.log(payload);Kopieren Erfolgreiche Antwort {
"data": [
{
"code": "US",
"residentialAvailable": true,
"residentialCount": 50000,
"generationMode": "synchronized-pool"
}
]
}GET /api/v1/availability
Berechtigung: read Liefert die kompakte Liste verfuegbarer Wohnadressen.
Parameter Keine Anfrageparameter.
Aufrufbeispiele curl python JavaScript
curl "https://address.example/api/v1/availability" \
-H "Authorization: Bearer YOUR_API_TOKEN" \import json
from urllib.request import Request, urlopen
request = Request(
"https://address.example/api/v1/availability",
headers={"Authorization":"Bearer YOUR_API_TOKEN"},
method="GET"
)
with urlopen(request) as response:
print(json.load(response))const response = await fetch("https://address.example/api/v1/availability", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN"
},
});
const payload = await response.json();
console.log(payload);Kopieren Erfolgreiche Antwort {
"data": [
{
"code": "US",
"residentialAvailable": true
}
]
}Ermittelt Land und Standortkontext der Anfrage-IP.
Parameter ipOptional · query · string Optional IPv4 or IPv6 address; omitted means the request IP.
Aufrufbeispiele curl python JavaScript
curl "https://address.example/api/v1/client-context?ip=198.51.100.7" \
-H "Authorization: Bearer YOUR_API_TOKEN" \import json
from urllib.request import Request, urlopen
request = Request(
"https://address.example/api/v1/client-context?ip=198.51.100.7",
headers={"Authorization":"Bearer YOUR_API_TOKEN"},
method="GET"
)
with urlopen(request) as response:
print(json.load(response))const response = await fetch("https://address.example/api/v1/client-context?ip=198.51.100.7", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN"
},
});
const payload = await response.json();
console.log(payload);Kopieren Erfolgreiche Antwort {
"data": {
"country": "US",
"region": "California",
"city": "Los Angeles",
"matchLevel": "city"
}
}Sucht Regionen, Staedte, Bezirke oder Postleitzahlen mit Seitennavigation.
Parameter countryOptional · query · string · Standard: US ISO 3166-1 alpha-2 country code.
fieldOptional · query · string · Standard: city Catalog field to return.
qOptional · query · string Optional case-insensitive search text.
regionOptional · query · string Exact parent region value.
regionIdOptional · query · string Stable parent region ID.
cityIdOptional · query · string Stable parent city ID.
residentialOptional · query · boolean · Standard: false Restrict counts to published residential records.
cursorOptional · query · string Opaque cursor returned by the previous page.
limitOptional · query · integer · Standard: 100 · 20-200 Page size from 20 through 200.
Aufrufbeispiele curl python JavaScript
curl "https://address.example/api/v1/locations/search?country=US&field=city®ionId=1416&limit=100" \
-H "Authorization: Bearer YOUR_API_TOKEN" \import json
from urllib.request import Request, urlopen
request = Request(
"https://address.example/api/v1/locations/search?country=US&field=city®ionId=1416&limit=100",
headers={"Authorization":"Bearer YOUR_API_TOKEN"},
method="GET"
)
with urlopen(request) as response:
print(json.load(response))const response = await fetch("https://address.example/api/v1/locations/search?country=US&field=city®ionId=1416&limit=100", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN"
},
});
const payload = await response.json();
console.log(payload);Kopieren Erfolgreiche Antwort {
"data": {
"cities": [
{
"id": "example-city",
"value": "Los Angeles",
"availableCount": 120
}
],
"total": 1,
"nextCursor": null
}
}GET /api/v1/generate
Berechtigung: generate Erzeugt zufaellig eine veroeffentlichte Wohnadresse mit Testprofil.
Parameter countryOptional · query · string · Standard: US ISO 3166-1 alpha-2 country code.
regionOptional · query · string Exact first-level region value.
regionIdOptional · query · string Stable region ID from location search.
cityOptional · query · string Exact city value.
cityIdOptional · query · string Stable city ID from location search.
districtOptional · query · string Exact district value where supported.
districtIdOptional · query · string Stable district ID from location search.
postcodeOptional · query · string Exact postcode value.
postcodeIdOptional · query · string Stable postcode ID from location search.
modeOptional · query · string Use ip-region to match the request or supplied IP.
ipOptional · query · string IPv4 or IPv6 used with ip-region mode.
qOptional · query · string Text that must occur in the selected address components.
strategyOptional · query · string · Standard: random Selection strategy; both modes select from the synchronized database.
residentialOptional · query · boolean · Standard: true Legacy compatibility flag; generation always returns residential records.
seedOptional · query · string Optional reproducible random seed.
requestIdOptional · query · string Caller-provided request correlation ID.
Aufrufbeispiele curl python JavaScript
curl "https://address.example/api/v1/generate?country=US®ion=California&requestId=YOUR_REQUEST_ID" \
-H "Authorization: Bearer YOUR_API_TOKEN" \import json
from urllib.request import Request, urlopen
request = Request(
"https://address.example/api/v1/generate?country=US®ion=California&requestId=YOUR_REQUEST_ID",
headers={"Authorization":"Bearer YOUR_API_TOKEN"},
method="GET"
)
with urlopen(request) as response:
print(json.load(response))const response = await fetch("https://address.example/api/v1/generate?country=US®ion=California&requestId=YOUR_REQUEST_ID", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN"
},
});
const payload = await response.json();
console.log(payload);Kopieren Erfolgreiche Antwort {
"data": {
"requestId": "YOUR_REQUEST_ID",
"country": "US",
"mode": "residential",
"sourcesTried": [
"address-pool-v2"
],
"result": {
"address": {
"id": "address-id",
"countryCode": "US",
"formattedAddress": "Example address"
}
}
}
}Erzeugt bis zu 50 Wohnadressen mit strukturierten Filtern, Ausschluessen und Eindeutigkeit.
Parameter countErforderlich · body · integer · 1-50 Number of addresses to generate.
filtersErforderlich · body · object Country and exact administrative, postcode, or text filters.
optionsOptional · body · object Randomness, uniqueness, strategy, and request correlation options.
excludeAddressIdsOptional · body · array Address IDs that must not be returned.
Aufrufbeispiele curl python JavaScript
curl -X POST "https://address.example/api/v1/generate/batch" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"count": 3,
"filters": {
"country": "US",
"region": "California",
"city": "Los Angeles"
},
"options": {
"unique": true,
"strategy": "random",
"seed": "example-seed"
},
"excludeAddressIds": []
}'import json
from urllib.request import Request, urlopen
request = Request(
"https://address.example/api/v1/generate/batch",
headers={"Authorization":"Bearer YOUR_API_TOKEN","Content-Type":"application/json"},
data=json.dumps({"count":3,"filters":{"country":"US","region":"California","city":"Los Angeles"},"options":{"unique":true,"strategy":"random","seed":"example-seed"},"excludeAddressIds":[]}),
method="POST"
)
with urlopen(request) as response:
print(json.load(response))const response = await fetch("https://address.example/api/v1/generate/batch", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"count": 3,
"filters": {
"country": "US",
"region": "California",
"city": "Los Angeles"
},
"options": {
"unique": true,
"strategy": "random",
"seed": "example-seed"
},
"excludeAddressIds": []
})
});
const payload = await response.json();
console.log(payload);Kopieren Erfolgreiche Antwort {
"data": {
"requestId": "batch-request-id",
"requestedCount": 3,
"returnedCount": 3,
"unique": true,
"results": [
{
"address": {
"id": "address-id",
"countryCode": "US"
}
}
]
}
}Listet direkte Verwaltungs- oder Postleitzahlkinder eines Landes, einer Region oder Stadt.
Parameter countryErforderlich · query · string ISO 3166-1 alpha-2 country code.
childTypeErforderlich · query · string Child catalog type to return.
parentTypeOptional · query · string · Standard: country Type of parent identified by parentId.
parentIdOptional · query · string Stable region or city ID; omit for a country parent.
qOptional · query · string Optional child-name search text.
residentialOptional · query · boolean · Standard: true Include residential availability and disable uncovered options.
cursorOptional · query · string Opaque cursor returned by the previous page.
limitOptional · query · integer · Standard: 100 · 20-200 Page size from 20 through 200.
Aufrufbeispiele curl python JavaScript
curl "https://address.example/api/v1/locations/hierarchy?country=US&parentType=region&parentId=1416&childType=city&limit=100" \
-H "Authorization: Bearer YOUR_API_TOKEN" \import json
from urllib.request import Request, urlopen
request = Request(
"https://address.example/api/v1/locations/hierarchy?country=US&parentType=region&parentId=1416&childType=city&limit=100",
headers={"Authorization":"Bearer YOUR_API_TOKEN"},
method="GET"
)
with urlopen(request) as response:
print(json.load(response))const response = await fetch("https://address.example/api/v1/locations/hierarchy?country=US&parentType=region&parentId=1416&childType=city&limit=100", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN"
},
});
const payload = await response.json();
console.log(payload);Kopieren Erfolgreiche Antwort {
"data": {
"parent": {
"type": "region",
"id": "1416"
},
"childType": "city",
"children": [
{
"id": "example-city",
"value": "Los Angeles",
"availableCount": 120
}
],
"total": 1,
"nextCursor": null
}
}GET /api/v1/coverage
Berechtigung: read Meldet die drei Abschlussregeln der Synchronisierung fuer aktivierte Laender.
Parameter countryOptional · query · string Optional ISO country code filter.
includeCompleteOptional · query · boolean · Standard: true Include countries that already satisfy all three rules.
Aufrufbeispiele curl python JavaScript
curl "https://address.example/api/v1/coverage?country=US&includeComplete=true" \
-H "Authorization: Bearer YOUR_API_TOKEN" \import json
from urllib.request import Request, urlopen
request = Request(
"https://address.example/api/v1/coverage?country=US&includeComplete=true",
headers={"Authorization":"Bearer YOUR_API_TOKEN"},
method="GET"
)
with urlopen(request) as response:
print(json.load(response))const response = await fetch("https://address.example/api/v1/coverage?country=US&includeComplete=true", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN"
},
});
const payload = await response.json();
console.log(payload);Kopieren Erfolgreiche Antwort {
"data": {
"countries": [
{
"countryCode": "US",
"complete": false,
"rules": {
"total": {
"current": 42000,
"target": 50000,
"met": false
},
"administrativeCoverage": {
"actual": 0.98,
"target": 1,
"met": false
},
"regionalMinimums": {
"actual": 0.95,
"target": 1,
"met": false
}
}
}
]
}
}Ruft eine aktuell veroeffentlichte synchronisierte Adresse anhand ihrer ID ab.
Parameter idErforderlich · path · string Address ID returned by generate or batch generation.
Aufrufbeispiele curl python JavaScript
curl "https://address.example/api/v1/addresses/pool-v2-address-id" \
-H "Authorization: Bearer YOUR_API_TOKEN" \import json
from urllib.request import Request, urlopen
request = Request(
"https://address.example/api/v1/addresses/pool-v2-address-id",
headers={"Authorization":"Bearer YOUR_API_TOKEN"},
method="GET"
)
with urlopen(request) as response:
print(json.load(response))const response = await fetch("https://address.example/api/v1/addresses/pool-v2-address-id", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN"
},
});
const payload = await response.json();
console.log(payload);Kopieren Erfolgreiche Antwort {
"data": {
"address": {
"id": "pool-v2-address-id",
"countryCode": "US",
"formattedAddress": "Example address"
}
}
}Uebersetzt eine synchronisierte Adresse in eine unterstuetzte Anzeigesprache.
Parameter addressIdErforderlich · body · string Address ID returned by generate.
targetLocaleErforderlich · body · string Target display locale.
Aufrufbeispiele curl python JavaScript
curl -X POST "https://address.example/api/v1/address-translation" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"addressId": "address-id",
"targetLocale": "zh-CN"
}'import json
from urllib.request import Request, urlopen
request = Request(
"https://address.example/api/v1/address-translation",
headers={"Authorization":"Bearer YOUR_API_TOKEN","Content-Type":"application/json"},
data=json.dumps({"addressId":"address-id","targetLocale":"zh-CN"}),
method="POST"
)
with urlopen(request) as response:
print(json.load(response))const response = await fetch("https://address.example/api/v1/address-translation", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"addressId": "address-id",
"targetLocale": "zh-CN"
})
});
const payload = await response.json();
console.log(payload);Kopieren Erfolgreiche Antwort {
"data": {
"components": {
"street": "示例街道",
"houseNumber": "20"
},
"lines": [
"示例地址"
],
"singleLine": "示例地址"
}
}GET /api/v1/data-health
Berechtigung: read Meldet den Zustand der synchronisierten Laenderpools und Konfigurationsfehler.
Parameter Keine Anfrageparameter.
Aufrufbeispiele curl python JavaScript
curl "https://address.example/api/v1/data-health" \
-H "Authorization: Bearer YOUR_API_TOKEN" \import json
from urllib.request import Request, urlopen
request = Request(
"https://address.example/api/v1/data-health",
headers={"Authorization":"Bearer YOUR_API_TOKEN"},
method="GET"
)
with urlopen(request) as response:
print(json.load(response))const response = await fetch("https://address.example/api/v1/data-health", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN"
},
});
const payload = await response.json();
console.log(payload);Kopieren Erfolgreiche Antwort {
"data": {
"healthy": true,
"countries": [
{
"code": "US",
"ready": true,
"count": 50000
}
],
"configurationErrors": []
}
}Fehler 400INVALID_REQUEST
401UNAUTHORIZED
404NO_POOL_COVERAGE / ADDRESS_NOT_FOUND
429RATE_LIMITED · Retry-After: 60
500 / 503INTERNAL_ERROR / SERVICE_UNAVAILABLE