AI-native runtime for Capital.com trading strategies
Author Capital.com REST and WebSocket strategies in Cursor, Claude Code or any AI IDE. Deploy from GitHub into a managed cloud runtime with first-class MCP control, logs and region selection.
Section 01 · At a glance
At a glance
- Broker
- Capital.com
- Broker type
- Retail forex and CFD broker
- Asset class
- Forex, indices CFDs, commodities CFDs, share CFDs, ETF CFDs, cryptocurrency CFDs (entity-dependent)
- Supported products
- 6,000+ tradable instruments across spot FX, indices, commodities, share CFDs, ETF CFDs and (per entity) crypto CFDs. Retail-focused offering with a clean API.
- Runtime model
- Containerised strategy runtime
- Deployment source
- GitHub
- Languages
- Any language that runs in a container
- Common integrations
- Capital.com REST API, Capital.com WebSocket streaming, capitalcom-python (PyPI wrapper), official Postman collection, custom connectors
- AI workflow integration
- MCP control surface for Cursor, Claude Code, GitHub Copilot and CLI agents
- TradingHost role
- Runtime, deployment, logs, health checks, region selection, MCP control
- Capital.com role
- Broker account, API access, market access, execution venue
- Regulators
- Capital Com (UK) Limited (FCA firm reference 793714, UK); Capital Com Australia Pty Ltd (ASIC AFSL 513393); Capital Com SV Investments Limited (CySEC licence 319/17, Cyprus); Capital Com Online Investments Ltd (SCB, Bahamas); Capital Com FSA Seychelles offshore entity.
- Retail leverage caps
- UK (Capital Com UK, FCA) and EU (Capital Com SV, CySEC, ESMA-aligned): 30:1 on major FX, 20:1 on non-major FX and gold, 10:1 on non-gold commodities and non-major indices, 5:1 on stocks, 2:1 on crypto CFDs. Australia (ASIC): mirrors ESMA caps. Bahamas (SCB) and Seychelles (FSA) entities may permit higher leverage.
- Hosts
- Live REST host: api-capital.backend-capital.com. Demo REST host: demo-api-capital.backend-capital.com. WebSocket streaming endpoints are separate and documented in the open-api.capital.com reference.
- Affiliation
- TradingHost is independent and is not affiliated with Capital.com or any Capital Com entity
Section 02 · What Capital.com offers
What Capital.com offers
Capital.com offers 6,000+ tradable instruments covering FX, indices, commodities, share CFDs and ETFs through a clean REST and WebSocket API. Authentication uses a session-token model similar to IG Labs. An official Postman collection accelerates onboarding. Endpoint specifics live in open-api.capital.com.
Markets and strategy patterns
- Capital.com REST strategies on 6,000+ instruments
- 70+ FX currency pair systematic strategies
- Major and minor indices CFD breakout
- WebSocket streaming for prices and trade events
- Postman-collection-bootstrapped development
- capitalcom-python wrapper strategies
- Demo-validated deployments promoted to live
API surface
- Product surfaces
- 6,000+ tradable instruments: 70+ spot FX currency pairs, major and minor indices CFDs, commodities CFDs (metals, energies, softs), share CFDs and ETF CFDs. Crypto CFDs depend on the Capital Com entity.
- Connection methods
- Capital.com REST API for orders, accounts, positions, watchlists and market data. WebSocket streaming for real-time prices and trade events. Live host: api-capital.backend-capital.com. Demo host: demo-api-capital.backend-capital.com.
- Authentication
- Session-based authentication similar to IG Labs: X-CAP-API-KEY (long-lived API key) plus CST and X-SECURITY-TOKEN session tokens returned by POST /session. Session tokens expire and must be refreshed. Demo and live API keys are issued separately at the Capital.com developer portal.
For specifics, refer to Capital.com
The Capital.com API development guide and open-api.capital.com reference are the source of truth. The Postman collection at github.com/capital-com-sv/capital-api-postman is the fastest way to explore the surface.
- capital.com/en-int/trading-platforms/api-development-guideCapital.com API development guide
- open-api.capital.comCapital.com API reference
- help.capital.com/hc (API section)API help articles
- github.com/capital-com-sv/capital-api-postmanOfficial Postman collection
- pypi.org/project/capitalcom-pythonCommunity Python wrapper
Section 03 · Build with AI
Build your Capital.com strategy with AI
Pick an integration method, fork a TradingHost framework starter, and author your strategy in an AI IDE. The Capital.com REST + WebSocket surface is clean and well documented. The Postman collection makes onboarding faster than at most rival brokers.
Native Capital.com REST + WebSocket
Direct control over Capital.com behaviour, session tokens, account state and the WebSocket streaming surface.
capitalcom-python
Community Python wrapper around Capital.com REST and WebSocket. Convenient ergonomics for Python algo developers.
Official Postman collection
Capital.com publishes an official Postman collection. Use for interactive exploration; production strategies typically port out of Postman to code.
Custom connector
Your own Python, Java, .NET or Go integration on top of Capital.com REST and WebSocket.
Framework support for Capital.com products
Capital.com REST + WebSocket spans the full retail-CFD product surface. The capitalcom-python community wrapper mirrors REST coverage. Crypto availability depends on the Capital Com entity.
✓ confirmed support per open-api.capital.com. "entity-dependent" means availability depends on the Capital Com entity. Workflow links target /workflows/ pages currently in authoring.
TradingHost does not force a framework. It runs your project.
Author with AI
The framework starters above pair naturally with AI IDEs. The TradingHost MCP control surface closes the loop: AI tools can inspect deployments, review logs and manage the runtime alongside you, never the trade execution path.
Section 04 · Run on TradingHost
Run your code on TradingHost
Capital.com provides the broker account, REST API and WebSocket streaming. TradingHost provides the production environment where your Capital.com-connected strategy runs.
Instead of running strategy code on a laptop, desktop machine, generic VPS or manually configured server, you deploy from GitHub into a TradingHost-managed container runtime.
You
- Your repo contains your code.
- Your deployment defines how it runs.
- Your strategy connects to Capital.com via REST and WebSocket.
TradingHost
- Keeps the runtime online.
- Surfaces logs and health checks.
- Region selection.
- Controlled deployment surface.
Deployment flow
- STEP 01
Connect GitHub
Authorise TradingHost to access your GitHub account.
- STEP 02
Link a repo or start from a framework
Point TradingHost at your existing strategy repo, or fork a TradingHost Capital.com REST + WebSocket starter (capitalcom-python or your own implementation).
- STEP 03
Deploy into a TradingHost container
Pick a region (EU for Capital Com UK / Cyprus / EU traffic; US-East when paired with US market data), supply the environment values your strategy needs (X-CAP-API-KEY, account email and password for session creation, demo or live host), and deploy. TradingHost builds your container from the repo and runs your strategy on managed Kubernetes infrastructure.
- STEP 04
Monitor logs and health
Watch live logs, health and runtime state from the TradingHost dashboard. The same surface is reachable through MCP from any AI IDE, so Cursor, Claude Code or a CLI agent can read deployment state and manage the runtime alongside you.
- STEP 05
Update and redeploy
Push changes to your GitHub main branch and TradingHost redeploys automatically.
Section 05 · Operational notes
Operational notes for Capital.com
Things that bite you when you actually run a Capital.com strategy in a containerised cloud runtime. Every claim is paraphrased from Capital.com's API documentation, the published Postman collection or the relevant regulator; the deployment-side guidance is from running these strategies on TradingHost.
01 · Session auth
X-CAP-API-KEY plus CST and X-SECURITY-TOKEN on every authenticated request
Capital.com REST follows a session-token model very similar to IG Labs. The X-CAP-API-KEY is a long-lived API key registered in the Capital.com developer portal. POST /session with the API key, account email and password returns CST and X-SECURITY-TOKEN headers; subsequent authenticated calls include all three headers. CST and X-SECURITY-TOKEN expire and must be refreshed. A strategy that caches the session tokens without a refresh path will start returning 401 after the session window closes.
02 · Host split
Live and demo hosts are separate; API keys are not interchangeable
Live host: api-capital.backend-capital.com. Demo host: demo-api-capital.backend-capital.com. API keys are registered separately at the Capital.com developer portal against either the live or demo account. A live key cannot authenticate against the demo host or vice versa. Keep live and demo keys in separate TradingHost Secrets entries and never share an .env between environments.
03 · Postman onboarding
Official Postman collection at github.com/capital-com-sv accelerates first-day exploration
Capital.com publishes an official Postman collection at github.com/capital-com-sv/capital-api-postman. The collection covers every documented endpoint with example payloads and is the fastest path to a working request from a fresh API key. The typical onboarding workflow is to import the collection into Postman, set the environment variables, hit /session and start exploring; production strategies port from Postman into code, not the other way round.
04 · WebSocket streaming
Real-time prices and trade events arrive over a separate WebSocket connection
Capital.com exposes a WebSocket streaming surface for real-time prices and trade events, distinct from the REST surface. Subscribe via the documented WebSocket message protocol; do not poll REST for prices. The WebSocket connection requires the same session tokens (CST and X-SECURITY-TOKEN) for authentication. Reconnect logic must handle session-token expiry, which can happen mid-session.
05 · Multi-entity
Leverage and product availability depend on the Capital Com entity
Capital Com (UK) Limited (FCA 793714), Capital Com SV Investments Limited (CySEC 319/17), Capital Com Australia Pty Ltd (ASIC AFSL 513393), Capital Com Online Investments Ltd (Bahamas, SCB) and a Seychelles offshore entity operate separately. UK / EU / AU entities apply ESMA-aligned 30:1 majors caps. Bahamas and Seychelles entities may permit higher leverage. The API surface is the same across entities, but a strategy that hard-codes leverage assumes the entity.
06 · Trade reporting
EMIR, MiFID II and ASIC reporting is Capital.com's responsibility
Capital Com (UK) Limited reports under FCA / MiFID II / EMIR rules. Capital Com SV Investments Limited reports under CySEC / MiFID II / EMIR rules. Capital Com Australia Pty Ltd reports under ASIC derivative trade-reporting rules. Bahamas and Seychelles entities follow their local regulators. TradingHost does not perform regulatory trade reporting on your behalf and is not a reporting service. The strategy code you run on TradingHost is your own algorithmic activity; reporting attaches to the Capital Com entity holding the account.
SourceFCA register
Section 06 · Built for
Built for
TradingHost Capital.com runtimes are best suited to:
- Developers building strategies in AI IDEs (Cursor, Claude Code)
- Retail CFD systematic and quant traders
- Python developers using capitalcom-python
- Postman-first API explorers porting to production
- Teams moving from MetaTrader and VPS hosting to containerised deployment
Connecting GitHub and creating your first strategy is free.
Section 08 · FAQ
FAQ
No. TradingHost is independent and is not affiliated with Capital.com or any Capital Com entity.
No. TradingHost is not a broker and is not a registered investment firm. TradingHost is a cloud runtime that runs your strategy code. The broker relationship, the account, the leverage, the execution and the regulatory protections all live with the Capital Com entity that holds your account.
No. Your strategy code connects to Capital.com REST and WebSocket and sends instructions according to your own logic. TradingHost provides the runtime where that code runs.
No. Capital.com REST and WebSocket access is provided by Capital.com. You register an X-CAP-API-KEY in the Capital.com developer portal. You are responsible for your Capital.com account, credentials and compliance with Capital.com's terms.
Yes. The community Python wrapper capitalcom-python wraps Capital.com REST and WebSocket with idiomatic Python. Or call Capital.com REST directly with any HTTP client.
Yes. TradingHost supports any language that can run inside a container. Capital.com REST is HTTP and the streaming surface is WebSocket, so any language with HTTP and WebSocket clients works.
Open a Capital.com account, register an X-CAP-API-KEY in the developer portal. Import the official Postman collection to explore the surface. Fork a TradingHost Capital.com starter, or connect your own GitHub strategy repo. Linking a GitHub repo and creating a strategy is free; runtime plans are listed on the pricing page.
Yes. Leverage is set by the Capital Com entity. Capital Com (UK) Limited (FCA) and Capital Com SV (CySEC) apply ESMA-aligned caps (30:1 majors). Capital Com Australia Pty Ltd (ASIC) mirrors. Capital Com Online Investments Ltd (Bahamas, SCB) and the Seychelles offshore entity may permit higher leverage. The API surface is the same across entities.
In your GitHub-controlled secrets workflow. TradingHost reads the X-CAP-API-KEY plus the account email and password (used to create a session) at runtime through GitHub repository secrets. CST and X-SECURITY-TOKEN are session tokens, not secrets, and live in process memory.
Yes. TradingHost supports MCP-based control for AI IDEs including Cursor, Claude Code, GitHub Copilot and CLI-based AI agents. MCP is a control and observability surface, not the trade execution path.
No. EMIR and MiFID II trade reporting is the broker's responsibility. Capital Com (UK) Limited reports under FCA / MiFID II / EMIR rules. Capital Com SV reports under CySEC / MiFID II / EMIR rules. Capital Com Australia reports under ASIC derivative trade-reporting rules. TradingHost runs your code; the Capital Com entity handles regulatory reporting.
No. TradingHost is focused on production runtime and deployment. Backtesting belongs in your research stack or AlgoBuilder.