Development Guide
API URLs
REST API
Environment | URL | Authentication | Description |
---|---|---|---|
fxTrade Practice | https://api-fxpractice.oanda.com | Required. Details Here | A stable environment; recommended for testing with your fxTrade Practice account and your personal access token. |
fxTrade | https://api-fxtrade.oanda.com | Required. Details Here | A stable environment; recommended for production-ready code to execute with your fxTrade account and your personal access token. |
Streaming API
Environment | URL | Authentication | Description |
---|---|---|---|
fxTrade Practice | https://stream-fxpractice.oanda.com/ | Required. Details Here | A stable environment; recommended for testing with your fxTrade Practice account and your personal access token. |
fxTrade | https://stream-fxtrade.oanda.com/ | Required. Details Here | A stable environment; recommended for production-ready code to execute with your fxTrade account and your personal access token. |
Our documentation uses the fxtrade URL for all examples. To use a different environment simply replace the base of the url with the appropriate one listed above and follow any necessary authentication.
Request and Response Details
All requests with a body require Content-Type: application/json
unless specified otherwise.
All responses will have Content-Type: application/json
unless specified otherwise.
DateTime Format
Please read the DateTime Definition for information about formatting DateTime fields.
Rate Limiting
REST API
120 requests per second. Excess requests will receive HTTP 429 error. This restriction is applied against the requesting IP address.
Streaming API
20 active streams. Requests above this threshold will be rejected. This restriction is applied against the requesting IP address.
Connection Limiting
Client is allowed to make no more than 2 new connections per second. Excess connections will be rejected. For more details on making persistent connections, please refer to the Best Practices page.
Trade currencies, metals, and CFD’s
Use the Order endpoint to place orders.
Get real time currency prices
Use the Prices endpoint for obtaining real time quotes.
Configure Curl Examples
Setting the following values will modify all examples to use the provided configuration. This may help to generate examples that can be copied without further modification.
‘Examples’ section is available for each Endpoints. Click on the “curl:”.
Click on the Setting icon located beside Request.
Modify the following configurations as required:
-URL:
If you are on fxtrade, use URL: https://api-fxtrade.oanda.com If you are on fxpractice, use URL: https:/api-fxpractice.oanda.com
-Username: “Username”
-Account: “Account Number”
-Token: “Token”
Click Save.
All the Request examples would be updated and can be used without further modification.