Skip to content

Postcodes.io API

10 endpointsGovernment & Open DataGBsocial:read8 real examples

Returns UK postcode lookups, nearest postcodes, autocomplete, validation and outcode details with position and administrative areas.

View as Markdown
GET/postcodesuk/lookupOne UK postcode with its country, region, district, constituency and position.
GET/postcodesuk/reverseThe UK postcodes nearest to a point, closest first.
GET/postcodesuk/autocompleteUK postcodes that start with the text, such as SW1A 1.
GET/postcodesuk/nearestPostcodesThe UK postcodes nearest to one postcode, closest first, with their distance in metres.
GET/postcodesuk/validPostcodeWhether a postcode is a live UK postcode that Royal Mail delivers to.
GET/postcodesuk/outcodeOne outcode, the first half of a postcode such as SW1A, with its position and the districts, wards and constituencies it covers.
GET/postcodesuk/randomPostcodeA random live UK postcode with its position and area. Each call gives a different postcode.
GET/postcodesuk/lookupManySeveral UK postcodes at once, with their area and position. A postcode that is not found has an empty entry.
GET/postcodesuk/placesUK towns, villages and localities found by name, with their county, region and position.
GET/postcodesuk/terminatedPostcodeA UK postcode that Royal Mail no longer delivers to, with the month and year it was terminated and its last position.

lookup

GET/v1/postcodesuk/lookup

One UK postcode with its country, region, district, constituency and position.

scope social:read1 unitcached 24 h

Parameters

postcode
string
required
UK postcode, such as SW1A 1AA.
e.g. SW1A 1AA
tunnel
string
Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy.
proxy
string
Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it.
profileId
string
Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only.

Response data

8 fields
adminDistrictstring
constituencystring
countrystring
distancenumber (double)
latitudenumber (double)
longitudenumber (double)
postcodestring
regionstring
curl "https://api.hoshime.com/v1/postcodesuk/lookup?postcode=SW1A+1AA" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Real response
{
  "data": {
    "adminDistrict": "Westminster",
    "constituency": "Cities of London and Westminster",
    "country": "England",
    "distance": 0,
    "latitude": 51.50101,
    "longitude": -0.141563,
    "postcode": "SW1A 1AA",
    "region": "London"
  },
  "meta": {
    "cached": false,
    "endpoint": "lookup",
    "fetchedAt": "2026-11-06T09:41:00Z",
    "platform": "postcodesuk",
    "requestId": "req_2Xb9kQ…",
    "units": 1
  }
}

reverse

GET/v1/postcodesuk/reverse

The UK postcodes nearest to a point, closest first.

scope social:read1 unitcached 24 hpaginated

Parameters

latitude
string
required
Latitude of the point, such as 51.5072.
e.g. 51.5072
longitude
string
required
Longitude of the point, such as -0.1276.
e.g. -0.1276
limit
integer
Postcodes to return, from 1 to 100.
default 10
tunnel
string
Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy.
proxy
string
Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it.
profileId
string
Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only.

Response data

8 fields
adminDistrictstring
constituencystring
countrystring
distancenumber (double)
latitudenumber (double)
longitudenumber (double)
postcodestring
regionstring
curl "https://api.hoshime.com/v1/postcodesuk/reverse?latitude=51.5072&longitude=-0.1276" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Real response
{
  "data": [
    {
      "adminDistrict": "Westminster",
      "constituency": "Cities of London and Westminster",
      "country": "England",
      "distance": 35.53060441724964,
      "latitude": 51.506897,
      "longitude": -0.127763,
      "postcode": "SW1A 2DX",
      "region": "London"
    },
    {
      "adminDistrict": "Westminster",
      "constituency": "Cities of London and Westminster",
      "country": "England",
      "distance": 38.48977939463991,
      "latitude": 51.507021,
      "longitude": -0.127124,
      "postcode": "SW1A 2DD",
      "region": "London"
    }
  ],
  "meta": {
    "cached": false,
    "endpoint": "reverse",
    "fetchedAt": "2026-11-06T09:41:00Z",
    "pagination": {
      "nextCursor": "EpcDEgV…",
      "hasMore": true,
      "total": null
    },
    "platform": "postcodesuk",
    "requestId": "req_2Xb9kQ…",
    "units": 1
  }
}

autocomplete

GET/v1/postcodesuk/autocomplete

UK postcodes that start with the text, such as SW1A 1.

scope social:read1 unitcached 24 hpaginated

Parameters

query
string
required
Start of a postcode, such as SW1A1.
e.g. SW1A1
tunnel
string
Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy.
proxy
string
Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it.
profileId
string
Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only.

Response data

