23

Where can I find a list of all UK full postcodes including street name and their precise coordinates? They should be not like AB1, AB23 etc but AB1 2AA, AB23 5ZZ etc.

Preferably for free :)

Thanks

  • 3
    I'm pretty sure someone got shut down the other week for providing post-code data without royal mail's permission, they're right rude-words about it! – Ed James Oct 08 '09 at 16:18
  • You cannot get it for free. Although you can buy it from here: https://www.royalmail.com/business/services/marketing/data-optimisation/paf remember there are multiple address lookup providers and very few who actually sell PAF file dumps. – Lonare Sep 05 '19 at 13:28

8 Answers8

27

You can now get postcode data for free from the Ordnance Survey https://www.ordnancesurvey.co.uk/business-and-government/products/code-point-open.html This doesn't come with street names though

If you want the data converted to lat/long then you can grab it from my site http://www.doogal.co.uk/UKPostcodes.php

Jason
  • 779
  • 1
  • 9
  • 30
Doogal
  • 1,637
  • 2
  • 18
  • 22
4

You can download the entire GB postcode data complete with Lat and Long values from here completely free:

http://download.geonames.org/export/dump/

Simply scroll down to GB.zip There are also other countries postcode info, I have used Germany and Poland data and they are also OK.

03Usr
  • 3,335
  • 6
  • 37
  • 63
3

Also try here for UK. http://www.freemaptools.com/download-uk-postcode-lat-lng.htm

macycron
  • 91
  • 3
3

As part of a freelance project in PyQt I've written an algorithm to get user input of postcode and return the street name for it. For anyone who's looking for an alternative to commercial systems, open-source and straightforward approach to this issue can use it freely.

I've written it in Python2.7 but can easily be replicated in the newer versions or in other languages.

import urllib
from urllib2 import urlopen
import json

try:
    google_map_key = raw_input("please enter your google maps api key: ")
    postcode = raw_input("Please enter a UK Postcode: ")
    postcode = postcode.replace(" ", "")
    url = "https://maps.googleapis.com/maps/api/geocode/json?address="+postcode+"&key="+google_map_key
    response = urlopen(url)
    json_obj = json.load(response)
    counter = 0
    if json_obj['status'] == 'OK':
        for i in json_obj['results']:
            for x in i['address_components']:
                counter += 1
                if counter == 2:
                    print ("Long street name: " + x['long_name'])
                    break
    else:
        print("No results found! Please enter a valid postcode or check your internet connection and google api key")

except:
    print("Unhandle exception")
Laurel
  • 5,965
  • 14
  • 31
  • 57
Murat Sert
  • 31
  • 1
2

Unfortunately this is something you have to pay for, and it's not particularly cheap! There's an online petition to get this information freed if you are interested.

Commercial wise, just do a Google for uk postcode database and take your pick, they are all much of a muchness.

Steven Robbins
  • 26,441
  • 7
  • 76
  • 90
2

The Royal Mail is the supplier of the 'official' Post Code database for the UK - they own the postcodes and postcode to GIS mapping. It's copyrighted and has some significant license fees.

Postzon is the product they sell to link the postcodes to the GIS co-ordinates.

There have been third party providers from outside europe who released details in the past for a fraction of the costs, but it's a very grey area, and you are then in consult a lawyer territory.

Andrew
  • 26,629
  • 5
  • 63
  • 86
2

Here is the list in csv

https://raw.githubusercontent.com/Gibbs/uk-postcodes/master/postcodes.csv

More details : https://github.com/Gibbs/uk-postcodes

Amjith
  • 445
  • 5
  • 15
2

The OS "free" version is useful, but it does have a few limitations, for example no data for Northern Ireland, the Isle of Man, Guernsey or Jersey.

I vote for Doogal's version with the extra latitude and longitude data, which is more useful for geo-mapping like OpenLayer.

Keith MacDonald
  • 218
  • 2
  • 7