0
votes

I need to query google maps to find information about a postal code. I need to know where in the world this postal code can be found. For exemple, if i want information about the postal code 75001, i expect to receive at least these results:

  • Addison, TX 75001, USA
  • 75001 Paris, France

If i query google maps by specifying the country code, we can cleary see that the postal code exist in the USA and in France:

If i query google maps by omitting the country code, it only return the USA address:

Why it doesn't return the one from France?

1

1 Answers

0
votes

I tried it using different postal code like this 272012, and it give me two locations, one from China and one from Singapore.

https://maps.googleapis.com/maps/api/geocode/json?components=postal_code:272012&sensor=false

And if I specified the country like CN or SG it give me only exact answer.

https://maps.googleapis.com/maps/api/geocode/json?components=postal_code:272012|country:SG&sensor=false

So I don't have any idea what is the problem with that postal code.

Try to check this SO question if it can help you.