Closed Mammago closed 4 years ago
I am also receiving the same error. I'm contacting OANDA right now so I'll share it when I get the information. Please let us know if you have any new information.
I received an answer from OANDA. It seems that only the live account can use the endpoint of orderBook. Not available for demo account.
Yes, I spoke to Oanda myself over the phone and can confirm that they don't provide orderBook information to demo accounts. I wish this had been written down somewhere in their official documentation but never mind. Closing this issue.
When I try to send a GET request to the following link I get a 502 (Bad Gateway) error:
https://api-fxpractice.oanda.com/v3/instruments/USD_JPY/orderBook
I've checked issue #29 and I don't think this is the same thing, as the original poster was able to circumvent their problem by sending a GET request to the following URL directly from command line using curl:
https://api-fxtrade.oanda.com/v3/instruments/USD_JPY/orderBook
The only difference between their link and mine is that theirs is fxtrade and mine is fxpractice, so that's why I'm wondering if that's the issue. I don't have an fxtrade account yet so I can't check. If this is true, is this an intentional policy on Oanda's part not to provide order book data to practice accounts?
There was also some mention of using OrderBook instead of orderBook, but I've found that all other combinations of case generate a 404 instead of a 502 error. The code I'm using is provided below - it was mostly just stripped straight out of the
request()
and__request()
methods of theAPI
class in theoandaV20.py
file. If you uncomment the first line and comment out the second you should get a perfectly healthy HTTP 200 response, showing that the URL for candles is available for API interaction: