If you're in the UK, the only way to do this effectively with the Google Maps API is to write it in javascript due to Google’s limit on the number of API calls per day from a single IP address.
If your solution will be under moderate pressure, you can look at a solution that uses the PAF UK Royal Mail file. One of these services with which I integrated my work is Postcode Anywhere (www.postcodeanywhere.com). They have a great API, available in a variety of formats ... it was the easiest integration I've done lately.
source share