Vikash Kumar
Vikash Kumar

Reputation: 636

Google maps api geocode returns zero results for valid address

http://maps.google.com/maps/api/geocode/json?sensor=false&address=

I was looking at the above api and trying to find the location of the address "Grand Copthorne Hotel"..

However the result I am getting in the api is as follows "status" : "ZERO_RESULTS"

Please let me know why this is taking place as it is affecting my entire platform and if its a problem from your end when should I expect the issue to be solved

Please let me know about the above issue

Upvotes: 0

Views: 3415

Answers (2)

Michael Whatcott
Michael Whatcott

Reputation: 5985

The Google Geocode API filters out businesses and only works on addresses. You said you have a valid address, but "Grand Copthorne Hotel" is not a valid address. An address provides enough information to mail something to a specific person or business.

If you want to retrieve location information with a generic search term, you should use a different API.

You can try some searches in the Google Places API search box; maybe that is a good API for your situation. It returns lots of information, including latitude and longitude. Check out the documentation.

The first thing you should do is discover and decide what kind of API you actually need. Do you need information for product shipping? Do you need to show a map to a user? Do you need to retrieve businesses' information?

Keep in mind that there are many kinds of location searches and varying services that return latitude and longitude. For instance, there is geocoding (generally matches addresses or partial addresses to a fairly accurate latitude and longitude pair); there is address validation (matches addresses to a database of information—probably postal service information—to provide very accurate location information for real addresses); there is places search (search for names, icons, titles, or business terms and retrieve location information). There are still other options. Just take a look at one list of mapping-related APIs from Google...

Full disclosure: I work for SmartyStreets, an address validation service.

Upvotes: 0

xomena
xomena

Reputation: 32178

Geocoding API filters out businesses, it works only with street addresses.

If you need the location of the business you have to use Places API search.

E.g.

https://maps.googleapis.com/maps/api/place/textsearch/json?query=Grand%20Copthorne%20Hotel&key=YOUR_API_KEY

Please refer to the documentation for further details:

https://developers.google.com/places/web-service/search

Upvotes: 3

Related Questions