Postcode Tools

Really useful API's for UK postcode data.

Postcode Tools has been created by programmers for programmers who need a fast and accurate resolution of UK postcode data with:

  • competitive pricing
  • solid data
  • fast response times
  • great support

Our baseline data is updated regularly to make sure that as new postcodes come on-line, we have them available.

All our examples are fully working with live data, so if you need a quick lookup, feel free!

Need help?

Get clear answers and advice about using our services. Our team can help you through the process of getting up and running and we can even write a solution for you if that helps.

CONTACT US TODAY

Our API's

Our API's are being added to all the time.
Need something different? Get in touch with the team!

Validate Postcode

Checkes the validity of a postcode and returns the fields shown below

Parameter Value / Description
URL https://api.postcodetools.co.uk/apivalidatepostcode.php
apitoken String (32 chars)
Example: “zpJdkS2jOXvFJoEdPwD39ebaYgMktu3Y”
postcode String (8 chars)
Example: "EC3N 4DR”
Return Value / Description
status JSON encoded status.
result JSON encoded result.
status Value / Description
OK The results have returned OK but that does not mean there is a valid record. Only that there has been no error.
Error There has been an error in processing. Error code and short description will be returned in the result parameter. The table of error codes should be used to interpret the exact reason for failure.
result Value / Description
area The postcode area
district The postcode district
sector The postcode sector
postcode The postcode (formatted correctly)
latitude The postcode latitude
longitude The postcode longitude
northing The postcode northing
easting The postcode easting
altitude The postcode altitude
error codes Value / Description
1000 API token not recognised or malformed
1001 Usage limit exceeded.
1002 No record found.

Working example

Postcode
Get Result

						

Get Postcode Areas from Postcode within radius

Retrieves a list of postcode areas based on the distance of any district (outward code) within the radius rather than the geo-location of the center of that district

Field Value / Description
URL https://api.postcodetools.co.uk/getareasfrompostcoderadius.php
apitoken String (32 chars)
Example: “zpJdkS2jOXvFJoEdPwD39ebaYgMktu3Y”
postcode String (8 chars)
Example: "EC3N 4DR”
distancemin Float
Example: “0” (Must be less than or equal to 'distacemax')
distancemax Float
Example: “40” (Hard limited to 80 miles for Areas)
Return Value / Description
status JSON encoded status.
result JSON encoded result.
status Value / Description
OK The results have returned OK but that does not mean there is a valid record. Only that there has been no error.
Error There has been an error in processing. Error code and short description will be returned in the result parameter. The table of error codes should be used to interpret the exact reason for failure.
result Value / Description
area The postcode area. In this case one or more areas are returned.
error codes Value / Description
1000 API token not recognised or malformed
1001 Usage limit exceeded.
1002 No record found.

Working example

Postcode
Distance Min (miles)
Distance Max (miles)
Get Result

						

Get Postcode Districts (outward codes) from Postcode within radius

Retrieves a list of postcode districts based on the distance of any district within it rather than the geo-location of the center of that district

Field Value / Description
URL https://api.postcodetools.co.uk/getareasfrompostcoderadius.php
apitoken String (32 chars)
Example: “zpJdkS2jOXvFJoEdPwD39ebaYgMktu3Y”
postcode String (8 chars)
Example: "EC3N 4DR”
distancemin Float
Example: “0” (Must be less than or equal to 'distacemax')
distancemax Float
Example: “20” (Hard limited to 40 miles for Districts)
Return Value / Description
status JSON encoded status.
result JSON encoded result.
status Value / Description
OK The results have returned OK but that does not mean there is a valid record. Only that there has been no error.
Error There has been an error in processing. Error code and short description will be returned in the result parameter. The table of error codes should be used to interpret the exact reason for failure.
result Value / Description
area The postcode area. In this case one or more areas are returned.
error codes Value / Description
1000 API token not recognised or malformed
1001 Usage limit exceeded.
1002 No record found.

Working example

Postcode
Distance Min (miles)
Distance Max (miles)
Get Result

						

Get Postcode Sectors from Postcode within radius

Retrieves a list of postcode sectors based on their inclusion in a district (outward code) within the given radius

Field Value / Description
URL https://api.postcodetools.co.uk/getsectorsfrompostcoderadius.php
apitoken String (32 chars)
Example: “zpJdkS2jOXvFJoEdPwD39ebaYgMktu3Y”
postcode String (8 chars)
Example: "EC3N 4DR”
distancemin Float
Example: “0” (Must be less than or equal to 'distacemax')
distancemax Float
Example: “10” (Hard limited to 20 miles for Districts)
Return Value / Description
status JSON encoded status.
result JSON encoded result.
status Value / Description
OK The results have returned OK but that does not mean there is a valid record. Only that there has been no error.
Error There has been an error in processing. Error code and short description will be returned in the result parameter. The table of error codes should be used to interpret the exact reason for failure.
result Value / Description
area The postcode area. In this case one or more areas are returned.
error codes Value / Description
1000 API token not recognised or malformed
1001 Usage limit exceeded.
1002 No record found.

Working example

Postcode
Distance Min (miles)
Distance Max (miles)
Get Result

						

Get Postcodes from Postcode within radius

Retrieves a list of postcodes based on their geo-location within the given radius

