Fetching sub localities through a zip code

27 Views Asked by At

How can I fetch sub localities or sub sub localities through geocoding API by passing zip code of that area? Currently I am only getiing postal_localities.

I tried this GET https://maps.googleapis.com/maps/api/geocode/json?address=122001

I got localities through it, but I also want it to return sub localities

1

There are 1 best solutions below

0
miguev On

That feature is not available in the Geocoding API; you can file a feature request here.

The postcode_localities in the Geocoding API offer a way to "disambiguate" the relationship between postal codes and localities which are kind of adjacent types; in most places postal codes are contained by a single locality, but in some places the relationship is reversed or there is no containment relation but instead an overlap relation, and in those cases postcode_localities help.

Sublocalities are contained by localities, which means they are "2 levels under" those postal codes (that contain/overlap localities), so the relation is not direct. Based on that, I don't think it would make sense to expose that in the same way.

Besides, the Geocoding API is a search kind of API, not a database, so it doesn't really support the find all places of type X under condition Y kind of queries.