Quick answer
IG’s REST trading API (labs.ig.com) trades FX, indices, commodities, shares and options as CFDs or spread bets, with Lightstreamer for streaming and a demo environment. You authenticate with an API key plus your IG username and password to open a session. Default quotas include 60 non-trading requests per minute per app and 10,000 historical price points per week.
IG API at a glance
- Pricing
- API free; 10k historical points/week
- Availability
- UK, EU, AU, SG, US (forex only) and more
- Paper trading
- Demo account (demo-api.ig.com)
- Integration type
- REST + API key
- In AlgoGP
- Design and backtest in AlgoGP, connect the exported code
- Live base
https://api.ig.com/gateway/deal- Demo base
https://demo-api.ig.com/gateway/deal- Auth
X-IG-API-KEY+ session (CST and X-SECURITY-TOKEN)- Streaming
- Lightstreamer, 40 subscriptions
- History
- 10,000 price points per week
Quotas and history depth
- Per app, non-trading requests: 60 per minute.
- Per account, trading requests: 100 per minute; non-trading: 30 per minute.
- Historical prices: 10,000 data points per week.
- Approximate depth: ~4 days of 1-second, ~40 days of 1-minute, ~360 days of several intraday resolutions, ~15 years daily.
Sessions
POST /session with your username and password and the X-IG-API-KEY header. The response headers CST and X-SECURITY-TOKEN authenticate later calls; send them with every request until the session expires.
Build an IG strategy with AlgoGP
AlgoGP does not connect to IG natively yet. IG uses plain HTTPS with an API key, so it is a good candidate for a native adapter; it is not built in yet.
- 1
Design and backtest in AlgoGP
Describe the strategy to the copilot and backtest it on years of normalized history. The result does not depend on any vendor.
- 2
Export the Python project
Every project exports
strategy.py,market_data.py,brokers.pyandlive.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format. - 3
Plug in IG
Implement the four adapter methods (
account,positions,submit_market_orderand a candle fetcher) with IG’s SDK, or keep a built-in platform for paper trading and add IG when you go live.
Built-in brokers for the same markets: Alpaca, OANDA, Tradier, OKX.
IG API: frequently asked questions
Is the IG API free?
Yes; there is no separate fee within the default quotas. Spreads and financing apply to trades.
Does IG have a demo API?
Yes, at demo-api.ig.com, with a separate demo account and API key.
Can I stream prices without Lightstreamer?
Not from IG directly; streaming uses Lightstreamer. Polling REST works for slower strategies.
Design and backtest your IG strategy first
AlgoGP turns an idea into Python and tests it on years of history before you connect it to IG. The exported code keeps the broker behind four small adapter methods.
- AI copilot writes and revises the rules
- Backtests with realistic costs
- Exported Python ready to wire to IG
Free plan, no card required.
IG alternatives
- OANDA API Built into AlgoGPRegulated forex and CFD broker whose v20 REST API serves both orders and candles, with a free demo account.
- Saxo OpenAPI GuideThe API behind SaxoTraderGO: multi-asset trading in stocks, ETFs, options, futures, FX and CFDs, with a simulation environment.
- cTrader Open API GuideSpotware’s API for cTrader brokers: FX and CFD trading and data over TCP or WebSocket, JSON or Protobuf, with OAuth.
- Interactive Brokers API GuideThe broadest multi-asset broker API: stocks, options, futures, FX and bonds on 150+ markets, through TWS or IB Gateway.
Independent guide. AlgoGP is not affiliated with IG. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.