← Zurueck zum Generator
OpenAPI 3.1 JSON

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_TOKEN
GET/api/v1/health
Berechtigung: public

Prueft, ob der API-Prozess verfuegbar ist.

Parameter

Keine Anfrageparameter.

Aufrufbeispiele

curl "https://address.example/api/v1/health" \

Erfolgreiche Antwort

{
  "status": "ok"
}
GET/api/v1/ready
Berechtigung: public

Prueft die Einsatzbereitschaft von API und PostgreSQL.

Parameter

Keine Anfrageparameter.

Aufrufbeispiele

curl "https://address.example/api/v1/ready" \

Erfolgreiche Antwort

{
  "status": "ready"
}
GET/api/v1/countries
Berechtigung: read

Listet Laender, Funktionen, Adresszahlen und Schnellzugriffe auf.

Parameter

Keine Anfrageparameter.

Aufrufbeispiele

curl "https://address.example/api/v1/countries" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \

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 "https://address.example/api/v1/availability" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \

Erfolgreiche Antwort

{
  "data": [
    {
      "code": "US",
      "residentialAvailable": true
    }
  ]
}
GET/api/v1/client-context
Berechtigung: read

Ermittelt Land und Standortkontext der Anfrage-IP.

Parameter

ipOptional · query · stringOptional IPv4 or IPv6 address; omitted means the request IP.

Aufrufbeispiele

curl "https://address.example/api/v1/client-context?ip=198.51.100.7" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \

Erfolgreiche Antwort

{
  "data": {
    "country": "US",
    "region": "California",
    "city": "Los Angeles",
    "matchLevel": "city"
  }
}
GET/api/v1/locations/search
Berechtigung: read

Sucht Regionen, Staedte, Bezirke oder Postleitzahlen mit Seitennavigation.

Parameter

countryOptional · query · string · Standard: USISO 3166-1 alpha-2 country code.
fieldOptional · query · string · Standard: cityCatalog field to return.
qOptional · query · stringOptional case-insensitive search text.
regionOptional · query · stringExact parent region value.
regionIdOptional · query · stringStable parent region ID.
cityIdOptional · query · stringStable parent city ID.
residentialOptional · query · boolean · Standard: falseRestrict counts to published residential records.
cursorOptional · query · stringOpaque cursor returned by the previous page.
limitOptional · query · integer · Standard: 100 · 20-200Page size from 20 through 200.

Aufrufbeispiele

curl "https://address.example/api/v1/locations/search?country=US&field=city&regionId=1416&limit=100" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \

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: USISO 3166-1 alpha-2 country code.
regionOptional · query · stringExact first-level region value.
regionIdOptional · query · stringStable region ID from location search.
cityOptional · query · stringExact city value.
cityIdOptional · query · stringStable city ID from location search.
districtOptional · query · stringExact district value where supported.
districtIdOptional · query · stringStable district ID from location search.
postcodeOptional · query · stringExact postcode value.
postcodeIdOptional · query · stringStable postcode ID from location search.
modeOptional · query · stringUse ip-region to match the request or supplied IP.
ipOptional · query · stringIPv4 or IPv6 used with ip-region mode.
qOptional · query · stringText that must occur in the selected address components.
strategyOptional · query · string · Standard: randomSelection strategy; both modes select from the synchronized database.
residentialOptional · query · boolean · Standard: trueLegacy compatibility flag; generation always returns residential records.
seedOptional · query · stringOptional reproducible random seed.
requestIdOptional · query · stringCaller-provided request correlation ID.

Aufrufbeispiele

curl "https://address.example/api/v1/generate?country=US&region=California&requestId=YOUR_REQUEST_ID" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \

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"
      }
    }
  }
}
POST/api/v1/generate/batch
Berechtigung: generate

Erzeugt bis zu 50 Wohnadressen mit strukturierten Filtern, Ausschluessen und Eindeutigkeit.

Parameter

countErforderlich · body · integer · 1-50Number of addresses to generate.
filtersErforderlich · body · objectCountry and exact administrative, postcode, or text filters.
optionsOptional · body · objectRandomness, uniqueness, strategy, and request correlation options.
excludeAddressIdsOptional · body · arrayAddress IDs that must not be returned.

Aufrufbeispiele

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": []
}'

Erfolgreiche Antwort

{
  "data": {
    "requestId": "batch-request-id",
    "requestedCount": 3,
    "returnedCount": 3,
    "unique": true,
    "results": [
      {
        "address": {
          "id": "address-id",
          "countryCode": "US"
        }
      }
    ]
  }
}
GET/api/v1/locations/hierarchy
Berechtigung: read

Listet direkte Verwaltungs- oder Postleitzahlkinder eines Landes, einer Region oder Stadt.

Parameter

countryErforderlich · query · stringISO 3166-1 alpha-2 country code.
childTypeErforderlich · query · stringChild catalog type to return.
parentTypeOptional · query · string · Standard: countryType of parent identified by parentId.
parentIdOptional · query · stringStable region or city ID; omit for a country parent.
qOptional · query · stringOptional child-name search text.
residentialOptional · query · boolean · Standard: trueInclude residential availability and disable uncovered options.
cursorOptional · query · stringOpaque cursor returned by the previous page.
limitOptional · query · integer · Standard: 100 · 20-200Page size from 20 through 200.

Aufrufbeispiele

curl "https://address.example/api/v1/locations/hierarchy?country=US&parentType=region&parentId=1416&childType=city&limit=100" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \

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 · stringOptional ISO country code filter.
includeCompleteOptional · query · boolean · Standard: trueInclude countries that already satisfy all three rules.

Aufrufbeispiele

curl "https://address.example/api/v1/coverage?country=US&includeComplete=true" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \

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
          }
        }
      }
    ]
  }
}
GET/api/v1/addresses/{id}
Berechtigung: read

Ruft eine aktuell veroeffentlichte synchronisierte Adresse anhand ihrer ID ab.

Parameter

idErforderlich · path · stringAddress ID returned by generate or batch generation.

Aufrufbeispiele

curl "https://address.example/api/v1/addresses/pool-v2-address-id" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \

Erfolgreiche Antwort

{
  "data": {
    "address": {
      "id": "pool-v2-address-id",
      "countryCode": "US",
      "formattedAddress": "Example address"
    }
  }
}
POST/api/v1/address-translation
Berechtigung: generate

Uebersetzt eine synchronisierte Adresse in eine unterstuetzte Anzeigesprache.

Parameter

addressIdErforderlich · body · stringAddress ID returned by generate.
targetLocaleErforderlich · body · stringTarget display locale.

Aufrufbeispiele

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"
}'

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 "https://address.example/api/v1/data-health" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \

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