Sarita
Sarita

Reputation: 21

Google Map API get address information by postal code, but it response result by street number

I am using google map api to get address information by Postal code around the world [ not specific country].

https://maps.googleapis.com/maps/api/geocode/json?address=610&key=[apiKey]

I expected zip code is 610, but google response result for street number 610.

Is there any ways to get address by zip code only?

Thank you guys in advance for supporting.

Upvotes: 0

Views: 16631

Answers (1)

keysl
keysl

Reputation: 2167

How about something along with this query

https://maps.googleapis.com/maps/api/geocode/json?components=postal_code:1441|country:PH&key=YOUR_API_KEY

This will get you the address kind of this format http://prntscr.com/ouwlq5

Key note here is the country. You need both of the postal_code and the country to make this work. Without country you'll get zero results.

Upvotes: 3

Related Questions