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.

© 1996 - 2019 OANDA Corporation. All rights reserved. "OANDA", "fxTrade" and OANDA's "fx" family of trademarks are owned by OANDA Corporation. All other trademarks appearing on this Website are the property of their respective owners.

Leveraged trading in foreign currency contracts or other off-exchange products on margin carries a high level of risk and may not be suitable for everyone. We advise you to carefully consider whether trading is appropriate for you in light of your personal circumstances. You may lose more than you invest (except for OANDA Europe Ltd customers who have negative balance protection). Information on this website is general in nature. We recommend that you seek independent financial advice and ensure you fully understand the risks involved before trading. Trading through an online platform carries additional risks. Refer to our legal section here.

Financial spread betting is only available to OANDA Europe Ltd customers who reside in the UK or Republic of Ireland. CFDs, MT4 hedging capabilities and leverage ratios exceeding 50:1 are not available to US residents. The information on this site is not directed at residents of countries where its distribution, or use by any person, would be contrary to local law or regulation.

OANDA (Canada) Corporation ULC accounts are available to anyone with a Canadian bank account. OANDA (Canada) Corporation ULC is regulated by the Investment Industry Regulatory Organization of Canada (IIROC), which includes IIROC's online advisor check database (IIROC AdvisorReport), and customer accounts are protected by the Canadian Investor Protection Fund within specified limits. A brochure describing the nature and limits of coverage is available upon request or at www.cipf.ca.

OANDA Australia Pty Ltd is regulated by the Australian Securities and Investments Commission ASIC (ABN 26 152 088 349, AFSL No. 412981) and is the issuer of the products and/or services on this website. It's important for you to consider the current Financial Service Guide (FSG), Product Disclosure Statement ('PDS'), Account Terms and any other relevant OANDA documents before making any financial investment decisions. These documents can be found here.

OANDA Corporation is a registered Futures Commission Merchant and Retail Foreign Exchange Dealer with the Commodity Futures Trading Commission and is a member of the National Futures Association. No: 0325821. Please refer to the NFA's FOREX INVESTOR ALERT where appropriate.

OANDA Europe Limited is a company registered in England number 7110087, and has its registered office at Floor 9a, Tower 42, 25 Old Broad St, London EC2N 1HQ. It is authorised and regulated by the Financial Conduct Authority, No: 542574.

OANDA Japan Co., Ltd. First Type I Financial Instruments Business Director of the Kanto Local Financial Bureau (Kin-sho) No. 2137 Institute Financial Futures Association subscriber number 1571.

OANDA Asia Pacific Pte Ltd (Co. Reg. No 200704926K) holds a Capital Markets Services Licence issued by the Monetary Authority of Singapore.

OANDA Markets Europa GmbH is registered in Germany and regulated by Federal Financial Supervisory Authority (BaFin). Business address is Wework Building Taunusanlage 8, 60329 Frankfurt/Main

Your capital is at risk. Losses can exceed investment. Leverage trading is high risk and not for everyone.