1 fields
postcodestring
curl "https://api.hoshime.com/v1/postcodesuk/autocomplete?query=SW1A1" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Real response
{
  "data": [
    {
      "postcode": "SW1A 1AA"
    },
    {
      "postcode": "SW1A 1AB"
    }
  ],
  "meta": {
    "cached": false,
    "endpoint": "autocomplete",
    "fetchedAt": "2026-11-06T09:41:00Z",
    "pagination": {
      "nextCursor": "EpcDEgV…",
      "hasMore": true,
      "total": null
    },
    "platform": "postcodesuk",
    "requestId": "req_2Xb9kQ…",
    "units": 1
  }
}

nearestPostcodes

GET/v1/postcodesuk/nearestPostcodes

The UK postcodes nearest to one postcode, closest first, with their distance in metres.

scope social:read1 unitcached 24 hpaginated

Parameters

postcode
string
required
UK postcode, such as SW1A 1AA.
e.g. SW1A 1AA
limit
integer
Postcodes to return, from 1 to 100.
default 10
radius
integer
Search radius in metres, from 1 to 2000.
default 1000
tunnel
string
Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy.
proxy
string
Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it.
profileId
string
Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only.

Response data

8 fields
adminDistrictstring
constituencystring
countrystring
distancenumber (double)
latitudenumber (double)
longitudenumber (double)
postcodestring
regionstring
curl "https://api.hoshime.com/v1/postcodesuk/nearestPostcodes?postcode=SW1A+1AA" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Real response
{
  "data": [
    {
      "adminDistrict": "Westminster",
      "constituency": "Cities of London and Westminster",
      "country": "England",
      "distance": 0,
      "latitude": 51.50101,
      "longitude": -0.141563,
      "postcode": "SW1A 1AA",
      "region": "London"
    },
    {
      "adminDistrict": "Westminster",
      "constituency": "Cities of London and Westminster",
      "country": "England",
      "distance": 123.67233656624896,
      "latitude": 51.499933,
      "longitude": -0.141117,
      "postcode": "SW1E 6LA",
      "region": "London"
    }
  ],
  "meta": {
    "cached": false,
    "endpoint": "nearestPostcodes",
    "fetchedAt": "2026-11-06T09:41:00Z",
    "pagination": {
      "nextCursor": "EpcDEgV…",
      "hasMore": true,
      "total": null
    },
    "platform": "postcodesuk",
    "requestId": "req_2Xb9kQ…",
    "units": 1
  }
}

validPostcode

GET/v1/postcodesuk/validPostcode

Whether a postcode is a live UK postcode that Royal Mail delivers to.

scope social:read1 unitcached 24 h

Parameters

postcode
string
required
UK postcode, such as SW1A 1AA.
e.g. SW1A 1AA
tunnel
string
Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy.
proxy
string
Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it.
profileId
string
Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only.

Response data

2 fields
postcodestring
validboolean
curl "https://api.hoshime.com/v1/postcodesuk/validPostcode?postcode=SW1A+1AA" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Real response
{
  "data": {
    "postcode": "SW1A 1AA",
    "valid": true
  },
  "meta": {
    "cached": false,
    "endpoint": "validPostcode",
    "fetchedAt": "2026-11-06T09:41:00Z",
    "platform": "postcodesuk",
    "requestId": "req_2Xb9kQ…",
    "units": 1
  }
}

outcode

GET/v1/postcodesuk/outcode

One outcode, the first half of a postcode such as SW1A, with its position and the districts, wards and constituencies it covers.

scope social:read1 unitcached 24 h

Parameters

outcode
string
required
Outcode, such as SW1A.
e.g. SW1A
tunnel
string
Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy.
proxy
string
Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it.
profileId
string
Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only.

Response data

8 fields
adminDistrictsstring[]
adminWardsstring[]
countrystring
latitudenumber (double)
longitudenumber (double)
outcodestring
parishesstring[]
parliamentaryConstituenciesstring[]
curl "https://api.hoshime.com/v1/postcodesuk/outcode?outcode=SW1A" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Real response
{
  "data": {
    "adminDistricts": [
      "Wandsworth",
      "Westminster"
    ],
    "adminWards": [
      "Nine Elms",
      "St James's"
    ],
    "country": "",
    "latitude": 51.50455391034481,
    "longitude": -0.13223425517241374,
    "outcode": "SW1A",
    "parishes": [
      "Wandsworth, unparished area",
      "Westminster, unparished area"
    ],
    "parliamentaryConstituencies": [
      "Battersea",
      "Cities of London and Westminster"
    ]
  },
  "meta": {
    "cached": false,
    "endpoint": "outcode",
    "fetchedAt": "2026-11-06T09:41:00Z",
    "platform": "postcodesuk",
    "requestId": "req_2Xb9kQ…",
    "units": 1
  }
}

randomPostcode

GET/v1/postcodesuk/randomPostcode

A random live UK postcode with its position and area. Each call gives a different postcode.

scope social:read1 unit

Parameters

tunnel
string
Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy.
proxy
string
Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it.
profileId
string
Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only.

Response data

