Source: ONSPD dataset for matching postcodes to location
In order to get granular detail down to a Ward level a mapping table is required. There are caveats though!
Some tables only provide so much data, postcode, LAD (Local Authority District) code and so on. Most open government data does not rely on names but GSS codes so it’s better to use those as a reference. The dataset required is ONSPD.
The dataset required for this can be found here.
https://geoportal.statistics.gov.uk/datasets/295e076b89b542e497e05632706ab429/about
It’s a chunky file at 1.44GB currently. However, depending on your needs, you may not need all fields, so you can cut the file down.
The file contains
- Postcode
- oa21cd – Output Area
- lsoa21cd – Lower Super Output Area
- msoa21cd – Middle Super Output Area
- wd25cd – Ward code
- lad25cd – Local Authority District code
- ctrycd – Country code
- Plus more
Caveats!
All you get is the codes, no names for what each of the areas are, for example, I know that Kensington and Chelsea has a Local Authority District code of E09000020, but you won’t get that from the ONSPD file, only E09000020. You then need a names file to match the ONSPD data.
You can get the files you need here.
- Local Authority District – Small file
- Wards – 1.5MB, not small, not big
https://geoportal.statistics.gov.uk/
Unfortunately, there is no really easy way to just get one file with all the data you need; if there was, it would be difficult to work with. So not a great, not terrible solution.