Zipcode from City name

4,669 views
Skip to first unread message

Adil Malik

unread,
Nov 25, 2011, 11:37:19 AM11/25/11
to google-map...@googlegroups.com
Hi,
I want to get a person's Zip code. I know there City name and Country. Is there any API for this?
I googled it first and all APIs that I found are for "Get City and State by Zip code" and not vice versa ..
Can anyone help please?
Thanks

Adil Malik

Marcelo

unread,
Nov 26, 2011, 10:49:07 AM11/26/11
to Google Maps JavaScript API v3
On Nov 25, 9:37 am, Adil Malik <adi.shou...@gmail.com> wrote:
> Hi,
> I want to get a person's Zip code. I know there City name and Country. Is
> there any API for this?

Not that I know of, but the Google Maps API has a geocoding service
that you can use, provided you display the obtained data in a publicly
accessible map.

A city has many zip codes, but if you geocode the city name
http://maps.googleapis.com/maps/api/geocode/json?address=chicago&sensor=false

and then reverse geocode the obtained lat/lon
http://maps.googleapis.com/maps/api/geocode/json?sensor=false&latlng=41.87811360,-87.62979820

then you get *some* zip code, but not necessarily the one of the
person.

--
Marcelo - http://maps.forum.nu
--

davie strachan

unread,
Nov 26, 2011, 4:24:46 PM11/26/11
to Google Maps JavaScript API v3
Hi

The latest zipcode database for usa can be found here
http://federalgovernmentzipcodes.us/

This may be of use instead of reverse geocoding

Regars Davie


On Nov 26, 3:49 pm, <marcelo...@hotmail.com> wrote:
> On Nov 25, 9:37 am, Adil Malik <adi.shou...@gmail.com> wrote:
>
> > Hi,
> > I want to get a person's Zip code. I know there City name and Country. Is
> > there any API for this?
>
> Not that I know of, but the Google Maps API has a geocoding service
> that you can use, provided you display the obtained data in a publicly
> accessible map.
>

> A city has many zip codes, but if you geocode the city namehttp://maps.googleapis.com/maps/api/geocode/json?address=chicago&sens...
>
> and then reverse geocode the obtained lat/lonhttp://maps.googleapis.com/maps/api/geocode/json?sensor=false&latlng=...


>
> then you get *some* zip code, but not necessarily the one of the
> person.
>
> --

> Marcelo -http://maps.forum.nu

Reply all
Reply to author
Forward
0 new messages