Forums

CCXT connection error

I got this error , please help : HTTPSConnectionPool(host='fapi.binance.com', port=443): Max retries exceeded with url: /fapi/v1/exchangeInfo (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f2311221f10>: Failed to establish a new connection: [Errno 111] Connection refused')))

I use ccxt , and this code gives error : exchange.fetch_ticker('BTCUSDT')

Verbose result: binance GET https://fapi.binance.com/fapi/v1/exchangeInfo RequestHeaders: {'User-Agent': 'python-requests/2.28.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'Connection': 'keep-alive'} RequestBody: None

I searched but I didnt find any source I ran code in my pc, it works

You need to configure the library that you're using to use the proxy. Check the documentation of the library for how to do that. The details that you need are here https://help.pythonanywhere.com/pages/403ForbiddenError/

So do I have to use a proxy?

From a free PythonAnywhere account, yes.

I used proxy , it works my pc, I check url at http://httpbin.org/ip and it returns proxy's ip so proxy works. I used it with ccxt, it works too in my pc. I used it on Pythonanywhere and it gives same error , any solution please

Are you using the correct proxy settings on PythonAnywhere? See the link Glenn posted above.