Postcodes.io API
Returns UK postcode lookups, nearest postcodes, autocomplete, validation and outcode details with position and administrative areas.
View as Markdown| GET | /postcodesuk/lookup | One UK postcode with its country, region, district, constituency and position. |
| GET | /postcodesuk/reverse | The UK postcodes nearest to a point, closest first. |
| GET | /postcodesuk/autocomplete | UK postcodes that start with the text, such as SW1A 1. |
| GET | /postcodesuk/nearestPostcodes | The UK postcodes nearest to one postcode, closest first, with their distance in metres. |
| GET | /postcodesuk/validPostcode | Whether a postcode is a live UK postcode that Royal Mail delivers to. |
| GET | /postcodesuk/outcode | One outcode, the first half of a postcode such as SW1A, with its position and the districts, wards and constituencies it covers. |
| GET | /postcodesuk/randomPostcode | A random live UK postcode with its position and area. Each call gives a different postcode. |
| GET | /postcodesuk/lookupMany | Several UK postcodes at once, with their area and position. A postcode that is not found has an empty entry. |
| GET | /postcodesuk/places | UK towns, villages and localities found by name, with their county, region and position. |
| GET | /postcodesuk/terminatedPostcode | A UK postcode that Royal Mail no longer delivers to, with the month and year it was terminated and its last position. |
lookup
/v1/postcodesuk/lookupOne UK postcode with its country, region, district, constituency and position.
Parameters
postcodestring required | UK postcode, such as SW1A 1AA. e.g. SW1A 1AA |
tunnelstring | 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. |
proxystring | 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. |
profileIdstring | 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
adminDistrict | string |
constituency | string |
country | string |
distance | number (double) |
latitude | number (double) |
longitude | number (double) |
postcode | string |
region | string |
curl "https://api.hoshime.com/v1/postcodesuk/lookup?postcode=SW1A+1AA" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/postcodesuk/lookup?postcode=SW1A+1AA", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/postcodesuk/lookup?postcode=SW1A+1AA", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "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
/v1/postcodesuk/reverseThe UK postcodes nearest to a point, closest first.
Parameters
latitudestring required | Latitude of the point, such as 51.5072. e.g. 51.5072 |
longitudestring required | Longitude of the point, such as -0.1276. e.g. -0.1276 |
limitinteger | Postcodes to return, from 1 to 100. default 10 |
tunnelstring | 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. |
proxystring | 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. |
profileIdstring | 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
adminDistrict | string |
constituency | string |
country | string |
distance | number (double) |
latitude | number (double) |
longitude | number (double) |
postcode | string |
region | string |
curl "https://api.hoshime.com/v1/postcodesuk/reverse?latitude=51.5072&longitude=-0.1276" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/postcodesuk/reverse?latitude=51.5072&longitude=-0.1276", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/postcodesuk/reverse?latitude=51.5072&longitude=-0.1276", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "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
/v1/postcodesuk/autocompleteUK postcodes that start with the text, such as SW1A 1.
Parameters
querystring required | Start of a postcode, such as SW1A1. e.g. SW1A1 |
tunnelstring | 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. |
proxystring | 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. |
profileIdstring | 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
postcode | string |
curl "https://api.hoshime.com/v1/postcodesuk/autocomplete?query=SW1A1" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/postcodesuk/autocomplete?query=SW1A1", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/postcodesuk/autocomplete?query=SW1A1", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "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
/v1/postcodesuk/nearestPostcodesThe UK postcodes nearest to one postcode, closest first, with their distance in metres.
Parameters
postcodestring required | UK postcode, such as SW1A 1AA. e.g. SW1A 1AA |
limitinteger | Postcodes to return, from 1 to 100. default 10 |
radiusinteger | Search radius in metres, from 1 to 2000. default 1000 |
tunnelstring | 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. |
proxystring | 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. |
profileIdstring | 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
adminDistrict | string |
constituency | string |
country | string |
distance | number (double) |
latitude | number (double) |
longitude | number (double) |
postcode | string |
region | string |
curl "https://api.hoshime.com/v1/postcodesuk/nearestPostcodes?postcode=SW1A+1AA" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/postcodesuk/nearestPostcodes?postcode=SW1A+1AA", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/postcodesuk/nearestPostcodes?postcode=SW1A+1AA", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "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
/v1/postcodesuk/validPostcodeWhether a postcode is a live UK postcode that Royal Mail delivers to.
Parameters
postcodestring required | UK postcode, such as SW1A 1AA. e.g. SW1A 1AA |
tunnelstring | 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. |
proxystring | 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. |
profileIdstring | 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
postcode | string |
valid | boolean |
curl "https://api.hoshime.com/v1/postcodesuk/validPostcode?postcode=SW1A+1AA" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/postcodesuk/validPostcode?postcode=SW1A+1AA", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/postcodesuk/validPostcode?postcode=SW1A+1AA", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "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
/v1/postcodesuk/outcodeOne outcode, the first half of a postcode such as SW1A, with its position and the districts, wards and constituencies it covers.
Parameters
outcodestring required | Outcode, such as SW1A. e.g. SW1A |
tunnelstring | 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. |
proxystring | 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. |
profileIdstring | 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
adminDistricts | string[] |
adminWards | string[] |
country | string |
latitude | number (double) |
longitude | number (double) |
outcode | string |
parishes | string[] |
parliamentaryConstituencies | string[] |
curl "https://api.hoshime.com/v1/postcodesuk/outcode?outcode=SW1A" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/postcodesuk/outcode?outcode=SW1A", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/postcodesuk/outcode?outcode=SW1A", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "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
/v1/postcodesuk/randomPostcodeA random live UK postcode with its position and area. Each call gives a different postcode.
Parameters
tunnelstring | 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. |
proxystring | 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. |
profileIdstring | 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
adminDistrict | string |
constituency | string |
country | string |
distance | number (double) |
latitude | number (double) |
longitude | number (double) |
postcode | string |
region | string |
curl "https://api.hoshime.com/v1/postcodesuk/randomPostcode" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/postcodesuk/randomPostcode", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/postcodesuk/randomPostcode", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "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
/v1/postcodesuk/lookupManySeveral UK postcodes at once, with their area and position. A postcode that is not found has an empty entry.
Parameters
postcodesstring required | Comma-separated UK postcodes, such as SW1A 1AA,M32 0JG (up to 100). e.g. SW1A 1AA,M32 0JG |
tunnelstring | 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. |
proxystring | 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. |
profileIdstring | 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
found | boolean |
postcode | Postcode |
adminDistrict | string |
constituency | string |
country | string |
distance | number (double) |
latitude | number (double) |
longitude | number (double) |
postcode | string |
region | string |
query | string |
curl "https://api.hoshime.com/v1/postcodesuk/lookupMany?postcodes=SW1A+1AA%2CM32+0JG" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/postcodesuk/lookupMany?postcodes=SW1A+1AA%2CM32+0JG", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/postcodesuk/lookupMany?postcodes=SW1A+1AA%2CM32+0JG", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "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
/v1/postcodesuk/placesUK towns, villages and localities found by name, with their county, region and position.
Parameters
querystring required | Name of the place, such as Oxford or Bath. e.g. Oxford |
limitinteger | Places to return, from 1 to 100. default 10 |
tunnelstring | 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. |
proxystring | 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. |
profileIdstring | 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
country | string |
countyUnitary | string |
districtBorough | string |
latitude | number (double) |
localType | string |
longitude | number (double) |
name | string |
outcode | string |
region | string |
curl "https://api.hoshime.com/v1/postcodesuk/places?query=Oxford" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/postcodesuk/places?query=Oxford", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/postcodesuk/places?query=Oxford", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "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
/v1/postcodesuk/terminatedPostcodeA UK postcode that Royal Mail no longer delivers to, with the month and year it was terminated and its last position.
Parameters
postcodestring required | Terminated UK postcode, such as B1 1AA. e.g. B1 1AA |
tunnelstring | 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. |
proxystring | 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. |
profileIdstring | 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
latitude | number (double) |
longitude | number (double) |
monthTerminated | integer (int64) |
postcode | string |
yearTerminated | integer (int64) |
curl "https://api.hoshime.com/v1/postcodesuk/terminatedPostcode?postcode=B1+1AA" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/postcodesuk/terminatedPostcode?postcode=B1+1AA", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/postcodesuk/terminatedPostcode?postcode=B1+1AA", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "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 } }