Field Value / Description
URL https://api.postcodetools.co.uk/getpostcodesfrompostcoderadius.php
apitoken String (32 chars)
Example: “zpJdkS2jOXvFJoEdPwD39ebaYgMktu3Y”
postcode String (8 chars)
Example: "EC3N 4DR”
distancemin Float
Example: “0” (Must be less than or equal to 'distacemax')
distancemax Float
Example: “2.5” (Hard limited to 5 miles for Postcodes)
Return Value / Description
status JSON encoded status.
result JSON encoded result.
status Value / Description
OK The results have returned OK but that does not mean there is a valid record. Only that there has been no error.
Error There has been an error in processing. Error code and short description will be returned in the result parameter. The table of error codes should be used to interpret the exact reason for failure.
result Value / Description
area The postcode area. In this case one or more areas are returned.
error codes Value / Description
1000 API token not recognised or malformed
1001 Usage limit exceeded.
1002 No record found.

Working example

Postcode
Distance Min (miles)
Distance Max (miles)
Get Result

						

Get Postcode Areas from latitude and longitude within radius

Retrieves a list of postcode areas based on the distance of any district (outward code) within the radius rather than the geo-location of the center of that district

Field Value / Description
URL https://api.postcodetools.co.uk/getareasfromlatlongradius.php
apitoken String (32 chars)
Example: “zpJdkS2jOXvFJoEdPwD39ebaYgMktu3Y”
latitude Float
Example: “51.7932994”
longitude Float
Example: “-0.6655884”
distancemin Float
Example: “0” (Must be less than or equal to 'distacemax')
distancemax Float
Example: “40” (Hard limited to 80 miles for Areas)
Return Value / Description
status JSON encoded status.
result JSON encoded result.
status Value / Description
OK The results have returned OK but that does not mean there is a valid record. Only that there has been no error.
Error There has been an error in processing. Error code and short description will be returned in the result parameter. The table of error codes should be used to interpret the exact reason for failure.
result Value / Description
area The postcode area. In this case one or more areas are returned.
error codes Value / Description
1000 API token not recognised or malformed
1001 Usage limit exceeded.
1002 No record found.

Working example

Latitude
Longitude
Distance Min (miles)
Distance Max (miles)
Get Result

						

Get Postcode Districts (outward codes) from latitude and longitude within radius

Retrieves a list of postcode districts based on the distance of any district within it rather than the geo-location of the center of that district

Field Value / Description
URL https://api.postcodetools.co.uk/getdistrictsfromlatlongradius.php
apitoken String (32 chars)
Example: “zpJdkS2jOXvFJoEdPwD39ebaYgMktu3Y”
latitude Float
Example: “51.7932994”
longitude Float
Example: “-0.6655884”
distancemin Float
Example: “0” (Must be less than or equal to 'distacemax')
distancemax Float
Example: “20” (Hard limited to 40 miles for Districts)
Return Value / Description
status JSON encoded status.
result JSON encoded result.
status Value / Description
OK The results have returned OK but that does not mean there is a valid record. Only that there has been no error.
Error There has been an error in processing. Error code and short description will be returned in the result parameter. The table of error codes should be used to interpret the exact reason for failure.
result Value / Description
district The postcode district. In this case one or more districts are returned.
latitude The postcode latitude
longitude The postcode longitude
error codes Value / Description
1000 API token not recognised or malformed
1001 Usage limit exceeded.
1002 No record found.

Working example

Latitude
Longitude
Distance Min (miles)
Distance Max (miles)
Get Result

						

Get Postcode Sectors from latitude and longitude within radius

Retrieves a list of postcode sectors based on their inclusion in a district (outward code) within the given radius

Field Value / Description
URL https://api.postcodetools.co.uk/getsectorsfromlatlongradius.php
apitoken String (32 chars)
Example: “zpJdkS2jOXvFJoEdPwD39ebaYgMktu3Y”
latitude Float
Example: “51.7932994”
longitude Float
Example: “-0.6655884”
distancemin Float
Example: “0” (Must be less than or equal to 'distacemax')
distancemax Float
Example: “10” (Hard limited to 20 miles for Sectors)
status Value / Description
OK The results have returned OK but that does not mean there is a valid record. Only that there has been no error.
Error There has been an error in processing. Error code and short description will be returned in the result parameter. The table of error codes should be used to interpret the exact reason for failure.
result Value / Description
sector The postcode sector. In this case one or more sectors are returned.
error codes Value / Description
1000 API token not recognised or malformed
1001 Usage limit exceeded.
1002 No record found.

Working example

Latitude
Longitude
Distance Min (miles)
Distance Max (miles)
Get Result

						

Get Postcodes from latitude and longitude within radius

Retrieves a list of postcodes based on their geo-location within the given radius

Field Value / Description
URL https://api.postcodetools.co.uk/getpostcodesfromlatlongradius.php
apitoken String (32 chars)
Example: “zpJdkS2jOXvFJoEdPwD39ebaYgMktu3Y”
latitude Float
Example: “51.7932994”
longitude Float
Example: “-0.6655884”
distancemin Float
Example: “0” (Must be less than or equal to 'distacemax')
distancemax Float
Example: “2.5” (Hard limited to 5 miles for postcodes)
status Value / Description
OK The results have returned OK but that does not mean there is a valid record. Only that there has been no error.
Error There has been an error in processing. Error code and short description will be returned in the result parameter. The table of error codes should be used to interpret the exact reason for failure.
result Value / Description
postcode The postcode. In this case one or more postcodes are returned.
error codes Value / Description
1000 API token not recognised or malformed
1001 Usage limit exceeded.
1002 No record found.

Working example

Latitude
Longitude
Distance Min (miles)
Distance Max (miles)
Get Result

						

About us

Postcode Tools are a small group of developers making useful tools for other developers.
We have a simple approach; make it easy, make it professional, make it work.

Get in touch

support@postcodetools.co.uk