Reputation: 1
This is my code so far:
LIMIT = 50 # limit of number of venues returned by Foursquare API
radius = 500 # define radius
# create URL
url = 'https://api.foursquare.com/v2/venues/explore?&client_id={}&client_secret={}&v={}&ll={},{}&radius={}&limit={}'.format(
CLIENT_ID,
CLIENT_SECRET,
VERSION,
neighborhood_latitude,
neighborhood_longitude,
radius,
LIMIT)
url
results = requests.get(url).json()
results
ERROR:
NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000175790F8308>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
Upvotes: 0
Views: 50
Reputation: 1
That version package is deprecated. I believe what went wrong is the authorization. You may need to pass in a parameter oauth_token=ACCESS_TOKEN
Make sure CLIENT_ID, CLIENT_SECRET, VERSION (select a date) is initialized correctly.
The supporting documentation is linked here: https://docs.foursquare.com/developer/reference/versioning
Upvotes: 0