# Demo vs live: the mix-up that breaks most first logins

Independent and unofficial. Not affiliated with or endorsed by any broker or platform named here. Educational only: nothing here is advice, and nothing here recommends a broker or a trade.

This is the markdown version of https://openbrokerapi.com/guides/demo-vs-live, written from the same records as that page.

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.

Demo and live usually mean different hosts, and often different keys or usernames. Send one to the other and you get an authentication error that looks like a typo. Here is what to check, broker by broker.

- Checked: 2026-09-18
- For: Everyone, eventually

## Steps

### 1. IG: two hosts

Demo is https://demo-api.ig.com/gateway/deal and live is https://api.ig.com/gateway/deal. Your code must point at the one your credentials belong to.

Status: verified. Source: [ig.com](https://www.ig.com/uk/trading-platforms/trading-apis/how-to-use-ig-api), checked 2026-09-18.

### 2. IG: two keys

Demo needs its own API key, and a demo account must use the same email as your live account. A demo key sent to live (or the reverse) fails with error.security.api-key-invalid, HTTP 403.

Status: verified. Source: [github.com](https://github.com/ig-python/trading-ig/issues/249), checked 2026-09-18.

### 3. IG: no mixing

Demo and live usernames and passwords cannot be mixed either, according to the trading-ig FAQ.

Status: verified. Source: [trading-ig.readthedocs.io](https://trading-ig.readthedocs.io/en/latest/faq.html), checked 2026-09-18.

### 4. OANDA: host must match token and account

Practice uses api-fxpractice.oanda.com and live uses api-fxtrade.oanda.com. "Insufficient authorization to perform request" usually means the host does not match your token or account.

Status: verified. Source: [help.oanda.com](https://help.oanda.com/us/en/faqs/rest-v20-api-troubleshooting-guide.htm), checked 2026-09-18.

### 5. OANDA: check the account ID

OANDA account IDs look like xxx-xxx-xxxxxxx-xxx. A wrong or partial ID is worth ruling out before you regenerate anything.

Status: verified. Source: [help.oanda.com](https://help.oanda.com/us/en/faqs/rest-v20-api-troubleshooting-guide.htm), checked 2026-09-18.

### 6. Capital.com: separate demo host

Demo calls go to https://demo-api-capital.backend-capital.com/ and live to https://api-capital.backend-capital.com/. Demo also caps POST /positions and /workingorders at 1000 per hour.

Status: verified. Source: [open-api.capital.com](https://open-api.capital.com/), checked 2026-09-18.

### 7. Capital.com: keys

We could not confirm whether one API key works on both demo and live. Capital.com's help centre has an article titled "Can I use Capital.com API on the Demo account?".

Status: unverified. Source: [help.capital.com](https://help.capital.com/hc/en-us/sections/4415178206354-API), no checked date recorded.

### 8. IBKR: paper is a different login and port

Paper trading uses its own paper username. IBKR's older setup guide gives the TWS default ports as 7496 live and 7497 paper. This site also holds 4001 live and 4002 paper for IB Gateway, which were not found on the IBKR pages read on 12 October 2026.

Status: verified. Source: [interactivebrokers.github.io](https://interactivebrokers.github.io/tws-api/initial_setup.html), checked 2026-09-18.

### 9. IBKR: demo data

IBKR says demo accounts cannot subscribe to market data, so an empty price feed on demo is expected, not a bug.

Status: verified. Source: [interactivebrokers.com](https://www.interactivebrokers.com/docs/web-api/v1/requirements-limitations/introduction), checked 2026-09-18.

## Sources

- Status: verified. Source: [IG: how to use the IG API](https://www.ig.com/uk/trading-platforms/trading-apis/how-to-use-ig-api), checked 2026-09-18.
- Status: verified. Source: [trading-ig issue 249: api-key-invalid after switching to live](https://github.com/ig-python/trading-ig/issues/249), checked 2026-09-18.
- Status: verified. Source: [trading-ig FAQ (community)](https://trading-ig.readthedocs.io/en/latest/faq.html), checked 2026-09-18.
- Status: verified. Source: [OANDA help: REST v20 API troubleshooting guide](https://help.oanda.com/us/en/faqs/rest-v20-api-troubleshooting-guide.htm), checked 2026-09-18.
- Status: verified. Source: [Capital.com Public API](https://open-api.capital.com/), checked 2026-09-18.
- Status: verified. Source: [Capital.com help centre: API section](https://help.capital.com/hc/en-us/sections/4415178206354-API), checked 2026-09-18.
- Status: verified. Source: [TWS API guide: initial setup (legacy docs)](https://interactivebrokers.github.io/tws-api/initial_setup.html), checked 2026-10-12.
- Status: verified. Source: [IBKR Web API v1.0 documentation, requirements and limitations](https://www.interactivebrokers.com/docs/web-api/v1/requirements-limitations/introduction), checked 2026-10-12.
- Status: verified. Source: [IBKR Web API documentation, using a paper account](https://www.interactivebrokers.com/docs/web-api/authentication/paper), checked 2026-10-12.

## Related pages

- [Getting started with API trading](https://openbrokerapi.com/guides/getting-started-with-api-trading): What an API is, what you need and how to make a first call safely.
- [All guides](https://openbrokerapi.com/guides): Step by step guides, each step with the page it was read on.
- [Brokers](https://openbrokerapi.com/brokers): The record for each broker: access, limits, endpoints and error codes.
- [Platform APIs](https://openbrokerapi.com/platforms): APIs that belong to trading software offered by many brokers.
- [Error codes](https://openbrokerapi.com/errors): What each error means, and the fix where the source gives one.
- [Compare two APIs](https://openbrokerapi.com/compare): The same fields from two records, side by side.
- [Learn to code](https://openbrokerapi.com/learn): A learning track from a first script to a demo account call.

## Licence and how to cite

The records behind this page are all rights reserved. This file is the page itself, at its own address, in another format. It is not part of the CC BY 4.0 downloads listed at https://openbrokerapi.com/data. Quote from it with a link to the page.

Cite as: Demo vs live: the mix-up that breaks most first logins. Broker API Hub, https://openbrokerapi.com/guides/demo-vs-live, newest check 2026-09-18.

Where you rely on a single figure, cite the source and the checked date printed beside it as well. Where this page and a broker's own documentation differ, the documentation wins.
