DEVELOP AUTOMATED CFD & FOREX TRADING STRATEGIES

GETTING SET UP

Get set up with OANDA APIs in three steps:

number 1

Open a live trading or demo account

number 2

Select your API

number 3

Request your API token

ALGORITHMIC TRADING

Stream real-time rates, execute trading actions such as market or limit orders, and access your OANDA account and price history.

Algorithmic Trading

INTEGRATE WITH EASE

Easy to use and integrate with, build customized user interfaces or develop proprietary trading models.

Integrate with ease

COMPREHENSIVE DEVELOPER RESOURCES

Our developer portal will help you get started. Extensive resources, code samples, and documentation are available at your fingertips.

Go to developer portal
Comprehensive Developer Resources

GET STARTED

Open a demo account to fine tune your trade strategies

Try a demo account

Apply for a live account now and you could be trading in minutes

Open a live account

Trading involves significant risk of loss

TRADE INFORMATION EXCHANGE FIX

Financial institutions can use an encrypted Financial Information eXchange (FIX) channel to access the OANDA Trade platform. OANDA supports FIX 4.2, 4.3, and 4.4.

HTTP-BASED REST API

OANDA's REST APIs are language-agnostic, allowing traders to pick their preferred programming languages to integrate directly to OANDA’s legacy and v20 trading engines. These APIs are ideal for individual traders who like to automate their trading strategies.

Discover the REST API

Frequently Asked Questions

Do I need an OANDA account to use the API?

Yes. You need either an OANDA Live or Demo trading account to generate a personal access token and use the API. To generate a personal access token, log into the Access Management page of your OANDA fxTrade account. On the page, there is a link titled “Manage API Access” (My Account -> My Services -> Manage API Access). From there, you can generate a personal access token to use with the OANDA API, as well as revoke a token you may currently have.

I forgot my personal access token. Can I retrieve it?

You will have to revoke and regenerate a new personal access token. Log onto the Access Management page of your OANDA fxTrade account. On the page, there is a link titled “Manage API Access” (My Account -> My Services -> Manage API Access). From there, you can revoke and regenerate a new personal access token to use with the OANDA API.

Which programming languages do you support?

The REST APIs is programming language agnostic. You can use any one of your favourite programming languages to interface with our systems. Also, to make things easier, we have a number of programming language wrappers available on our OANDA Developer Portal.

Can I use OANDA’s APIs with v20?

You can use the REST-v20 API with your v20 account.

Are your communication channels fully encrypted?

Yes, all communication through the API is SSL protected.

Is there a charge to access the API?

API access is free with a sufficiently funded OANDA online trading account.

Does the API require an OANDA platform to be running?

The APIs do not require an OANDA trading platform to be running, although you can use it to monitor the real-time actions taken by the APIs.

I get HTTP 429 error when I make a REST API request?

You will need to revoke and regenerate a new person access token. Log onto the Access Management page of your OANDA fxTrade account. On the page, there is a link titled “Manage API Access” (My Account -> My Services -> Manage API Access). From there, you can revoke and regenerate a new personal access token to use with the OANDA API. Use this new token to make API requests.

I am using the v1 REST API, and it does not work with my account ?

If you have a v20 account (an account with “dashes” within the account Id, ie 101-23423-105), you will have to use the v3 (v20-REST) API.

I am using the v20 REST API, and it does not work with my account ?

If you have legacy account (an account without “dashes” within the account Id, ie. 252345), you will have to use the v1 API.

Where do I find OANDA’s registration forms, legal and trading documentation?

OANDA’s registration forms, legal and trading documentation vary based on the OANDA division with which you hold your account. Please check the relevant Legal & Regulatory Documentation section for more details.
Read More FAQs

The OANDA API Partner Program

Join the OANDA API Partner Program and grow your business by integrating with our award-winning forex and CFD trading platform.

† Disclaimer:

This page is for general information purposes only: examples are not investment advice or an inducement to trade. Past history is not an indication of future performance.

Execution speed and numbers are based on the median round trip latency from receipt to response for all Market Order and Trade Close requests executed between January 1st and May 1st 2019 on the OANDA execution platform.

Contracts for Difference (CFDs) or Precious Metals are NOT available to residents of the United States.

The Commodity Futures Trading Commission (CFTC) limits leverage available to retail forex traders in the United States to 50:1 on major currency pairs and 20:1 for all others. OANDA Asia Pacific offers maximum leverage of 50:1 on FX products and limits to leverage offered on CFDs apply. Maximum leverage for OANDA Canada clients is determined by IIROC and is subject to change. For more information refer to our regulatory and financial compliance section.

OANDA’s APIs allow your applications to communicate directly with OANDA’s Trade servers over secure and authenticated Internet sessions with fully encrypted communication channels.

The APIs do not require the OANDA Trade user interface to be up and running, although you can use it to monitor the real-time actions taken by the APIs.