Skip to main content

Module api

Module api 

Source
Expand description

The NIPOST Postcode API as plain data: requests to send and responses to decode. Nothing here performs I/O, so it works with any HTTP client.

Assembly and disassembly are not modelled because Postcode does both offline.

Structs§

AdministrativeAddress
Autocomplete
Coordinate
Lookup
Fields above the level granted to the key are None.
NearbyUnit
NearestUnit
RecentHouseAddress
Request
A GET request whose successful response decodes to T.
Reverse
Suggestion

Enums§

ApiError

Constants§

BASE_URL

Functions§

autocomplete
Suggests completions for a partial postcode such as EK 01 A.
lookup
Resolves a postcode. Levels are cumulative from 1 (validity only) to 5, and the API caps the answer at the level granted to the key.
nearby
Lists buildings around a point, nearest first, within 300 m unless radius_m says otherwise. Empty when nothing is in range.
reverse
Finds the postcode of the nearest building, within 25 m unless max_distance_m says otherwise. The API clamps it to 250 m.