Broker API HubMenu

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

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.

Independent and unofficialChecked For: Everyone, eventually

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.

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.

    ig.comchecked

  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.

    github.comchecked

  3. IG: no mixing

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

    trading-ig.readthedocs.iochecked

  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.

    help.oanda.comchecked

  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.

    help.oanda.comchecked

  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.

    open-api.capital.comchecked

  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?".

    Unverifiedhelp.capital.com

  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.

    interactivebrokers.github.iochecked

  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.

    interactivebrokers.comchecked

Sources

Sections