Capital.com REST API explorer
36 documented Capital.com API endpoints, grouped by what they do. Each has its method, path, parameters and the source it was read from.
Independent and unofficialNewest check
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.
Accounts
- 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.
Confirms
General
History
Markets
- 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/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/prices/{epic}Historical bid and ask candles for one epic. By default, minute prices for the last 10 minutes.
Positions
- 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}.
Session
- GET/api/v1/pingPing the service to keep a trading session alive. Call it at least once every 10 minutes when idle.
- DELETE/api/v1/sessionLog out of the current session. The CST and X-SECURITY-TOKEN tokens stop working.
- GET/api/v1/sessionRead the current session: client ID, active account, locale, currency and the streaming endpoint.
- 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/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.
Watchlists
- GET/api/v1/watchlistsEvery watchlist on your account. Open one with GET /api/v1/watchlists/{watchlistId}.
- POST/api/v1/watchlistsCreate a watchlist with a name and, if you wish, a first set of markets.
- DELETE/api/v1/watchlists/{watchlistId}Delete a watchlist. The list itself is removed, not the markets or any position in them.
- GET/api/v1/watchlists/{watchlistId}The markets in one watchlist, each with its epic, name, status and current bid and offer.
- PUT/api/v1/watchlists/{watchlistId}Add one market to an existing watchlist, by its epic.
- DELETE/api/v1/watchlists/{watchlistId}/{epic}Take one market out of a watchlist. The watchlist and its other markets stay as they are.
Working orders
- GET/api/v1/workingordersAll open limit and stop orders on the active account.
- POST/api/v1/workingordersCreate a LIMIT or STOP order at a price level, optionally with a cancellation date, stop loss and take profit.
- 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.