Broker API HubMenu

Broker API

OANDA trading API (v20)

v20 REST API with HTTP streaming for prices and transactions.

Independent and unofficialNewest reading Official documentation

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

Quickstart: key to first call33 endpoints242 error codes

OANDA API rate limits and allowances

One record per limit. The scope is part of the limit: a figure without its scope is not a figure you can pace against.

LimitValueScopeSource
Headline limit120/s per IP address, HTTP 429 above itipdeveloper.oanda.comchecked

OANDA API rate limits in full, with pacing advice and the related error codes.

Access, authentication and streaming

API types listed in the record: REST (v20), HTTP streaming.

How you get a key

Account Management Portal > My Services > Manage API Access, accept licence, generate personal access token.

OANDA v20 Introductionchecked

Who can use it

Needs a v20 account; available in all divisions except OANDA Global Markets and OANDA TMS Brokers S.A.

OANDA v20 Introductionchecked

Demo

Yes: fxTrade Practice environment with its own token.

OANDA Development Guidechecked

Authentication

Bearer personal access token, generated in the Account Management Portal after accepting the API licence.

Introduction, OANDA v20 REST APIchecked

Streaming

HTTP chunked transfer encoding carrying JSON objects, not WebSocket. The development guide states at most 20 active streams, with requests above that rejected, and no more than 2 new connections a second. The best practices page advises no more than 100 requests a second on an established connection. Sources: https://developer.oanda.com/rest-live-v20/development-guide/ and https://developer.oanda.com/rest-live-v20/best-practices/, both read 23 September 2026, development guide re-read 24 September 2026.

OANDA Development Guidechecked

History depth

Historical pricing back to 2005, on the introduction page. Candles: at most 5,000 per request, 500 by default, on the pricing endpoints page. Transactions: at most 365 days per request, in pages of up to 1,000.

OANDA v20: Introductionchecked OANDA v20: Pricing endpointschecked OANDA v20: Transaction endpointschecked

Rate limits, as worded

OANDA publishes two figures, on two pages, in two units. The enforced one is on the development guide. The development guide states 120 requests a second per IP address, with HTTP 429 above that, and at most 20 active streams. The best practices page advises no more than 100 requests a second on an established connection and no more than 2 new connections a second. A request rate and an established connection rate are different units, so neither figure replaces or contradicts the other. Our inference and not OANDA's word: hold to the lower request rate and open no more than 2 new connections a second. Sources: https://developer.oanda.com/rest-live-v20/development-guide/ and https://developer.oanda.com/rest-live-v20/best-practices/, both read 23 September 2026, development guide re-read 24 September 2026.

OANDA v20 best practiceschecked

OANDA API endpoints

33 documented endpoints. Grouped by what they do

OANDA API error codes

242 decoded error codes. All OANDA errors

Platform APIs an account here can reach

Platform APIOfferedNoteSource
MetaTrader 4 (MQL4)YesMT4 offered. Expert Advisors allowed: 'The MetaTrader 4 platform supports Expert Advisors (EAs)'.OANDA UK MetaTrader 4checked
MetaTrader 5 (Python package and MQL5)YesMT5 on web, desktop and mobile, live and demo. Expert Advisors allowed: 'Create expert advisors in MQL5 to automate your trading strategies'.OANDA UK MetaTrader 5checked
cTrader Open APINocTrader not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.UnverifiedOANDA UK trading platformschecked
TradeLocker APINoTradeLocker not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.UnverifiedOANDA UK trading platformschecked
Match-Trader Platform APINoMatch-Trader not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.UnverifiedOANDA UK trading platformschecked
DXtrade APIsNoDXtrade not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.UnverifiedOANDA UK trading platformschecked

OANDA API SDKs and wrappers

LibraryLanguageOfficialNoteSource
v20PythonOfficialNot recordedUnverifiedgithub.com
oandapyV20PythonCommunityCommunity wrapper, last release 0.7.2 in Aug 2021.github.comchecked

OANDA API: questions and answers

Each answer is read from the record on this page, not written separately. Where the record is unverified, the answer says so.

Does OANDA have an API?

Yes. This register records OANDA as having its own API (REST (v20) and HTTP streaming), with availability marked as active. v20 REST API with HTTP streaming for prices and transactions.

OANDA: v20 REST introductionchecked

OANDA API key: how do I get one?

Account Management Portal > My Services > Manage API Access, accept licence, generate personal access token.

OANDA v20 Introductionchecked

Who can use the OANDA API?

Needs a v20 account; available in all divisions except OANDA Global Markets and OANDA TMS Brokers S.A.

OANDA v20 Introductionchecked

OANDA API demo: is there a demo or sandbox?

Yes: fxTrade Practice environment with its own token.

OANDA Development Guidechecked

What are the OANDA API rate limits?

Headline limit: 120/s per IP address, HTTP 429 above it. Scope: ip. As the record words it: OANDA publishes two figures, on two pages, in two units. The enforced one is on the development guide. The development guide states 120 requests a second per IP address, with HTTP 429 above that, and at most 20 active streams.

developer.oanda.comchecked OANDA v20 best practiceschecked

How does OANDA API authentication work?

Bearer personal access token, generated in the Account Management Portal after accepting the API licence.

Introduction, OANDA v20 REST APIchecked

Does the OANDA API support streaming?

HTTP chunked transfer encoding carrying JSON objects, not WebSocket. The development guide states at most 20 active streams, with requests above that rejected, and no more than 2 new connections a second.

OANDA Development Guidechecked

How much history does the OANDA API return?

Historical pricing back to 2005, on the introduction page. Candles: at most 5,000 per request, 500 by default, on the pricing endpoints page. Transactions: at most 365 days per request, in pages of up to 1,000.

OANDA v20: Introductionchecked OANDA v20: Pricing endpointschecked OANDA v20: Transaction endpointschecked

Is there a Python library for the OANDA API?

This register lists these Python libraries for the OANDA API. v20 (official, Python). oandapyV20 (community, Python): Community wrapper, last release 0.7.2 in Aug 2021.

oandapyV20checked

Which platform APIs work with an account at OANDA?

Recorded as offered, with a source: MetaTrader 4 and MetaTrader 5. Not verified either way: cTrader, TradeLocker, Match-Trader and DXtrade.

OANDA UK MetaTrader 4checked OANDA UK MetaTrader 5checked

OANDA API questions, each answered in a sentence or two.

The capability tables read one feature at a time across every broker and platform record, OANDA included.

Everything this site records for OANDA, as one JSON file. Each section of the file states its own licence. About the files. This page as Markdown.

OANDA API guides and reference

OANDA API compared

The same fields from two records, side by side. No winner is picked.

What changed recently for the OANDA API

The newest entries are shown. Every dated change, all brokers and platforms. Follow OANDA changes by RSS

Sample apps that use the OANDA API

Every app and sample

Partner programme

Published figure, as the page words it: up to US$600* for every client you successfully introduce to us. The OANDA partner programme record. The programme register holds every record. This site carries no affiliate links.

How to cite this

OANDA trading API (v20). Broker API Hub, https://openbrokerapi.com/brokers/oanda, newest check .

Where you rely on a single figure, cite the source and the checked date printed beside it as well.

Sections