This repo contains go code for querying Oanda's API for Forex price info. One could also set up a demo account to trade
WARNING: This is for educational purposes only.
Taken from Oanda's REST V-20 API Introduction page:
The Oanda's REST V-20 API provides programmatic access to Oandas's next generation v20 trading engine. To use this API you must have a v20 trading account, which is available to all divisions except OANDA Global Markets.
What can I do with the OANDA REST-v20 API?
- Get real-time rates for all tradeable pairs 24 hours a day
- Access historical pricing information dating back to 2005
- Place, modify, close orders
- Manage your account settings
- Access your account/trading history
- Requires Go 1.20.3 or greater
- Register demo account from Oanda to obtain an API key
- Modify the
res_edit.json
file in this repo's root directory withID
andToken
obtained in the second step- rename
res_edit.json
tores.json
for go code to work correctly
- rename
Once the above is satisfied you can get the functions in this repo with:
go get github.com/davidhintelmann/Oanda-Go/restful
Then import in your main.go
(or any go file) with
import "github.com/davidhintelmann/Oanda-Go/restful"