首页 > 解决方案 > I am trying to call information on venues in a 500 m radius of a location via the foursquare API. I keep getting getting the error: [WinError 10061]

问题描述

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'))

标签: pythonjsonapicompiler-errorsfoursquare

解决方案


推荐阅读