0

I want to get all restaurants in cairo that follow this name: "كشري" I wrote this code:

# Get the longitude, latitude and district of Cairo 
geocode_result = gmaps.geocode('Cairo')[0] 
longitude = geocode_result['geometry']['location']['lng'] 
latitude = geocode_result['geometry']['location']['lat'] 
district = geocode_result['address_components'][2]['long_name'] 

 # Set the search parameters for restaurants in Cairo and get the results 
results = gmaps.places_nearby(location=(latitude, longitude), radius=10000, keyword='كشري', type='restaurant') 

 # Iterate through each result and store the name, longitude, latitude and district in a list  
restaurants = []  
for result in results['results']: 
    restaurants.append({'name': result['name'],'long':result['geometry']['location']['lng'] ,'lat': result['geometry']['location']["lat"],'district': district , 'polygon': result['geometry']})   

# Print out all the restaurants in a readable format
print('Name\t\tLongitude\tLatitude\tDistrict\tPolygon')
for restaurant in restaurants:
    print(f"{restaurant['name']}\t{restaurant['long']}\t{restaurant['lat']}\t{restaurant['district']}\t{restaurant['polygon']}")

But, It gives me back 20 restaurants only!

I want all of the restaurants in cairo with a radius of 10000 KM. How can I do that?

  • please say something useful if you have any. – Esmael Maher Feb 07 '23 at 15:52
  • Did you look at: [Can't get the Place details (Gmaps Places API) more than 20 data](https://stackoverflow.com/questions/63556992/cant-get-the-place-details-gmaps-places-api-more-than-20-data) – Maurice Meyer Feb 07 '23 at 15:53

0 Answers0