Which API should I use?

  • Use v20 REST API only if you have a v20 account
  • Use v1 REST API if your account id contains only digits (ie. 2534253) as it is a legacy account

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.


Coming Soon

Forex Labs Endpoints

The v20 API will provide access to OANDA fxLabs to support forex analysis, signals, and tools. If you need access to this functionality today, it is available in the existing REST API.