U.K. sites that require addresses often ask the user to provide a postcode. The site then offers the user a choice between the different addresses that match that postcode.
How can I match a postcode to a street address?
U.K. sites that require addresses often ask the user to provide a postcode. The site then offers the user a choice between the different addresses that match that postcode.
How can I match a postcode to a street address?
Quick comparison:
To do this you need access to the Postcode Address File - this is something that is licensed for use on an annual basis from the post-office, usually via a third party.
You have a choice depending on your needs of buying a package to use locally or of using web services.
The Royal Mail's page is here: http://www.royalmail.com/portal/rm/jump2?mediaId=400085&catId=400084 and on that page are links to service providers.
The only way to do it officially up to now has been to buy the Postcode Address File however there was a news item recently that the data may be free in 2010 so depends if you can wait!
Postcode Anywhere is one of the providers out there (one of my clients uses them with no complaints). Licensing is flexible: Postcode Anywhere UK Address Finder
To add to the answers already coming through:
In the paid for products typically you pay for either:
premise level - more detailed and can offer the user a list of premises at that postcode location
street level - simply matches the street at that postcode location - you or your user fills in "the first line of the address" usually house name or number
I believe this differentiation is built into the licencing by the Royal Mail at source. Premise level is substantially more expensive
Contrary to the answers here, you do NOT need the very expensive PAF from the Post Office. There are a number of commercial services (presumably powered by the PAF) that return the streets and street numbers for a specified post code. They generally charged on a per-request basis. I do not have any experience with a particular vendor, but this is an example - capscan
If you're adding it into a website shopping cart or similar system, you can buy access to the data on a per-click basis. If you're using it for an internal system such as CRM, you need to buy a per-user license.
Either way, you can use the Data8 Postcode Lookup API via web services.
If you want to get the approximate address for a UK postcode (i.e. street level) there is a way you can do it legally and for free without using PAF data.
As an example of this take a look at this XML Web Service:
http://geo.jamiethompson.co.uk/W127RJ.xml
explained at:
http://jamiethompson.co.uk/projects/2010/04/30/an-open-free-uk-postcode-geocoding-web-service/
which returns:
<result>
<status>200</status>
<message/>
<postcode>W12 7RJ</postcode>
<geo>
<os_x>523180</os_x>
<os_y>180541</os_y>
<lat>51.510379</lat>
<lng>-0.226376</lng>
<landranger>TQ231805</landranger>
<accuracy>1</accuracy>
<key>UO1NV-4UO8</key>
</geo>
<address>
<street>White City Close</street>
<locality>Hammersmith</locality>
<district>Hammersmith</district>
<county>Greater London</county>
</address>
It's not as handy as the commercial offerings which give you a full list of actual addresses for any given postcode, but it lets you do a "What's your postcode? What's your house number?" type system.
I believe you need the Royal Mail Postcode Address File. From that link:
Services do exist to handle requests for this info, such that it may be cheaper to use such services for small numbers of requests (obviously you have issues as and when such services aren't available for whatever reasons).