user1749845
user1749845

Reputation: 23

Google Place API issue

I am using Google place API to get Hospitals near a location.

This ( 24.4758,54.3747 )Lat long gives only two hospitals

https://maps.googleapis.com/maps/api/place/search/json?location=24.4758,54.3747&radius=50000&types=hospital&sensor=false&key=YourAPIkey

And I searched Hospitals near Al Sharqi St - Abu Dhabi on Google maps shows more then ten hospitals.

Please suggest what else need to include in place api request to get all hospitals.

Any help will be highly appreciated.

Thanks

Upvotes: 2

Views: 416

Answers (1)

Chris Green
Chris Green

Reputation: 4427

All places are categorized under the type establishment until Google has enough metadata about a place to categorize it under supported place types like restaurant, bar, hospital etc.

A workaround would be to pass the place category type as a keyword instead of type. The keyword parameter is matched against all available fields, including but not limited to name, type, and address, as well as customer reviews and other third-party content.

https://maps.googleapis.com/maps/api/place/search/json?location=24.4758,54.3747&radius=50000&keyword=hospital&sensor=false&key=YOUR_API_KEY

Please do not post your API Key as it is linked to your developer account. I would advise resetting it in you APIs Console asap.

Upvotes: 3

Related Questions