Reputation:
I am currently attempting to find place details for companies at specific addresses. For that, I encoded the address, which I have, into geo-coordinates using geopy. Then I use the google places API to fetch the surrounding places and use their id's to get details via google places details (find my code below).
The Problem is, that the company, which I can search for successfully on google maps, is not listed in the searchs results. One problem might be that the company is "permanently closed" - but as this is a field that is returned from Google Places, and I can still find the company via websearch on google maps, I think this shouldnt actually matter.
Do you have any idea why my place is not being among the returned ones?
My Code:
companies = [{'name': '"Bullermeck" Spielscheunen und Freizeitanlagen GmbH', 'address': 'Am Kirchplatz 6, 26441 Jever'}]
places = []
myfields = ['name', 'website', 'type', 'rating', 'review', 'url', 'formatted_address', 'permanently_closed']
for company in companies:
placesForCompany = {'company': company['name'], 'original_address': company['address']}
# Derive coordinates by converting the address with geopy
location = geolocator.geocode(company['address'])
coordinates = str(location.latitude) + ", " + str(location.longitude)
placesForCompany['coordinates'] = coordinates
# Search for places in a 500m radius - the radius is a bit higher because of the inaccuracy of geopy
result = gmaps.places_nearby(location=coordinates, radius=500)
# Gather the found places in this array
placesForCompany['nearbyPlaces'] = []
# Iterate all the found places
for place in result['results']:
# Use the place_id to get more information about the place from Google Place Details
place_id = place['place_id']
place_details = gmaps.place(place_id = place_id, fields = myfields, language='de')
placesForCompany['nearbyPlaces'].append(place_details['result'])
places.append(placesForCompany)
Here is a screenshot of my google maps search:
Upvotes: 0
Views: 457
Reputation: 624
It seems you are searching for Bullermeck Spielscheunen und Freizeitanlagen at the address Am Kirchpl. 6, 26441 Jever, Germany. If you check this in Geocoding API, you'll get the place_id ChIJZfmp_meJtkcR1D7UdD4Sex4
. Checking this place_id through a Places Details request, you'll see that this establishment's business_status
is CLOSED_PERMANENTLY
. Please do note that places tagged as closed permanently/temporarily are not searchable through Places Nearby Search as per this comment on a bug here.
As you will notice on this sample Nearby Search request, the API only returns places with "OPERATIONAL" business status and so your business which is tagged as permanently closed was not be returned in the search results.
Note: You need to add your own API key on the sample requests provided above.
Hope this helps!
Upvotes: 1