Forums

<urlopen error Tunnel connection failed: 403 Forbidden>

Everything works fine on my computer. pythonanywhere console shows error

<urlopen error Tunnel connection failed: 403 Forbidden>

my code connects via urllib.request to api https://www.binance.com/api/v3/ticker/24hr is that forbidden? why? I'm just writing my first bot Or is this some kind of mistake, please help!

Free accounts on PythonAnywhere have restricted Internet access -- they can only access sites on our whitelist. If you check that page, you'll see that there are a number of different binance.com hostnames there, for example api.binance.com -- but not www.binance.com. I think that all API requests to Binance are meant to go to the api. hostname, not the www. one.

And how do I connect to https://www.binance.com/api/v3/ticker/24hr ???

https://api.binance.com/api/v3/ticker/price/24hr not found

api.binance.com - doesn't provide any information, it's just a check connection

here is the real api - https://www.binance.com/api/v3/ticker/24hr

here is the documentation: https://binance-docs.github.io/apidocs/spot/en/#24hr-ticker-price-change-statistics

please add real api to white list

sorry i was wrong. everything works

error in link https://www.binance.com/api/v3/ticker/24hr

working link https://api.binance.com/api/v3/ticker/24hr

sorry for wasting time

OK, glad to hear you got it working.