Search code examples
vb.netgoogle-mapszipcodepostal-code

City, Province/State, Country to Postal Code


I need to programmatically find approximate postal/zip code for a given city. When I use this link:

http://maps.googleapis.com/maps/api/geocode/xmladdress=vancouver,BC,Canada&components=country:CA

it brings me all location information except postal code. Is there a way to get a postal code using only city name?


Solution

  • I have looked around a lot. Ben is right. It is not possible to get postal codes by using only city names. You need full address. However you can get postal code of a coordinate. It requires too many api calls but if you have the coordinates of the city you can get the postal code easily.