You might want to check out the Open Street Map data here (crowdsourced maps)

CloudMade has a Geolocation API that can return a polygon bounding box for a postcode – indeed looking up GU22 7DT returns exactly that.

Details here http://developers.cloudmade.com/wiki/geocoding-http-api/Find_by_postcode

So you’d get back

{“found”: 1, “type”: “FeatureCollection”, “features”: [{“properties”: {“name”: “GU22 7”}, “centroid”: {“type”: “POINT”, “coordinates”: [51.31415, -0.55306]}, “geometry”: {“type”: “POLYGON”, “coordinates”: [[[51.32207, -0.55709], [51.32152, -0.55067], [51.31999, -0.55045], [51.31146, -0.53247], [51.31112, -0.53228], [51.31079, -0.53463], [51.30639, -0.55158], [51.30992, -0.55488], [51.31069, -0.55886], [51.3086, -0.56763], [51.31391, -0.56872], [51.31505, -0.56526], [51.32185, -0.56727], [51.32159, -0.5613], [51.31599, -0.56171], [51.31674, -0.55952], [51.32181, -0.55839], [51.32207, -0.55709]]]}, “type”: “Feature”, “id”: 21676700, “bounds”: [[51.30639, -0.56872], [51.32207, -0.53228]]}], “bounds”: [[51.30639, -0.56872], [51.32207, -0.53228]], “crs”: {“type”: “EPSG”, “properties”: {“code”: 4326, “coordinate_order”: [1, 0]}}}