Google Places API: More specific types?

2019-06-09 18:01发布

问题:

When I Google "Justine's" I can see that it's listed as a "French Restaurant". (See screenshot)

When I use the Google Places API to get details about the same spot I only see a list of "types" that includes high-level terms like "restaurant" and "bar", but I see no specific types like "French Restaurant".

Does anyone know if it's possible to get this data?

Thanks!

回答1:

I think you would probably have to check with the text search method on the api.. https://developers.google.com/places/documentation/search#TextSearchRequests

So your request would end up looking something like the below, restricted down to a specific area

https://maps.googleapis.com/maps/api/place/textsearch/json?query=French +Restaurant&sensor=true&location=yourLocationHere&radius=20&key=yourKeyHere

However this will return all other French restaurants in the area, so if you just want to return the one result I would use the Place Details request instead