Broker API
Capital.com API: limits, auth and errors
Public REST API and WebSocket feed for Capital.com CFD accounts, live and demo.
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.
Quickstart: key to first call36 endpoints7 messages24 error codes
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.
| Limit | Value | Scope | Source |
|---|---|---|---|
| Headline limit | 10/s per user | user | open-api.capital.comchecked |
Capital.com API rate limits in full, with pacing advice and the related error codes.
Access, authentication and streaming
API types listed in the record: REST, WebSocket.
- How you get a key
Enable 2FA, then Settings > API integrations > Generate new key, with a custom key password.
Capital.com Public APIchecked
- Who can use it
Any Capital.com account (demo or live) with 2FA enabled. Regional limits not published.
Capital.com Public APIchecked
- Demo
Yes: separate demo base URL.
Capital.com Public APIchecked
- 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.
Capital.com Public APIchecked
- 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.
Capital.com Public APIchecked
- 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.
Capital.com API referencechecked Capital.com official Postman collectionchecked
- 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.
Capital.com API endpoints
36 documented endpoints. Grouped by what they do
- GET/api/v1/accountsList every financial account for the logged in client, with balance, deposit, profit and loss and available funds.
- GET/api/v1/accounts/preferencesRead 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/preferencesChange the account's trading preferences: the leverage per asset class, the hedging mode, or both.
- POST/api/v1/accounts/topUpAdd to or take from the balance of the current demo account. Demo only: it moves no real money.
- GET/api/v1/clientsentimentThe 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}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}Check whether a deal was accepted or rejected. For a new position, the opened deal IDs are in affectedDeals.
- GET/api/v1/history/activityAccount activity such as orders and positions, with optional detail and FIQL filtering. Default is the last 10 minutes.
- GET/api/v1/history/transactionsMoney movements: trades, swaps, deposits, withdrawals and fees. Default is the last 10 minutes.
- GET/api/v1/marketnavigationThe top level of the market navigation tree: one node per market category, each with an identifier to browse into.
- GET/api/v1/marketnavigation/{nodeId}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/marketsSearch markets by term or fetch up to 50 epics at once. With no query it returns every market.
- GET/api/v1/markets/{epic}Full details for one market: instrument, dealing rules, opening hours and a price snapshot.
- GET/api/v1/pingPing the service to keep a trading session alive. Call it at least once every 10 minutes when idle.
- GET/api/v1/positionsAll open positions on the active account, each with position and market details.
- POST/api/v1/positionsOpen a position at market. The response is only a dealReference: confirm the result with GET /api/v1/confirms/{dealReference}.
- DELETE/api/v1/positions/{dealId}Close an open position by dealId. Confirm the close with GET /api/v1/confirms/{dealReference}.
- GET/api/v1/positions/{dealId}One open position by its dealId.
- PUT/api/v1/positions/{dealId}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}Historical bid and ask candles for one epic. By default, minute prices for the last 10 minutes.
- DELETE/api/v1/sessionLog out of the current session. The CST and X-SECURITY-TOKEN tokens stop working.
- POST/api/v1/sessionLog 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/sessionSwitch the session to another of your financial accounts. Later calls then act on that account.
- GET/api/v1/sessionRead the current session: client ID, active account, locale, currency and the streaming endpoint.
- GET/api/v1/session/encryptionKeyFetch 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/timeThe server's current time as a millisecond timestamp. The reference says no authentication is needed, so it doubles as a connectivity test.
- POST/api/v1/watchlistsCreate a watchlist with a name and, if you wish, a first set of markets.
- GET/api/v1/watchlistsEvery watchlist on your account. Open one with GET /api/v1/watchlists/{watchlistId}.
- DELETE/api/v1/watchlists/{watchlistId}Delete a watchlist. The list itself is removed, not the markets or any position in them.
- PUT/api/v1/watchlists/{watchlistId}Add one market to an existing watchlist, by its epic.
- GET/api/v1/watchlists/{watchlistId}The markets in one watchlist, each with its epic, name, status and current bid and offer.
- DELETE/api/v1/watchlists/{watchlistId}/{epic}Take one market out of a watchlist. The watchlist and its other markets stay as they are.
- POST/api/v1/workingordersCreate a LIMIT or STOP order at a price level, optionally with a cancellation date, stop loss and take profit.
- GET/api/v1/workingordersAll open limit and stop orders on the active account.
- DELETE/api/v1/workingorders/{dealId}Cancel an open limit or stop order by its dealId.
- PUT/api/v1/workingorders/{dealId}Amend a LIMIT or STOP working order: its price level, cancellation date, stop loss or take profit.
Capital.com messages
7 documented messages and subscriptions of the Capital.com WebSocket API. They are not HTTP endpoints: none has a method or a path, and each travels over a connection that stays open. Grouped by what they do, each with its summary
Capital.com API error codes
24 decoded error codes. All Capital.com errors
error.The demo account's balance cap has been reached, so it cannot be topped up further.account. limit. reached error.The account selected for a demo balance top up is not valid.invalid. account error.The account id sent when switching the active account is not valid.invalid. accountId error.The amount in a demo balance top up request is not valid.invalid. amount error.Invalid credentials on session creation.invalid. details error.The from parameter of an activity history request is not valid.invalid. from error.A leverage value sent when updating account preferences is not valid.invalid. leverage. value error.The limit parameter of a market navigation request is not valid.invalid. limit error.The resolution of a price history request is not valid.invalid. resolution error.The stop loss value is too high.invalid. stoploss. maxvalue error.Stop loss too close to the price (the minimum is appended to the code).invalid. stoploss. minvalue error.The take profit value is too high.invalid. takeprofit. maxvalue error.The take profit value is too low.invalid. takeprofit. minvalue error.The watchlist id is not valid.invalid. watchlist error.Position or working order not found.not- found. dealId error.No confirmation was found for the deal reference given.not- found. dealReference error.Market not found.not- found. epic error.The watchlist was not found.not- found. watchlist error.The goodTillDate of a working order is not in the future.not- in- future. goodTillDate error.X-CAP-API-KEY header missing.null. api. key error.The epics parameter was sent empty.null. epic error.The searchTerm parameter was sent empty.null. searchTerm error.The name in a create watchlist request is not an accepted size.size. createwatchlistrequest. name error.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.too- many. requests
Platform APIs an account here can reach
| Platform API | Offered | Note | Source |
|---|---|---|---|
| MetaTrader 4 (MQL4) | Yes | 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. | Capital.com UK MT4checked |
| MetaTrader 5 (Python package and MQL5) | 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. | UnverifiedMetaTrader 5 find a broker (MetaQuotes)checked |
| cTrader Open API | No | cTrader not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified. | UnverifiedCapital.com UK trading platformschecked |
| TradeLocker API | No | TradeLocker not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified. | UnverifiedCapital.com UK trading platformschecked |
| Match-Trader Platform API | No | Match-Trader not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified. | UnverifiedCapital.com UK trading platformschecked |
| DXtrade APIs | No | DXtrade not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified. | UnverifiedCapital.com UK trading platformschecked |
Capital.com API SDKs and wrappers
| Library | Language | Official | Note | Source |
|---|---|---|---|---|
| capital-api-postman | Postman | Official | Official Postman collection; 14 forks, 4 open issues. | github.comchecked |
| 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. | github.comchecked |
| api-java-samples | Java | Official | Not recorded | Unverifiedgithub.com |
| capitalcom-python | Python | Community | Unofficial wrapper, no release since 0.2.3 (Dec 2023). | pypi.orgchecked |
Capital.com API: questions and answers
Each answer is read from the record on this page, not written separately. Where the record is unverified, the answer says so.
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.
Capital.com: public API docschecked
Capital.com API key: how do I get one?
Enable 2FA, then Settings > API integrations > Generate new key, with a custom key password.
Capital.com Public APIchecked
Who can use the Capital.com API?
Any Capital.com account (demo or live) with 2FA enabled. Regional limits not published.
Capital.com Public APIchecked
Capital.com API demo: is there a demo or sandbox?
Yes: separate demo base URL.
Capital.com Public APIchecked
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.
open-api.capital.comchecked Capital.com Open API documentationchecked
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.
Capital.com Public APIchecked
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.
Capital.com Public APIchecked
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.
Capital.com API referencechecked Capital.com official Postman collectionchecked
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).
capital-mcpchecked capitalcom-pythonchecked
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.
Capital.com UK MT4checked
Capital.com API questions, each answered in a sentence or two.
The capability tables read one feature at a time across every broker and platform record, Capital.com included.
Everything this site records for Capital.com, as one JSON file. Each section of the file states its own licence. About the files. This page as Markdown.
Capital.com API guides and reference
- Capital.com API quickstart: key to first call
- Capital.com API endpoints, grouped by what they do
- Capital.com API error codes
- Capital.com API with PythonCapital.com publishes a REST API and a Postman collection, but no Python SDK of its own. That is fine: the API is plain enough that requests will do. The part that catches people is the setup.
- Get your Capital.com trade history into a spreadsheetCapital.com generates statements on the web and in the app. The steps are confirmed; the file format is not, and neither is a separate spreadsheet export of trades.
Capital.com API compared
The same fields from two records, side by side. No winner is picked.
What changed recently for the Capital.com API
Ecosystem
The Capital.com documentation changelog still has no entry after 28 November 2023. Re-read 23 September 2026 and unchanged.
Capital.com Public APIdate last opened not recorded
Documentation
Re-read today and nothing moved. The changelog's last entry is still 28 Nov 2023, so the Open API documentation has been static for nearly three years. Every rate limit, the 10 minute idle session, the 40 instrument streaming cap and the demo host were confirmed unchanged.
Partner terms
Capital.com's affiliate programme page now defers the commission structure to a dedicated affiliate manager at sign up and names UAB Capital.com Services LT as the issuer of the Countries List. No figure is published. Re-read 21 Sep 2026, undated on the page itself. Partner terms, not an API change.
The newest entries are shown. Every dated change, all brokers and platforms. Follow Capital.com changes by RSS
Sample apps that use the Capital.com API
- Capital.com demo order with stop and limitLogs in to the Capital.com demo host, opens one position with a stop and a limit, then reads it back.
Partner programme
No published figure. The Capital.com partner programme record. The programme register holds every record. This site carries no affiliate links.
How to cite this
Capital.com API: limits, auth and errors. Broker API Hub, https://openbrokerapi.com/brokers/capital-com, newest check .
Where you rely on a single figure, cite the source and the checked date printed beside it as well.