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

OANDA API Code Samples


What can I build?

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:

  • Write automated trading strategies in any programming language
  • Create a service that provides exchange rates for eCommerce companies
  • Start a business to hedge currency risks for other companies
  • Implement high frequency trading algorithms that make money while you sleep
  • Build a “Chart Chat” service that combines our chart data with the StockTwits API
  • Download Trading Account History to generate performance reports and trading analytics

Sample Programs


Streaming Rates Examples


Streaming Events Examples


Language API Wrappers


Reference Implementation


OAuth Samples


Third-party Samples

  • OANDA Ruby Wrapper - submitted by nukeproof
  • Matlab REST Wrapper - submitted by tradeasystems
  • OTest (C++ on Windows) - submitted by StevenABrown
  • OANDA For Go (Go programming language) - submitted by santegoeds
  • OANDA Adapter - Node.js adapter for OANDA’s REST and streaming API - submitted by Cloud9Trader
  • OANDAWrap - Php interface for Oanda API - submitted by tavurth
  • ARGO - Argo is an open source trading platform, connecting directly with OANDA through the powerful API to develop trading strategies - submitted by albertosantini
  • pyoanda - Python library that wraps Oanda API. Built on top of requests, it’s easy to use and makes sense. - submitted by toloco
  • morgentau - Interface to the oanda REST API using ruby by morgentau
  • Scalanda - Scala/Akka wrapper for Oanda REST and Stream API - submitted by msilb
  • AKka-trading - Scala Backtesting + Oanda REST API Trading Framework built on top of Akka/Spray - submitted by msilb
  • cloanda - A closure wrapper for OANDA REST API - submitted by yellowbean
  • oanda-rest-java - OANDA REST api wrapper for java - submitted by rabun
  • oanda-rest-cs - OANDA REST api wrapper for C# - submitted by rabun
  • ROandaAPI - OANDA REST API wrapper for R - submitted by FranciscoME
  • QuinnSys-OAPI - Matlab OANDA REST API wrapper - submitted by QuinnSys

Browse Github for more OANDA repos

Any third-party code sample available on this site (the “Software”) is developed by third party providers (e.g OANDA API customers) separate from OANDA Corporation and its affiliated companies (“OANDA”). 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.