Dennery AgentNative

All API connectors

Postcodes.io: UK postcode lookup

UK postcode lookup from Postcodes.io: coordinates, council area, ward, parliamentary constituency, region and census areas for a postcode, nearest postcodes to a point, and postcode autocomplete.

No API key needed to call

Source
Postcodes.io
Licence and terms
Open Government Licence v3.0 and OS OpenData
Coverage
United Kingdom
Refresh cadence
Answers are shared and cached for 86400 seconds.

Questions you can ask

Operations

UK postcode details

Answers: where is this UK postcode (latitude, longitude) and which council, ward, constituency, region and census areas does it belong to?

postcoderequired, string, UK postcode, for example SW1A 2AA.

Example: Where is postcode SW1A 2AA and which constituency is it in?

Over MCP

{"tool":"call_connector_operation","arguments":{"connector":"postcodes_io","operation":"postcodes_io_lookup","params":{"postcode":"SW1A 2AA"}}}

Over HTTP

curl '/v1/connectors/postcodes_io/postcodes_io_lookup?postcode=SW1A+2AA'

Nearest UK postcodes to a coordinate

Answers: what are the nearest UK postcodes to this latitude and longitude, and which area does the point sit in?

latrequired, number, Latitude in the United Kingdom.
lonrequired, number, Longitude in the United Kingdom.
limitoptional, integer, default 5

Example: What postcodes are near 51.5035, -0.1276 in London?

Over MCP

{"tool":"call_connector_operation","arguments":{"connector":"postcodes_io","operation":"postcodes_io_near_point","params":{"lat":51.5035,"lon":-0.1276,"limit":3}}}

Over HTTP

curl '/v1/connectors/postcodes_io/postcodes_io_near_point?lat=51.5035&lon=-0.1276&limit=3'

Complete a partial UK postcode

Answers: which full UK postcodes start with these characters?

postcoderequired, string, Start of a UK postcode.

Example: Which postcodes start with SW1A 2?

Over MCP

{"tool":"call_connector_operation","arguments":{"connector":"postcodes_io","operation":"postcodes_io_autocomplete","params":{"postcode":"SW1A 2"}}}

Over HTTP

curl '/v1/connectors/postcodes_io/postcodes_io_autocomplete?postcode=SW1A+2'

Source notice

Source: Postcodes.io, built on ONS and Ordnance Survey open data. Terms were not quoted here: see the terms page. Contains OS data (c) Crown copyright and database right, and Royal Mail data under the open licences stated by the service.