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.
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.
Also try here for UK. http://www.freemaptools.com/download-uk-postcode-lat-lng.htm
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.
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
Here is the list in csv
https://raw.githubusercontent.com/Gibbs/uk-postcodes/master/postcodes.csv
More details : https://github.com/Gibbs/uk-postcodes
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")