yelp-fusion
                                
                                 yelp-fusion copied to clipboard
                                
                                    yelp-fusion copied to clipboard
                            
                            
                            
                        Batching requests or delaying requests to pull all lat/long from a CSV then call API?
Overview
- Client ID: yZUZE2dxOOlWl0M6eMUyTA
- Issue type: question
- Summary: Is there a way for me to use a list of latitudes and longitudes to call the API? Maybe a batch request? Or perhaps entering multiple latitude and longitudes?
- Platform: Desktop/web
Description
(I am trying to get review count and 3 reviews for a list of businesses. I cant figure out how to call the API with more than 1 lat/long or business name)
More information
(Fill this section out if applicable (for things like bugs or questions))
Endpoint
(Fusion Search API - business search)
Parameters or Sample Request
import requests import json import csv
with open('....csv') as csvCoordinates: coordinates = csvCoordinates.readlines() print (coordinates) #n_lines = len(coordinates) #for line_num in list(range(n_lines)): #api_key="..." #headers = {'Authorization': 'Bearer %s' % api_key} #url='https://api.yelp.com/v3/businesses/search' #params = '%s' % coordinates[line_num].rstrip("\n") #print (params) #req=requests.get(url, params=params, headers=headers) #print('The status code is {}'.format(req.status_code)) #json.loads(req.text)