Skip to content

Forex and CFD · Broker API

Build an OANDA trading bot with your AI coding agent.

Super Algo Kit helps you build an OANDA trading bot on the v20 REST API inside your own AI coding agent. The API is reported to cover prices, orders, trades, positions and account state. Which forex and CFD products your OANDA division lists is not confirmed. The kit develops on a practice account first, and live trading starts only when you type the authorize command.

OANDA v20 REST API logo

broker facts

OANDA v20 REST API

What it is
OANDA's v20 REST API for an fxTrade account, with streams for prices and account transactions (reported).
Who can use it
All OANDA divisions except OANDA Global Markets and OANDA TMS BROKERS S.A. (reported).
API and login
A personal access token from the account portal. No request signing; token expiry rules are not confirmed.
Paper option
fxPractice, a practice environment on separate hosts with demo money (reported).
Headline limits
120 requests a second, 2 new connections a second and 20 active streams, all per IP (reported).
Costs
No API fee is stated. Spreads, financing and commissions depend on division and account (not confirmed).
Libraries
The official v20-python library was last updated on 1 August 2021, so the kit writes a thin client against current docs.
Card status
Draft: built from a summarised intro page and search summaries of OANDA's docs.

From the kit's OANDA card, checked 2026-09-30. Confirm current terms on OANDA's own site.

Paper first

A OANDA bot, built paper first.

Super Algo Kit runs inside the coding agent you already use. It interviews you, writes the spec with pass marks set first, then builds, backtests and paper-tests. Real money starts only when you type the authorize command.

Type this in your coding agent
Build me an FX carry bot for OANDA on major currency pairs with a weekly loss limit. Paper only.

The plan, step by step

Tick them off as you go.

How OANDA API access and login work

You log in to OANDA's account management portal, open My Services and choose Manage API Access (reported). There you generate a personal access token after agreeing to the API licence. A practice account has its own portal login; whether it needs its own token is not confirmed.

The token is reported to work on both the legacy and the v20 API, so a leaked token is a full-access secret. Token scopes are not confirmed, so the kit assumes a token can trade and never gives it to an agent. Agents use practice credentials only, and the live token exists only where the bot runs.

Paper trading an OANDA bot on fxPractice

OANDA's practice environment, fxPractice, is reported to mirror the production API on separate hosts with demo money. How its fills, spreads, latency and instruments differ from live is not confirmed.

So the kit labels practice results as simulated and records sample responses from the practice account. The paper stage runs there for the full minimum period. Live trading waits until you type the authorize command.

OANDA API limits and costs to plan for

Limits are reported per IP: 120 requests a second, 2 new connections a second and 20 active streams. Bots behind one internet address share that budget. The pricing stream is reported to send at most 4 prices a second per instrument, with a heartbeat every 5 seconds.

So the stream is not tick-complete, and candles built from it differ from OANDA's candles. No API fee is stated in the pages the kit read. Spreads, financing and commissions depend on your division and account type and were not confirmed, so model them from the forex and CFD pack.

What Super Algo Kit does with OANDA

The kit caps itself at 60 requests a second and reuses one connection, 60% of the reported cap and a kit judgement. A missing 5-second heartbeat marks the stream as dead. Before enabling live, the kit checks that your account's division can use the API.

Account state is a transaction log, so the kit keeps the last transaction id it processed. After a timeout, it polls changes since that id and looks for your order's client id before treating the order as not placed. It never resends blindly. An independent risk gate and a kill switch you can run yourself sit outside the strategy.

Before you rely on it

Gotchas to plan for.

  • The API is unavailable to two OANDA divisions; check your account's division first (reported).
  • A leaked token is a full-access secret; keep it out of chat, files and logs.
  • Rate and connection limits are per IP, so bots behind one address share them (reported).
  • The pricing stream is sampled at 4 prices a second per instrument, so tick-built candles differ (reported).
  • Lose the last transaction id and you must re-read the full account details (reported).

FAQ

OANDA: questions.

Can I build an OANDA trading bot with an AI coding agent?

Yes. Super Algo Kit adds 15 specialist roles to your coding agent, which interview you and write a thin v20 client and bot in your project. You approve each gate. The kit does not trade on your behalf and is not investment advice.

Can I paper trade with the OANDA API?

Yes. OANDA's fxPractice environment is reported to mirror the production API on separate hosts with demo money. Super Algo Kit runs the paper stage there and labels results as simulated. Live trading waits until you type the authorize command.

Is Super Algo Kit affiliated with OANDA?

No. Super Algo Kit is not affiliated with or endorsed by OANDA. The OANDA name is used only to say the kit works with the OANDA v20 API.

Which OANDA accounts can use the v20 API?

OANDA's introduction page is reported to say v20 accounts are available to all divisions except OANDA Global Markets and OANDA TMS BROKERS S.A. Your division also sets your regulator, leverage caps and products. Check it before you build.

Why is the OANDA card marked draft?

Only OANDA's introduction page was read, through a page summariser, and the rest came from search summaries of the docs. So most facts are reported. Re-read OANDA's developer docs before any release.

Keep reading

More guides.

Build it with Super Algo Kit.

15 specialist roles and 35 skills inside your coding agent. Paper first, live only when you say.

OANDA v20 REST API and its logo are trademarks of their owner, used here only to say that Super Algo Kit can work with it. Super Algo Kit is not affiliated with or endorsed by OANDA. Super Algo Kit is development software. It is not investment advice, a signal service or a promise of performance. Trading involves substantial risk, including the loss of all capital you trade with.