Question: I have a PHP script at the moment which allows users to enter a UK postcode.

I was wondering if there was a way I could get their geolocation from the postcode they enter. (Through Google's API or something?)

I have tried <http://code.google.com/apis/maps/documentation/geocoding/index.html> but it requires a full address, whereas I only have a postcode.

Help would be appreciated, thanks :)
Peter

Answer: 
Here is a downloadable database for all UK postcodes with latitude and longitude.

<http://wikileaks.org/wiki/UK_government_database_of_all_1,841,177_post_codes_together_with_precise_geographic_coordinates_and_other_information,_8_Jul_2009>

Here is Step by Step tutorial for Geocoding UK Postcodes with Google Map API

<http://www.tomanthony.co.uk/blog/geocoding-uk-postcodes-with-google-map-api/>
Ordnance Survey's Open CodePoint dataset of postcodes gives you a dataset of all UK mainland postcodes

```
https://www.ordnancesurvey.co.uk/oswebsite/products/code-point-open/index.html

```

You can then convert these to WGS84 Lat/Long using a library like this

```
http://www.jstott.me.uk/phpcoord/

```