Function Repository Resource:

UKPostcodeLookup

Source Notebook

Find information associated with a UK postcode

Contributed by: Jon McLoone

ResourceFunction["UKPostcodeLookup"][postcode]

returns information on the given UK postcode.

ResourceFunction["UKPostcodeLookup"][geoposition]

returns information on the UK postcode nearest to geoposition.

ResourceFunction["UKPostcodeLookup"][{location1,location2,}]

returns information on all the given postcodes or geopositions.

ResourceFunction["UKPostcodeLookup"][postcode,property]

returns only the given property for the given postcode.

Details

ResourceFunction["UKPostcodeLookup"] also accepts geographic entities.

Examples

Basic Examples (1) 

Look up a postcode:

In[1]:=
ResourceFunction["UKPostcodeLookup"]["OX29 8FD"]
Out[1]=

Scope (3) 

Find a specific property of a given postcode:

In[2]:=
ResourceFunction["UKPostcodeLookup"]["OX29 8FD", "Location"]
Out[2]=
In[3]:=
GeoGraphics[%, GeoRange -> Quantity[100, "Meters"]]
Out[3]=

You can look up information from the GeoPosition:

In[4]:=
ResourceFunction["UKPostcodeLookup"][
 GeoPosition[{51.825508`, -1.366991`}], "Postcode"]
Out[4]=

Look up post codes for a geographic entity:

In[5]:=
ResourceFunction["UKPostcodeLookup"][
 Entity["Building", "WestminsterAbbey::nywh9"], "Postcode"]
Out[5]=

Providing a list of postcodes is more efficient than making separate requests:

In[6]:=
ResourceFunction[
 "UKPostcodeLookup"][{"OX29 8FD", "OX29 8SJ", "OX29 8LD", "OX29 8SA", "OX29 8LR"}, "Location"]
Out[6]=

Publisher

Jon McLoone

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 2.0.1 – 03 April 2023
  • 2.0.0 – 06 February 2020
  • 1.0.0 – 20 December 2018

Related Resources

License Information