# Capital.com API: limits, auth and errors

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/brokers/capital-com, 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.

Public REST API and WebSocket feed for Capital.com CFD accounts, live and demo.

- Kind: Broker API
- Newest reading: 2026-10-12
- Official documentation: [open-api.capital.com](https://open-api.capital.com/)
- Everything recorded for Capital.com, as one JSON file: https://openbrokerapi.com/data/brokers/capital-com.json
- Quickstart, key to first call: https://openbrokerapi.com/brokers/capital-com/quickstart

## Capital.com API rate limits and allowances

One record per limit. The scope is part of the limit: a figure without its scope is not a figure you can pace against.

- Headline limit: 10/s per user
  - Scope: user
  - Status: verified. Source: [open-api.capital.com](https://open-api.capital.com/), checked 2026-09-18.
  - Note: Orders and new positions: 1 per 0.1 s. POST /session: 1 a second per API key. Demo: 1000 an hour for POST /positions and /workingorders.

[Capital.com API rate limits in full](https://openbrokerapi.com/brokers/capital-com/rate-limits), with the related error codes.

## Access, authentication and streaming

- How you get a key: Enable 2FA, then Settings > API integrations > Generate new key, with a custom key password.
  - Status: verified. Source: [Capital.com Public API](https://open-api.capital.com/), checked 2026-10-12.
- Who can use it: Any Capital.com account (demo or live) with 2FA enabled. Regional limits not published.
  - Status: verified. Source: [Capital.com Public API](https://open-api.capital.com/), checked 2026-10-12.
- Demo: Yes: separate demo base URL.
  - Status: verified. Source: [Capital.com Public API](https://open-api.capital.com/), checked 2026-10-12.
- Authentication: POST /session with the X-CAP-API-KEY header plus login credentials returns CST and X-SECURITY-TOKEN, sent on later calls. The session expires after 10 minutes of inactivity.
  - Status: verified. Source: [Capital.com Public API](https://open-api.capital.com/), checked 2026-10-12.
- Streaming: WebSocket wss://api-streaming-capital.backend-capital.com/connect, maximum of 40 epics per subscription; the session lasts 10 minutes and is kept alive with ping.
  - Status: verified. Source: [Capital.com Public API](https://open-api.capital.com/), checked 2026-10-12.
- History depth: Candles: max 1,000 per request (default 10), MINUTE to WEEK. Activity history: max 1 day per from/to call. Transactions default to last 10 minutes.
  - Status: verified. Source: [Capital.com API reference](https://open-api.capital.com/), checked 2026-10-12.
  - Status: verified. Source: [Capital.com official Postman collection](https://github.com/capital-com-sv/capital-api-postman/blob/main/capital.collection.json), checked 2026-09-22.
- Rate limits, as worded: Re-verified verbatim on 19 Sep 2026. 10 requests per second per user; 1 request per 0.1 seconds per user when opening positions or creating orders, which is an order limit and not a session limit; POST /session 1 request per second per API key; on demo, POST /positions and /workingorders are capped at 1000 requests per hour; API key generation 100 attempts per 24 hours. HTTP 429 when exceeded. New on 20 Sep 2026: the demo topUp endpoint is capped at 10 requests a second and 100 requests per account a day.
  - Status: verified. Source: [Capital.com Open API documentation](https://open-api.capital.com/), checked 2026-10-12.

## Capital.com API endpoints

36 documented endpoints. [Grouped by what they do](https://openbrokerapi.com/brokers/capital-com/endpoints).

- [GET /api/v1/accounts](https://openbrokerapi.com/brokers/capital-com/endpoints/accounts): List every financial account for the logged in client, with balance, deposit, profit and loss and available funds.
- [GET /api/v1/accounts/preferences](https://openbrokerapi.com/brokers/capital-com/endpoints/accounts-preferences): Read the account's trading preferences: whether hedging mode is on, and the leverage in use and on offer for each asset class.
- [PUT /api/v1/accounts/preferences](https://openbrokerapi.com/brokers/capital-com/endpoints/put-accounts-preferences): Change the account's trading preferences: the leverage per asset class, the hedging mode, or both.
- [POST /api/v1/accounts/topUp](https://openbrokerapi.com/brokers/capital-com/endpoints/post-accounts-top-up): Add to or take from the balance of the current demo account. Demo only: it moves no real money.
- [GET /api/v1/clientsentiment](https://openbrokerapi.com/brokers/capital-com/endpoints/client-sentiment-list): The share of clients holding long and short positions in each of a list of markets, as two percentages per market.
- [GET /api/v1/clientsentiment/{marketId}](https://openbrokerapi.com/brokers/capital-com/endpoints/client-sentiment): Share of Capital.com clients long and short on one market. GET /api/v1/clientsentiment?marketIds= takes a comma separated list.
- [GET /api/v1/confirms/{dealReference}](https://openbrokerapi.com/brokers/capital-com/endpoints/confirms): Check whether a deal was accepted or rejected. For a new position, the opened deal IDs are in affectedDeals.
- [GET /api/v1/history/activity](https://openbrokerapi.com/brokers/capital-com/endpoints/history-activity): Account activity such as orders and positions, with optional detail and FIQL filtering. Default is the last 10 minutes.
- [GET /api/v1/history/transactions](https://openbrokerapi.com/brokers/capital-com/endpoints/history-transactions): Money movements: trades, swaps, deposits, withdrawals and fees. Default is the last 10 minutes.
- [GET /api/v1/marketnavigation](https://openbrokerapi.com/brokers/capital-com/endpoints/marketnavigation): The top level of the market navigation tree: one node per market category, each with an identifier to browse into.
- [GET /api/v1/marketnavigation/{nodeId}](https://openbrokerapi.com/brokers/capital-com/endpoints/marketnavigation-by-node): The nodes and markets beneath one node of the market navigation tree. Walk it from the top level to reach the epics in a category.
- [GET /api/v1/markets](https://openbrokerapi.com/brokers/capital-com/endpoints/markets): Search markets by term or fetch up to 50 epics at once. With no query it returns every market.
- [GET /api/v1/markets/{epic}](https://openbrokerapi.com/brokers/capital-com/endpoints/market): Full details for one market: instrument, dealing rules, opening hours and a price snapshot.
- [GET /api/v1/ping](https://openbrokerapi.com/brokers/capital-com/endpoints/ping): Ping the service to keep a trading session alive. Call it at least once every 10 minutes when idle.
- [GET /api/v1/positions](https://openbrokerapi.com/brokers/capital-com/endpoints/positions): All open positions on the active account, each with position and market details.
- [POST /api/v1/positions](https://openbrokerapi.com/brokers/capital-com/endpoints/post-positions): Open a position at market. The response is only a dealReference: confirm the result with GET /api/v1/confirms/{dealReference}.
- [DELETE /api/v1/positions/{dealId}](https://openbrokerapi.com/brokers/capital-com/endpoints/delete-position): Close an open position by dealId. Confirm the close with GET /api/v1/confirms/{dealReference}.
- [GET /api/v1/positions/{dealId}](https://openbrokerapi.com/brokers/capital-com/endpoints/position): One open position by its dealId.
- [PUT /api/v1/positions/{dealId}](https://openbrokerapi.com/brokers/capital-com/endpoints/put-position): Amend an open position: move or add its stop loss and take profit, or switch to a guaranteed or trailing stop. Confirm with GET /api/v1/confirms/{dealReference}.
- [GET /api/v1/prices/{epic}](https://openbrokerapi.com/brokers/capital-com/endpoints/prices): Historical bid and ask candles for one epic. By default, minute prices for the last 10 minutes.
- [DELETE /api/v1/session](https://openbrokerapi.com/brokers/capital-com/endpoints/delete-session): Log out of the current session. The CST and X-SECURITY-TOKEN tokens stop working.
- [GET /api/v1/session](https://openbrokerapi.com/brokers/capital-com/endpoints/session): Read the current session: client ID, active account, locale, currency and the streaming endpoint.
- [POST /api/v1/session](https://openbrokerapi.com/brokers/capital-com/endpoints/post-session): Log in with your API key, login identifier and API key password. The CST and X-SECURITY-TOKEN tokens come back in the response headers.
- [PUT /api/v1/session](https://openbrokerapi.com/brokers/capital-com/endpoints/put-session): Switch the session to another of your financial accounts. Later calls then act on that account.
- [GET /api/v1/session/encryptionKey](https://openbrokerapi.com/brokers/capital-com/endpoints/session-encryption-key): Fetch the key and timestamp used to send the API key password in encrypted form when starting a session. Only the encrypted login route needs it.
- [GET /api/v1/time](https://openbrokerapi.com/brokers/capital-com/endpoints/time): The server's current time as a millisecond timestamp. The reference says no authentication is needed, so it doubles as a connectivity test.
- [GET /api/v1/watchlists](https://openbrokerapi.com/brokers/capital-com/endpoints/watchlists): Every watchlist on your account. Open one with GET /api/v1/watchlists/{watchlistId}.
- [POST /api/v1/watchlists](https://openbrokerapi.com/brokers/capital-com/endpoints/post-watchlists): Create a watchlist with a name and, if you wish, a first set of markets.
- [DELETE /api/v1/watchlists/{watchlistId}](https://openbrokerapi.com/brokers/capital-com/endpoints/delete-watchlist-by-id): Delete a watchlist. The list itself is removed, not the markets or any position in them.
- [GET /api/v1/watchlists/{watchlistId}](https://openbrokerapi.com/brokers/capital-com/endpoints/watchlist-by-id): The markets in one watchlist, each with its epic, name, status and current bid and offer.
- [PUT /api/v1/watchlists/{watchlistId}](https://openbrokerapi.com/brokers/capital-com/endpoints/put-watchlist-by-id): Add one market to an existing watchlist, by its epic.
- [DELETE /api/v1/watchlists/{watchlistId}/{epic}](https://openbrokerapi.com/brokers/capital-com/endpoints/delete-watchlist-epic): Take one market out of a watchlist. The watchlist and its other markets stay as they are.
- [GET /api/v1/workingorders](https://openbrokerapi.com/brokers/capital-com/endpoints/working-orders): All open limit and stop orders on the active account.
- [POST /api/v1/workingorders](https://openbrokerapi.com/brokers/capital-com/endpoints/post-working-orders): Create a LIMIT or STOP order at a price level, optionally with a cancellation date, stop loss and take profit.
- [DELETE /api/v1/workingorders/{dealId}](https://openbrokerapi.com/brokers/capital-com/endpoints/delete-working-order): Cancel an open limit or stop order by its dealId.
- [PUT /api/v1/workingorders/{dealId}](https://openbrokerapi.com/brokers/capital-com/endpoints/put-working-order): Amend a LIMIT or STOP working order: its price level, cancellation date, stop loss or take profit.

## Capital.com messages

7 documented messages. They are not HTTP endpoints: none has a method or a path. [Grouped by what they do](https://openbrokerapi.com/brokers/capital-com/messages).

- [marketData.subscribe](https://openbrokerapi.com/brokers/capital-com/messages/marketdata-subscribe) (Capital.com WebSocket API): Subscribes to live price updates for a list of epics. Capital.com's page gives 40 as the most epics. An answer confirms each epic, then a quote message arrives for each price update.
- [marketData.unsubscribe](https://openbrokerapi.com/brokers/capital-com/messages/marketdata-unsubscribe) (Capital.com WebSocket API): Stops live price updates for a list of epics. An answer confirms each epic that was unsubscribed.
- [ohlc.event](https://openbrokerapi.com/brokers/capital-com/messages/ohlc-event) (Capital.com WebSocket API): Carries one candlestick bar update for an epic subscribed to with OHLCMarketData.subscribe: the open, high, low and close for one resolution and bar type.
- [OHLCMarketData.subscribe](https://openbrokerapi.com/brokers/capital-com/messages/ohlcmarketdata-subscribe) (Capital.com WebSocket API): Subscribes to candlestick bar updates for a list of epics, at chosen resolutions and for a chosen bar type. An answer confirms each combination, then an ohlc.event message arrives for each update.
- [OHLCMarketData.unsubscribe](https://openbrokerapi.com/brokers/capital-com/messages/ohlcmarketdata-unsubscribe) (Capital.com WebSocket API): Stops candlestick bar updates. You unsubscribe from what you name: an epic alone stops every resolution and bar type for that epic.
- [ping](https://openbrokerapi.com/brokers/capital-com/messages/ping) (Capital.com WebSocket API): Keeps the WebSocket connection alive. Capital.com's page says to send it at least once every 10 minutes. It carries the two session tokens and no payload.
- [quote](https://openbrokerapi.com/brokers/capital-com/messages/quote) (Capital.com WebSocket API): Carries one price update for an epic subscribed to with marketData.subscribe: the bid, the offer, the size at each and the time.

## Capital.com API error codes

24 decoded error codes. [All Capital.com errors](https://openbrokerapi.com/errors/capital-com).

- [error.account.limit.reached](https://openbrokerapi.com/errors/capital-com/account-limit-reached): The demo account's balance cap has been reached, so it cannot be topped up further.
- [error.invalid.account](https://openbrokerapi.com/errors/capital-com/invalid-account): The account selected for a demo balance top up is not valid.
- [error.invalid.accountId](https://openbrokerapi.com/errors/capital-com/invalid-accountid): The account id sent when switching the active account is not valid.
- [error.invalid.amount](https://openbrokerapi.com/errors/capital-com/invalid-amount): The amount in a demo balance top up request is not valid.
- [error.invalid.details](https://openbrokerapi.com/errors/capital-com/invalid-details): Invalid credentials on session creation.
- [error.invalid.from](https://openbrokerapi.com/errors/capital-com/invalid-from): The from parameter of an activity history request is not valid.
- [error.invalid.leverage.value](https://openbrokerapi.com/errors/capital-com/invalid-leverage-value): A leverage value sent when updating account preferences is not valid.
- [error.invalid.limit](https://openbrokerapi.com/errors/capital-com/invalid-limit): The limit parameter of a market navigation request is not valid.
- [error.invalid.resolution](https://openbrokerapi.com/errors/capital-com/invalid-resolution): The resolution of a price history request is not valid.
- [error.invalid.stoploss.maxvalue](https://openbrokerapi.com/errors/capital-com/invalid-stoploss-maxvalue): The stop loss value is too high.
- [error.invalid.stoploss.minvalue](https://openbrokerapi.com/errors/capital-com/invalid-stoploss-minvalue): Stop loss too close to the price (the minimum is appended to the code).
- [error.invalid.takeprofit.maxvalue](https://openbrokerapi.com/errors/capital-com/invalid-takeprofit-maxvalue): The take profit value is too high.
- [error.invalid.takeprofit.minvalue](https://openbrokerapi.com/errors/capital-com/invalid-takeprofit-minvalue): The take profit value is too low.
- [error.invalid.watchlist](https://openbrokerapi.com/errors/capital-com/invalid-watchlist): The watchlist id is not valid.
- [error.not-found.dealId](https://openbrokerapi.com/errors/capital-com/not-found-dealid): Position or working order not found.
- [error.not-found.dealReference](https://openbrokerapi.com/errors/capital-com/not-found-dealreference): No confirmation was found for the deal reference given.
- [error.not-found.epic](https://openbrokerapi.com/errors/capital-com/not-found-epic): Market not found.
- [error.not-found.watchlist](https://openbrokerapi.com/errors/capital-com/not-found-watchlist): The watchlist was not found.
- [error.not-in-future.goodTillDate](https://openbrokerapi.com/errors/capital-com/not-in-future-goodtilldate): The goodTillDate of a working order is not in the future.
- [error.null.api.key](https://openbrokerapi.com/errors/capital-com/null-api-key): X-CAP-API-KEY header missing.
- [error.null.epic](https://openbrokerapi.com/errors/capital-com/null-epic): The epics parameter was sent empty.
- [error.null.searchTerm](https://openbrokerapi.com/errors/capital-com/null-searchterm): The searchTerm parameter was sent empty.
- [error.size.createwatchlistrequest.name](https://openbrokerapi.com/errors/capital-com/size-watchlist-name): The name in a create watchlist request is not an accepted size.
- [error.too-many.requests](https://openbrokerapi.com/errors/capital-com/too-many-requests): Request limit exceeded: 10 requests per second per user, 1 per second for POST /session per API key, and 1 per 0.1 s for position and order calls.

## Platform APIs an account here can reach

- [MetaTrader 4 (MQL4)](https://openbrokerapi.com/platforms/metatrader-4): offered. MT4 offered; Expert Advisors allowed ('Expert advisors execute according to rules set in advance'), with a disclaimer that Capital.com is not responsible for EA performance.
  - Status: verified. Source: [Capital.com UK MT4](https://capital.com/en-gb/trading-platforms/mt4), checked 2026-09-18.
- [MetaTrader 5 (Python package and MQL5)](https://openbrokerapi.com/platforms/metatrader-5): not verified. Not listed on the UK platforms page (lists web, app, TradingView, MT4, API). The MetaQuotes MT5 broker directory lists a 'Capital.com UK' card, so status is unclear; the en-gb MT5 URL returned 404.
  - Status: unverified. Source: [MetaTrader 5 find a broker (MetaQuotes)](https://www.metatrader5.com/en/find-broker), checked 2026-09-18.
- [cTrader Open API](https://openbrokerapi.com/platforms/ctrader): not offered. cTrader not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.
  - Status: unverified. Source: [Capital.com UK trading platforms](https://capital.com/en-gb/trading-platforms), checked 2026-09-18.
- [TradeLocker API](https://openbrokerapi.com/platforms/tradelocker): not offered. TradeLocker not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.
  - Status: unverified. Source: [Capital.com UK trading platforms](https://capital.com/en-gb/trading-platforms), checked 2026-09-18.
- [Match-Trader Platform API](https://openbrokerapi.com/platforms/match-trader): not offered. Match-Trader not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.
  - Status: unverified. Source: [Capital.com UK trading platforms](https://capital.com/en-gb/trading-platforms), checked 2026-09-18.
- [DXtrade APIs](https://openbrokerapi.com/platforms/dxtrade): not offered. DXtrade not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.
  - Status: unverified. Source: [Capital.com UK trading platforms](https://capital.com/en-gb/trading-platforms), checked 2026-09-18.

## Capital.com API SDKs and wrappers

- capital-api-postman (Postman, Official): Official Postman collection; 14 forks, 4 open issues.
  - Status: verified. Source: [github.com](https://github.com/capital-com-sv/capital-api-postman), checked 2026-09-18.
- capital-mcp (Python, Community): MCP server for the Open API, published on Capital.com's own GitHub organisation while the README disclaims Capital.com's control, development, endorsement and liability. Trading tools are disabled by default.
  - Status: verified. Source: [github.com](https://github.com/capital-com-sv/capital-mcp), checked 2026-09-18.
- api-java-samples (Java, Official)
  - Status: unverified. Source: [github.com](https://github.com/capital-com-sv/api-java-samples), no checked date recorded.
- capitalcom-python (Python, Community): Unofficial wrapper, no release since 0.2.3 (Dec 2023).
  - Status: verified. Source: [pypi.org](https://pypi.org/project/capitalcom-python/), checked 2026-09-18.

## Capital.com API: questions and answers

### Does Capital.com have an API?

Yes. This register records Capital.com as having its own API (REST and WebSocket), with availability marked as active. Public REST API and WebSocket feed for Capital.com CFD accounts, live and demo.

- Status: verified. Source: [Capital.com: public API docs](https://open-api.capital.com/), checked 2026-10-12.

### Capital.com API key: how do I get one?

Enable 2FA, then Settings > API integrations > Generate new key, with a custom key password.

- Status: verified. Source: [Capital.com Public API](https://open-api.capital.com/), checked 2026-10-12.

### Who can use the Capital.com API?

Any Capital.com account (demo or live) with 2FA enabled. Regional limits not published.

- Status: verified. Source: [Capital.com Public API](https://open-api.capital.com/), checked 2026-10-12.

### Capital.com API demo: is there a demo or sandbox?

Yes: separate demo base URL.

- Status: verified. Source: [Capital.com Public API](https://open-api.capital.com/), checked 2026-10-12.

### What are the Capital.com API rate limits?

Headline limit: 10/s per user. Scope: user. As the record words it: Re-verified verbatim on 19 Sep 2026.

- Status: verified. Source: [open-api.capital.com](https://open-api.capital.com/), checked 2026-09-18.
- Status: verified. Source: [Capital.com Open API documentation](https://open-api.capital.com/), checked 2026-10-12.

### How does Capital.com API authentication work?

POST /session with the X-CAP-API-KEY header plus login credentials returns CST and X-SECURITY-TOKEN, sent on later calls. The session expires after 10 minutes of inactivity.

- Status: verified. Source: [Capital.com Public API](https://open-api.capital.com/), checked 2026-10-12.

### Does the Capital.com API support streaming?

WebSocket wss://api-streaming-capital.backend-capital.com/connect, maximum of 40 epics per subscription; the session lasts 10 minutes and is kept alive with ping.

- Status: verified. Source: [Capital.com Public API](https://open-api.capital.com/), checked 2026-10-12.

### How much history does the Capital.com API return?

Candles: max 1,000 per request (default 10), MINUTE to WEEK. Activity history: max 1 day per from/to call. Transactions default to last 10 minutes.

- Status: verified. Source: [Capital.com API reference](https://open-api.capital.com/), checked 2026-10-12.
- Status: verified. Source: [Capital.com official Postman collection](https://github.com/capital-com-sv/capital-api-postman/blob/main/capital.collection.json), checked 2026-09-22.

### Is there a Python library for the Capital.com API?

This register lists these Python libraries for the Capital.com API. capital-mcp (community, Python): MCP server for the Open API, published on Capital.com's own GitHub organisation while the README disclaims Capital.com's control, development, endorsement and liability. Trading tools are disabled by default. capitalcom-python (community, Python): Unofficial wrapper, no release since 0.2.3 (Dec 2023).

- Status: verified. Source: [capital-mcp](https://github.com/capital-com-sv/capital-mcp), checked 2026-09-18.
- Status: verified. Source: [capitalcom-python](https://pypi.org/project/capitalcom-python/), checked 2026-09-18.

### Which platform APIs work with an account at Capital.com?

Recorded as offered, with a source: MetaTrader 4. Not verified either way: MetaTrader 5, cTrader, TradeLocker, Match-Trader and DXtrade.

- Status: verified. Source: [Capital.com UK MT4](https://capital.com/en-gb/trading-platforms/mt4), checked 2026-09-18.

[Capital.com API questions, each answered in a sentence or two](https://openbrokerapi.com/answers/capital-com).

## Partner programme

No published figure. [The Capital.com partner programme record](https://openbrokerapi.com/partners/capital-com). This site carries no affiliate links.

## Licence and how to cite

The limit records on this page come from the limits register, which is CC BY 4.0 (https://openbrokerapi.com/data/limits.json). Everything else on it comes from records that are all rights reserved. This file is the page itself, at its own address, in another format, and it is not part of the CC BY 4.0 downloads listed at https://openbrokerapi.com/data.

Cite as: Capital.com API: limits, auth and errors. Broker API Hub, https://openbrokerapi.com/brokers/capital-com, newest check 2026-10-12.

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.
