# IG demo API key: how to get one and what it allows

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/ig-demo-api-key, 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.

IG does not hand out API keys from a standalone demo account. You need a live account, a demo account opened with the same email, and a separate key for demo. Here is the route, the two base URLs and the allowances you cannot raise.

- Checked: 2026-09-19
- For: First time IG API users
- About: [IG](https://openbrokerapi.com/brokers/ig)

## Steps

### 1. Start from a live account

IG says API accounts cannot be created from a standalone demo account unless that demo is linked to a live account. Keys are generated under My IG, then Settings, then API.

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

### 2. Open a demo with the same email

IG Labs answers the question directly: to get a demo API key, apply for another demo account and use the same email address as your live account. IG's API page repeats the same rule.

Status: verified. Source: [labs.ig.com](https://labs.ig.com/faq.html), checked 2026-09-19.

### 3. Generate a separate demo key

Demo needs its own key. A demo key sent to the live host, or the reverse, fails with error.security.api-key-invalid (HTTP 403), according to a trading-ig issue thread.

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

### 4. Use the demo base URL

Demo is https://demo-api.ig.com/gateway/deal and live is https://api.ig.com/gateway/deal. We read these from the community trading-ig client source because the IG Labs REST reference page blocks our fetcher.

Status: verified. Source: [raw.githubusercontent.com](https://raw.githubusercontent.com/ig-python/trading-ig/master/trading_ig/rest.py), checked 2026-09-19.

### 5. Know the allowances

IG Labs publishes 60 non-trading requests per minute per app, 100 trading and 30 non-trading requests per minute per account, 10,000 historical price data points per week and 40 concurrent streaming subscriptions. IG says the limits cannot be increased.

Status: verified. Source: [labs.ig.com](https://labs.ig.com/faq.html), checked 2026-09-19.

### 6. Expect lower limits on demo

The trading-ig FAQ says demo limits are lower than live and have changed without notice. IG does not publish the demo numbers, so throttle below the live figures.

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

### 7. Recognise the allowance errors

trading-ig treats error.public-api.exceeded-api-key-allowance, exceeded-account-allowance and exceeded-account-trading-allowance as rate limit hits. The historical data allowance only resets once a week.

Status: verified. Source: [raw.githubusercontent.com](https://raw.githubusercontent.com/ig-python/trading-ig/master/trading_ig/utils.py), checked 2026-09-19.

### 8. Tokens die at the weekend

IG Labs, the official source, says v2 session tokens stay valid for 12 hour intervals between calls, and all tokens are invalidated during weekend maintenance. v3 OAuth tokens are different: about a minute, community sourced. Log in again on a 401 rather than on a timer.

Status: verified. Source: [labs.ig.com](https://labs.ig.com/faq.html), checked 2026-09-19.

## 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-19.
- Status: verified. Source: [IG Labs FAQ](https://labs.ig.com/faq.html), checked 2026-10-12.
- Status: verified. Source: [IG: trading APIs](https://www.ig.com/uk/trading-platforms/trading-apis), checked 2026-09-19.
- Status: verified. Source: [trading-ig rest.py (community source)](https://raw.githubusercontent.com/ig-python/trading-ig/master/trading_ig/rest.py), checked 2026-09-19.
- Status: verified. Source: [trading-ig utils.py (community source)](https://raw.githubusercontent.com/ig-python/trading-ig/master/trading_ig/utils.py), checked 2026-09-19.
- Status: verified. Source: [trading-ig FAQ (community source)](https://trading-ig.readthedocs.io/en/latest/faq.html), checked 2026-09-19.
- Status: verified. Source: [trading-ig issue 249 (community source)](https://github.com/ig-python/trading-ig/issues/249), checked 2026-09-19.

## More on the IG API

- [IG API quickstart](https://openbrokerapi.com/brokers/ig/quickstart): From credentials to a first call on a demo account, step by step.
- [IG API error codes](https://openbrokerapi.com/errors/ig): 132 decoded, each with what it means, and the fix where the source gives one.
- [IG API endpoints](https://openbrokerapi.com/brokers/ig/endpoints): 49 documented, each with its method, path, parameters and source.
- [IG messages](https://openbrokerapi.com/brokers/ig/messages): 5 documented, each with its fields and source.
- [IG API page](https://openbrokerapi.com/brokers/ig): The full record: access, authentication, limits and the source for each.
- [ChatGPT trading bot with the IG API, the safe way](https://openbrokerapi.com/guides/ai-trading-bot-ig-chatgpt): Guide
- [Get your IG trade history into a spreadsheet](https://openbrokerapi.com/guides/ig-trade-history): Guide
- [IG deal confirms: turning a deal reference into a result](https://openbrokerapi.com/guides/ig-deal-confirms): Guide
- [IG streaming with Python](https://openbrokerapi.com/guides/ig-lightstreamer-python): Guide

## 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: IG demo API key: how to get one and what it allows. Broker API Hub, https://openbrokerapi.com/guides/ig-demo-api-key, newest check 2026-09-19.

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.
