Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get place description using Google API or any other API?

I am using Google API to get the place information and store it into database. Using Google API I am able to get address, opening hours, rating and reviews as shown in below image.

But, I am not able to get place description which is highlighted in below image in red circle. ("Quaint Italian mainstay for deep-dish, Chicago-style pizza, calzones, pastas & hot dogs.") enter image description here

I want that information in my application. I think google is taking those information from

  1. Freebase https://developers.google.com/freebase/guide/basic_concepts
  2. Wikipedia https://www.mediawiki.org/wiki/How_to_contribute

But I am not sure. Can any one help me suggest me that how I can get that information or any other API that I can use to get that information based on google place_id.

Any help would be highly appreciated.

Thank you

like image 762
prog1011 Avatar asked May 28 '18 06:05

prog1011


2 Answers

Accordingly to the documentation and @xomena, currently you cannot obtain this data via Places API. There is a feature request in Google issue tracker to make the detailed business type available in Places API, however Google doesn't expose any ETA (estimation time of arrival:

https://issuetracker.google.com/issues/35822953

Feel free to star this feature request to express your interest and subscribe to notification from Google.

like image 183
Tiago Martins Peres Avatar answered Oct 11 '22 13:10

Tiago Martins Peres


To my knowledge it is not possible to get this information from the Google Places API. The API documentation does not display the venue description. Try to have a look here: https://developers.google.com/places/web-service/details (it might be that Google does not share all information from their platform with other developers..).

I would suggest you to do one of the following (or perhaps both):

  1. Scrape Google the old school way; i.e. by getting the information from the HTML. There is a quite decent guide for doing that here (you would of course have to adjust the example to scraping Google instead): https://medium.freecodecamp.org/how-to-scrape-websites-with-python-and-beautifulsoup-5946935d93fe.

  2. What I would recommend and which probably is the fastest: enrich your current data with other data. You could e.g. use Foursquare and search for the places you get from Google. It should be possible to get the description for each place on Foursquare. See here: https://developer.foursquare.com/docs/api/venues/details. If you have problems with matching the places after your query has returned, because the venue names are not exactly the same - but close, then you could use an algorithm to match strings that are close; perhaps using the levenstein distance (https://en.wikipedia.org/wiki/Levenshtein_distance).

like image 27
Benjamin Andersen Avatar answered Oct 11 '22 14:10

Benjamin Andersen