OANDA API Code Samples

OANDA is a leading forex broker enabling you to trade over 90 currency pairs, metals, and CFDs. Everything you ask for is live and real-time. The only limit is your imagination. If you have an idea for a product or company built on top of our platform we want to help! You could:

Sample Programs

OANDA makes no warranty or representation, either express or implied, with respect to the Software or Software features, including their quality, performance, merchantability, suitability, fitness for a particular purpose or that they are error free.

Configure Examples

Configuration has been reset Configuration has been saved

Setting the following values will modify all examples to use the provided configuration. This may help to generate examples that can be copied and without further modification.

Close Reset Save Copyright OANDA 2014 TERMS OF USE PRIVACY POLICY CONTACT US ABOUT US

© 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.

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 (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 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 Asia Pacific Pte Ltd (Co. Reg. No 200704926K) holds a Capital Markets Services Licence issued by the Monetary Authority of Singapore.

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 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.

Leverage trading is high risk. Losses can exceed investments.This advertisement has not been reviewed by the Monetary Authority of Singapore.

CFDs are complex financial products and come with a high risk of losing money.
76.8% of retail client accounts lose money when trading CFDs with this provider.
You should consider whether you can afford to take the high risk of losing your money.