Capital.com Public API · AsyncAPI Specification
Capital.com WebSocket Streaming API
Version 1.0.0
Real-time streaming API from Capital.com for market data and OHLC candlestick updates. Clients connect over WebSocket using session tokens (CST and X-SECURITY-TOKEN) obtained from the Capital.com REST API. A single connection supports up to 40 concurrent instrument subscriptions and must be pinged at least once every 10 minutes to remain active.
View Spec
View on GitHub
CFDCommoditiesCryptocurrencyFinancialForexIndicesMarket DataSharesStreamingTradingWebSocketAsyncAPIWebhooksEvents
Channels
/
Frames sent from the client to Capital.com.
Single WebSocket channel for all destinations. Clients send frames whose `destination` field selects an operation (marketData.subscribe, marketData.unsubscribe, OHLCMarketData.subscribe, OHLCMarketData.unsubscribe, ping). The server publishes subscription confirmations, market data updates, OHLC bar updates, and ping responses on the same connection.
Messages
MarketDataSubscribe
Subscribe to real-time market data
Subscribe to live bid/offer price updates for a set of instrument epics.
MarketDataUnsubscribe
Unsubscribe from real-time market data
Remove real-time price subscriptions for one or more epics.
OHLCMarketDataSubscribe
Subscribe to OHLC candlestick updates
Subscribe to OHLC candle updates for a set of epics, resolutions, and bar type.
OHLCMarketDataUnsubscribe
Unsubscribe from OHLC candlestick updates
Remove OHLC subscriptions for the given epics, with optional resolution and type filters.
Ping
Ping the streaming session
Keep the WebSocket session alive (must be sent at least every 10 minutes).
SubscriptionStatus
Subscription processing status
Confirms processing status of a subscribe or unsubscribe request per epic.
MarketDataUpdate
Real-time market data update
Streaming bid/offer quote update for a subscribed instrument.
OHLCMarketDataUpdate
OHLC candlestick update
Streaming OHLC bar update for a subscribed instrument and resolution.
PingResponse
Ping response
Server acknowledgement of a client ping.
Servers
wss
production
api-streaming-capital.backend-capital.com/connect
Capital.com production WebSocket streaming endpoint.
wss
demo
demo-api-streaming-capital.backend-capital.com/connect
Capital.com demo WebSocket streaming endpoint.