FOREX.com vs OANDA API
The same fields from the FOREX.com / StoneX Trading (City Index) record and the OANDA record, side by side. No winner is picked: which one suits you depends on what you are building.
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.
What the two records show
Differences you can see in the records themselves. These are counts of what this site holds, not a verdict on either API.
- FOREX.com / StoneX Trading (City Index) is recorded as a broker with an API of its own. OANDA is recorded as a broker with an API of its own.
- This site documents no endpoints for FOREX.com / StoneX Trading (City Index) and 33 endpoints for OANDA. That counts what has been documented here, not what each API offers.
- This site has decoded no error codes for FOREX.com / StoneX Trading (City Index) and 242 error codes for OANDA.
- The limits register holds 1 limit record for FOREX.com / StoneX Trading (City Index) and 1 limit record for OANDA. Each limit record carries its own scope.
- The FOREX.com / StoneX Trading (City Index) record holds a demo claim, verified at its source. The OANDA record holds a demo claim, verified at its source. The wording of each is in the Demo row below.
- A quickstart is built here for OANDA only.
FOREX.com / StoneX Trading (City Index) and OANDA, field by field
| Field | FOREX.com / StoneX Trading (City Index) | OANDA |
|---|---|---|
| Kind | Broker with its own API | Broker with its own API |
| API family | REST, Streaming | REST (v20), HTTP streaming |
| How you get access | Open and fund a standard account, then request API access from support; an AppKey is emailed if accepted.FOREX.com API Tradingchecked | Account Management Portal > My Services > Manage API Access, accept licence, generate personal access token.OANDA v20 Introductionchecked |
| Who can use it | By application: you must describe your expertise, language, goal and expected volume, and sign API terms.StoneX API Getting Startedchecked | Needs a v20 account; available in all divisions except OANDA Global Markets and OANDA TMS Brokers S.A.OANDA v20 Introductionchecked |
| Demo | Partial: the StoneX API documentation describes two environments, Live and Pre-Production, each with its own API and streaming address. It says most users work on Live and that only some users, depending on user type and circumstances, are given Pre-Production access. An account in one environment is not recognised in the other. The documentation does not say that a retail demo account can use the API.StoneX API documentation, Getting Startedchecked | Yes: fxTrade Practice environment with its own token.OANDA Development Guidechecked |
| Authentication | A session token. POST your user name, password and the AppKey you were issued to /v2/Session, then send the returned session token and your user name with every request as the request headers Session and UserName. Passing them in the query string is marked obsolete. The documentation says a token is valid for at least 20 minutes, and an expired one is signalled by HTTP 401. Subscribing to the streams uses the user name and the session token as its credentials.StoneX API documentation, API basicschecked | Bearer personal access token, generated in the Account Management Portal after accepting the API licence.Introduction, OANDA v20 REST APIchecked |
| Streaming | Lightstreamer, a third party streaming protocol, over long lived HTTP connections and not WebSocket as documented. Streams cover prices, news headlines, client account margin, orders and quotes, grouped into adapters. Each adapter needs one HTTP connection plus one control connection. The documentation says the servers still run Lightstreamer 7.4.1 and that clients should use that version of the Lightstreamer SDK.StoneX API documentation, architecturechecked | 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 | Price bars: max 4,000 per request (default 1,000). Trade history: max 200 results per call, filter by from date.GAIN Capital API docs: GetPriceBarsBeforeDatechecked | 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 |
| Limits |
|
|
| Endpoints documented here | None yet | 33 |
| Error codes decoded here | None yet | 242 |
| Official documentation | docs.labs.gaincapital.com | developer.oanda.com |
Go deeper on each side
FOREX.com / StoneX Trading (City Index)
- FOREX.com API page, the full record
- No FOREX.com API quickstart is built here yet
- FOREX.com API limits, in the table above
- No FOREX.com API error codes are decoded here yet
OANDA
- OANDA API page, the full record
- OANDA API quickstart, credentials to a first call
- OANDA API limits, in the table above
- OANDA API error codes, each with its fix
- OANDA API endpoints, each with its source
- Get your OANDA trade history into a spreadsheet
All comparisons. New to this? Getting started with API trading.