Belgium - Autocomplete a postal area
Get a list of postal areas matching the specified municipality name or postcode. A municipality identifier is returned for every match. This identifier can be used as a parameter to the completeStreet method.
In case of a postcode match the postcode is also returned. It should be used as an additional parameter to the completeStreet method in order to narrow down the intended postal area.
We suggest presenting matches to end users in a format similar to: 'postcode municipalityName (matchedName)', where postcode and matchedName are optional depending on the match.
Please note that some postcodes exist in more than one municipality. An example is postcode 1030, occurring in both Brussel en Schaarbeek.
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
Example REST request
Retrieving /be/v1/autocomplete/postal-area/2610 with the proper authentication would use the following HTTP Request:
GET /be/v1/autocomplete/postal-area/2610 HTTP/1.1 Host: api.postcode.eu Authorization: Basic 2eTpkU******…
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:
[ { "municipalityName": "Antwerpen", "municipalityNisCode": 11002, "postcode": 2610 } ]
Parameters
-
postalArea:
string
-
Either a postcode or a municipality name. A municipality name may be partial or contain spelling errors.
Returns
- Array of arrays
-
An array of matching postal areas
-
municipalityName:
string
-
The municipality name.
-
municipalityNisCode:
int
-
Identifier for the matched municipality. This is the first parameter of the completeStreet method.
-
postcode:
int or null
-
The postcode, null for matches on municipality name. A postcode may occur in more than one municipality. This is the second parameter of the completeStreet method.
-
matchedName:
string or null
-
The matched name, may be null. If a postcode was found based on the name of the postcode district, this contains the district's name.
-
municipalityName: