hootnot / oanda-api-v20

OANDA REST-V20 API wrapper. Easy access to OANDA's REST v20 API with oandapyV20 package. Checkout the Jupyter notebooks!
MIT License
398 stars 107 forks source link

Failed to establish a new connection: [Errno -2] Name or service not known' #174

Closed biographie closed 3 years ago

biographie commented 3 years ago

I am getting this error for some reason

ConnectionError: HTTPSConnectionPool(host='%09api-fxpractice.oanda.com', port=443): Max retries exceeded with url: /v3/accounts/101-004-16983542-001/instruments/GBP_JPY/candles?from=1546293600.0&to=1577829600.0&granularity=D (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f0e2ea016d8>: Failed to establish a new connection: [Errno -2] Name or service not known',))

Could anyone tell me how to fix this problem?

hootnot commented 3 years ago

Pls check their website. Probably a maintenance weekend. When the perform maintenance there can be downtime for hours or even the whole weekend. At sunday 21:00 UTC you should not experience problems anymore because markets will open.

(my personal experience at market close yesterday was, that services were not available shortly after market close)

biographie commented 3 years ago

Thanks for the response. Okay I will try again on Sunday. Could this potentially be because I had too many connections open and forgot to close them and thus limited my API access?

hootnot commented 3 years ago

I see a %09 in the host, that is a horizontal tab. That should not be there. My conclusion is that you didn't use oandapyV20 in this case. But regardless the way you want to access OANDA : if they have maintenance, ConnectionErrors can occur. Too many open ? Pls check the limits they have on developer.oanda.com for limits.

Just checked some connectivity on both live and practice environments: I have no issues currently