← Back to generator
OpenAPI 3.1 JSON

Authentication

All endpoints except health, readiness, and OpenAPI require a Bearer token created in the administrator console. Tokens support read or generate scopes, per-minute limits, and expiry.

Authorization: Bearer YOUR_API_TOKEN
GET/api/v1/health
Scope: public

Check whether the API process is available.

Parameters

No request parameters.

Request examples

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

Successful response

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

Check whether the API and PostgreSQL are ready to serve traffic.

Parameters

No request parameters.

Request examples

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

Successful response

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

List supported countries, capabilities, address counts, and shortcuts.

Parameters

No request parameters.

Request examples

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

Successful response

{
  "data": [
    {
      "code": "US",
      "residentialAvailable": true,
      "residentialCount": 50000,
      "generationMode": "synchronized-pool"
    }
  ]
}
GET/api/v1/availability
Scope: read

Return the lightweight residential availability list.

Parameters

No request parameters.

Request examples

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

Successful response

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

Resolve country and location context for the request IP.

Parameters

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

Request examples

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

Successful response

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

Search regions, cities, districts, or postcodes with pagination.

Parameters

countryOptional · query · string · Default: USISO 3166-1 alpha-2 country code.
fieldOptional · query · string · Default: 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 · Default: falseRestrict counts to published residential records.
cursorOptional · query · stringOpaque cursor returned by the previous page.
limitOptional · query · integer · Default: 100 · 20-200Page size from 20 through 200.

Request examples

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

Successful response

{
  "data": {
    "cities": [
      {
        "id": "example-city",
        "value": "Los Angeles",
        "availableCount": 120
      }
    ],
    "total": 1,
    "nextCursor": null
  }
}
GET/api/v1/generate
Scope: generate

Randomly generate one published residential address and test profile.

Parameters

countryOptional · query · string · Default: 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 · Default: randomSelection strategy; both modes select from the synchronized database.
residentialOptional · query · boolean · Default: trueLegacy compatibility flag; generation always returns residential records.
seedOptional · query · stringOptional reproducible random seed.
requestIdOptional · query · stringCaller-provided request correlation ID.

Request examples

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

Successful response

{
  "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
Scope: generate

Generate up to 50 residential addresses with structured filters, exclusions, and uniqueness control.

Parameters

countRequired · body · integer · 1-50Number of addresses to generate.
filtersRequired · 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.

Request examples

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

Successful response

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

List the immediate administrative or postcode children of a country, region, or city.

Parameters

countryRequired · query · stringISO 3166-1 alpha-2 country code.
childTypeRequired · query · stringChild catalog type to return.
parentTypeOptional · query · string · Default: 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 · Default: trueInclude residential availability and disable uncovered options.
cursorOptional · query · stringOpaque cursor returned by the previous page.
limitOptional · query · integer · Default: 100 · 20-200Page size from 20 through 200.

Request examples

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

Successful response

{
  "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
Scope: read

Report the three synchronization completion rules for enabled countries.

Parameters

countryOptional · query · stringOptional ISO country code filter.
includeCompleteOptional · query · boolean · Default: trueInclude countries that already satisfy all three rules.

Request examples

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

Successful response

{
  "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}
Scope: read

Retrieve a currently published synchronized address by its generated ID.

Parameters

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

Request examples

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

Successful response

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

Translate a synchronized address into a supported display language.

Parameters

addressIdRequired · body · stringAddress ID returned by generate.
targetLocaleRequired · body · stringTarget display locale.

Request examples

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

Successful response

{
  "data": {
    "components": {
      "street": "示例街道",
      "houseNumber": "20"
    },
    "lines": [
      "示例地址"
    ],
    "singleLine": "示例地址"
  }
}
GET/api/v1/data-health
Scope: read

Report per-country synchronized-pool health and configuration errors.

Parameters

No request parameters.

Request examples

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

Successful response

{
  "data": {
    "healthy": true,
    "countries": [
      {
        "code": "US",
        "ready": true,
        "count": 50000
      }
    ],
    "configurationErrors": []
  }
}

Errors

400INVALID_REQUEST
401UNAUTHORIZED
404NO_POOL_COVERAGE / ADDRESS_NOT_FOUND
429RATE_LIMITED · Retry-After: 60
500 / 503INTERNAL_ERROR / SERVICE_UNAVAILABLE