Get address details

Get address information based on the provided autocomplete context. The context must have the precision `address`. A HTTP status 400 response is given when the provided context does not resolve to a single address.

This method is intended to provide address information using the result context from the autocomplete method. The result of this method can be used to complete an address in an order form for example.

Required session header

Both the autocomplete and getDetails methods require a custom HTTP header named X-Autocomplete-Session to be specified. Its value should identify a single address completion session (for example, a user filling out one checkout address) and remain the same for calls to both methods.

The X-Autocomplete-Session HTTP session header should be at least 8 characters and at most 64 characters long. The value must only contain alphanumeric characters (case insensitive), "-", "_" and/or ".".

Reusing the same session identifier for completing more than one address is not recommended as it may lead to increased costs for your account.

Country specific data

Countries have different address information and administrative regions, any country specific information can be found in the "details" property. The data provided per country can be found here:

URL template

The REST API requires GET requests. Parameters are added to the REST resource URL, and each parameter must be URL-encoded:

https://api.postcode.eu/international/v1/address/{context}/{dispatchCountry}

Example REST request

Retrieving /international/v1/address/bel6SVBbpsiriOTHIBOu9LISmTCTzVymIt8qTaveozBbMHLPzZPhaKDwTsP3z64fhxMDVxyuquqSVebBGFPdvNlruQet2oZxo8fuKEwzv1rDfBNRHcZwLxThfR9rovJwW7Yqu2Gu0ZPFHobgkC56R with the proper authentication would use the following HTTP Request:

GET /international/v1/address/bel6SVBbpsiriOTHIBOu9LISmTCTzVymIt8qTaveozBbMHLPzZPhaKDwTsP3z64fhxMDVxyuquqSVebBGFPdvNlruQet2oZxo8fuKEwzv1rDfBNRHcZwLxThfR9rovJwW7Yqu2Gu0ZPFHobgkC56R HTTP/1.1
Host: api.postcode.eu
Authorization: Basic 2eTpkU******…
X-Autocomplete-Session: f60c42561f8f5a6d7cc

Example response

The lookup is successful so we receive a 200 OK status in the headers:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

And a JSON response in the body:

{
    "language": "nl-BE",
    "address": {
        "country": "Belgium",
        "locality": "Antwerpen",
        "street": "Steenstraat",
        "postcode": "2180",
        "building": "1 bus 3",
        "buildingNumber": 1,
        "buildingNumberAddition": "bus 3"
    },
    "mailLines": [
        "Steenstraat 1 bus 3",
        "2180 Antwerpen"
    ],
    "location": {
        "longitude": 4.4173496469527205,
        "latitude": 51.277946183550426
    },
    "isPoBox": false,
    "country": {
        "name": "Belgium",
        "iso3Code": "BEL"
    },
    "details": {
        "belRegion": {
            "nisCode": 2000,
            "primaryName": "Vlaanderen",
            "nlName": "Vlaanderen",
            "frName": "Flandre",
            "deName": "Flandern",
        },
        "belProvince": {
            "nisCode": 10000,
            "primaryName": "Antwerpen",
            "nlName": "Antwerpen",
            "frName": "Anvers",
            "deName": "Antwerpen",
        },
        "belDistrict": {
            "nisCode": 11000,
            "primaryName": "Antwerpen",
            "nlName": "Antwerpen",
            "frName": "Anvers",
            "deName": "Antwerpen",
        },
        "belMunicipality": {
            "nisCode": 11002,
            "primaryName": "Antwerpen",
            "nlName": "Antwerpen",
            "frName": "Anvers",
            "deName": "Antwerpen",
            "officialLanguages": [
                "nl"
            ]
        },
        "belStreet": {
            "primaryName": "Steenstraat",
            "nlName": "Steenstraat",
            "frName": null,
            "deName": null
        },
        "belBuilding": {
            "number": 1,
            "bisNumber": null,
            "boxNumber": "3",
            "validated": true
        }
    }
}

Parameters

context: string

Context with precision address to get detailed address information.

dispatchCountry: string or null

Dispatching country ISO3 code, used to determine country address line presence. If not given, country is not added in mailLines.

Returns

language: string

Language of the matched address, derived from context or falls back to default.

address: struct

Address information for the contexts address.

Hide child parameters
country: string

Country name of the of postal address in English.

locality: string

Name of primary locality used in postal address.

street: string

Name of primary street used in postal address.

postcode: string

Postcode used in postal address.

building: string

Number and possible addition of the building in the postal address.

buildingNumber: int or null

Building number of the postal address. Or null if not available.

buildingNumberAddition: string or null

Building number addition of the postal address, if available.

mailLines: string[]

List of address lines as they should appear in an address space. The country name is included when a dispatchCountry parameter is provided which does not correspond with the address country.

location: struct

WGS-84 coordinates for the address if available, null otherwise.

Hide child parameters
latitude: double

Latitude coordinate.

longitude: double

Longitude coordinate.

isPoBox: boolean

Indicates if the address is a Post Office box

country: struct

Country information

Hide child parameters
name: string

The country name

iso3Code: string

The ISO 3166-1 Alpha-3 code for the country

details: struct

Country specific details about the address. The available details differ per country but can contain such things as country specific identifiers, official street name translations, administrative regions and an indication whether the full house number could be validated.