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.
The REST API requires GET requests. Parameters are added to the REST resource URL, and each parameter must be URL-encoded:
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******…
The lookup is successful so we receive a 200 OK status in the headers, and json encoded data in the response body:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Content-Length: 78
Either a postcode or a municipality name. A municipality name may be partial or contain spelling errors.
- Array of arrays
An array of matching postal areas
The municipality name.
Identifier for the matched municipality. This is the first parameter of the completeStreet method.
The postcode. Null for matches on municipality name. This is the second parameter of the completeStreet method.
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.