Postcodes.io

Find Nearest UK Postcodes

Returns the closest postcodes to a latitude and longitude.

Unverified

What the model is told

Find the UK postcodes nearest to a point, for example to turn a location into an address area. Returns up to three postcodes with their town, district and region, closest first. Only works for places in the UK.

Request

GEThttps://api.postcodes.io/postcodes?lon={{longitude}}&lat={{latitude}}&limit=3

Headers

None.

Parameters

  • latitude numberLatitude in decimal degrees.
  • longitude numberLongitude in decimal degrees.

Try this tool

This runs in your browser and calls Postcodes.io directly. Nothing goes through our servers.

Parameters
Latitude in decimal degrees.
Longitude in decimal degrees.

Engage payload

{
  "source": "VOICE_AI",
  "tool": {
    "id": "18060f03-b68d-40c6-a8b6-f3d3fefbb0bc",
    "type": "HTTP_REQUEST",
    "label": "Find Nearest UK Postcodes",
    "name": "find_nearest_uk_postcodes",
    "customName": false,
    "description": "Find the UK postcodes nearest to a point, for example to turn a location into an address area. Returns up to three postcodes with their town, district and region, closest first. Only works for places in the UK.",
    "parameters": [
      {
        "name": "latitude",
        "type": "number",
        "description": "Latitude in decimal degrees."
      },
      {
        "name": "longitude",
        "type": "number",
        "description": "Longitude in decimal degrees."
      }
    ],
    "config": {
      "endpoint": {
        "method": "GET",
        "url": "https://api.postcodes.io/postcodes?lon={{longitude}}&lat={{latitude}}&limit=3"
      },
      "headers": [],
      "body": null,
      "timeout": null
    }
  }
}

IDs are regenerated on every copy.