Broker API HubMenu

Capital.com vs MetaTrader 5 API

The same fields from the Capital.com record and the MetaTrader 5 (Python package and MQL5) record, side by side. No winner is picked: which one suits you depends on what you are building.

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.

What the two records show

Differences you can see in the records themselves. These are counts of what this site holds, not a verdict on either API.

Capital.com and MetaTrader 5 (Python package and MQL5), field by field

FieldCapital.comMetaTrader 5 (Python package and MQL5)
KindBroker with its own APIPlatform API, offered by many brokers
API familyREST, WebSocketPython package (MetaTrader5), MQL5, WebRequest and sockets from MQL5
How you get accessEnable 2FA, then Settings > API integrations > Generate new key, with a custom key password.Capital.com Public APIchecked Install the MT5 terminal from your broker, then pip install MetaTrader5 on Windows x86-64 or write MQL5 in MetaEditor. The terminal must be at build 4755 or later.order_sendchecked
Who can use itAny Capital.com account (demo or live) with 2FA enabled. Regional limits not published.Capital.com Public APIchecked Real accounts come from brokers offering MT5; the API runs through your own local terminal.Opening an account (MT5 help)checked
DemoYes: separate demo base URL.Capital.com Public APIchecked Yes: demo accounts can be opened from within the terminal.Opening an account (MT5 help)checked
AuthenticationPOST /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 No API keys: initialize() connects to the local terminal, optionally with account login, password and server.initializechecked
StreamingWebSocket 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 No push API in Python: poll ticks and bars; market_book_add subscribes the terminal to depth events. MQL5 EAs get tick events.MetaTrader for Pythonchecked
History depthCandles: 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 Bars limited to the terminal's Max bars in chart setting. Deal history by date range with no stated limit.MQL5 docs: copy_rates_fromchecked
LimitsNone recorded
Endpoints documented here36None yet
Error codes decoded here24311
Official documentationopen-api.capital.commql5.com

Go deeper on each side

All comparisons. New to this? Getting started with API trading.