8 fields
adminDistrictstring
constituencystring
countrystring
distancenumber (double)
latitudenumber (double)
longitudenumber (double)
postcodestring
regionstring
curl "https://api.hoshime.com/v1/postcodesuk/randomPostcode" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Real response
{
  "data": {
    "adminDistrict": "Westminster",
    "constituency": "Cities of London and Westminster",
    "country": "England",
    "distance": 0,
    "latitude": 51.51479,
    "longitude": -0.158845,
    "postcode": "W1H 7JE",
    "region": "London"
  },
  "meta": {
    "cached": false,
    "endpoint": "randomPostcode",
    "fetchedAt": "2026-11-06T09:41:00Z",
    "platform": "postcodesuk",
    "requestId": "req_2Xb9kQ…",
    "units": 1
  }
}

lookupMany

GET/v1/postcodesuk/lookupMany

Several UK postcodes at once, with their area and position. A postcode that is not found has an empty entry.

scope social:read1 unitcached 24 hpaginated

Parameters

postcodes
string
required
Comma-separated UK postcodes, such as SW1A 1AA,M32 0JG (up to 100).
e.g. SW1A 1AA,M32 0JG
tunnel
string
Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy.
proxy
string
Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it.
profileId
string
Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only.

Response data

11 fields
foundboolean
postcodePostcode
adminDistrictstring
constituencystring
countrystring
distancenumber (double)
latitudenumber (double)
longitudenumber (double)
postcodestring
regionstring
querystring
curl "https://api.hoshime.com/v1/postcodesuk/lookupMany?postcodes=SW1A+1AA%2CM32+0JG" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Real response
{
  "data": [
    {
      "found": true,
      "postcode": {
        "adminDistrict": "Westminster",
        "constituency": "Cities of London and Westminster",
        "country": "England",
        "distance": 0,
        "latitude": 51.50101,
        "longitude": -0.141563,
        "postcode": "SW1A 1AA",
        "region": "London"
      },
      "query": "SW1A 1AA"
    },
    {
      "found": true,
      "postcode": {
        "adminDistrict": "Trafford",
        "constituency": "Stretford and Urmston",
        "country": "England",
        "distance": 0,
        "latitude": 53.45567,
        "longitude": -2.302837,
        "postcode": "M32 0JG",
        "region": "North West"
      },
      "query": "M32 0JG"
    }
  ],
  "meta": {
    "cached": false,
    "endpoint": "lookupMany",
    "fetchedAt": "2026-11-06T09:41:00Z",
    "pagination": {
      "nextCursor": "EpcDEgV…",
      "hasMore": true,
      "total": null
    },
    "platform": "postcodesuk",
    "requestId": "req_2Xb9kQ…",
    "units": 1
  }
}

places

GET/v1/postcodesuk/places

UK towns, villages and localities found by name, with their county, region and position.

scope social:read1 unitcached 24 hpaginated

Parameters

query
string
required
Name of the place, such as Oxford or Bath.
e.g. Oxford
limit
integer
Places to return, from 1 to 100.
default 10
tunnel
string
Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy.
proxy
string
Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it.
profileId
string
Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only.

Response data

9 fields
countrystring
countyUnitarystring
districtBoroughstring
latitudenumber (double)
localTypestring
longitudenumber (double)
namestring
outcodestring
regionstring
curl "https://api.hoshime.com/v1/postcodesuk/places?query=Oxford" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "data": [
    {
      "country": "…",
      "countyUnitary": "…",
      "districtBorough": "…",
      "latitude": 0,
      "localType": "…",
      "longitude": 0,
      "name": "…",
      "outcode": "…",
      "region": "…"
    }
  ],
  "meta": {
    "cached": false,
    "endpoint": "places",
    "fetchedAt": "2026-11-06T09:41:00Z",
    "pagination": {
      "nextCursor": "EpcDEgV…",
      "hasMore": true,
      "total": null
    },
    "platform": "postcodesuk",
    "requestId": "req_2Xb9kQ…",
    "units": 1
  }
}

terminatedPostcode

GET/v1/postcodesuk/terminatedPostcode

A UK postcode that Royal Mail no longer delivers to, with the month and year it was terminated and its last position.

scope social:read1 unitcached 24 h

Parameters

postcode
string
required
Terminated UK postcode, such as B1 1AA.
e.g. B1 1AA
tunnel
string
Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy.
proxy
string
Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it.
profileId
string
Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only.

Response data

5 fields
latitudenumber (double)
longitudenumber (double)
monthTerminatedinteger (int64)
postcodestring
yearTerminatedinteger (int64)
curl "https://api.hoshime.com/v1/postcodesuk/terminatedPostcode?postcode=B1+1AA" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "data": {
    "latitude": 0,
    "longitude": 0,
    "monthTerminated": 0,
    "postcode": "…",
    "yearTerminated": 0
  },
  "meta": {
    "cached": false,
    "endpoint": "terminatedPostcode",
    "fetchedAt": "2026-11-06T09:41:00Z",
    "platform": "postcodesuk",
    "requestId": "req_2Xb9kQ…",
    "units": 1
  }
}
esc
↑↓ move↵ open