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.
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 is recorded as a broker with an API of its own. MetaTrader 5 (Python package and MQL5) is a platform API, offered through the brokers that carry the platform.
- This site documents 36 endpoints for Capital.com and no endpoints for MetaTrader 5 (Python package and MQL5). That counts what has been documented here, not what each API offers.
- This site has decoded 24 error codes for Capital.com and 311 error codes for MetaTrader 5 (Python package and MQL5).
- The limits register holds 1 limit record for Capital.com and no limit records for MetaTrader 5 (Python package and MQL5). Each limit record carries its own scope.
- The Capital.com record holds a demo claim, verified at its source. The MetaTrader 5 (Python package and MQL5) record holds a demo claim, verified at its source. The wording of each is in the Demo row below.
- A quickstart is built here for both.
Capital.com and MetaTrader 5 (Python package and MQL5), field by field
| Field | Capital.com | MetaTrader 5 (Python package and MQL5) |
|---|---|---|
| Kind | Broker with its own API | Platform API, offered by many brokers |
| API family | REST, WebSocket | Python package (MetaTrader5), MQL5, WebRequest and sockets from MQL5 |
| How you get access | Enable 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 it | Any 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 |
| Demo | Yes: separate demo base URL.Capital.com Public APIchecked | Yes: demo accounts can be opened from within the terminal.Opening an account (MT5 help)checked |
| 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 | No API keys: initialize() connects to the local terminal, optionally with account login, password and server.initializechecked |
| 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 | 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 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 | 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 |
| Limits |
| None recorded |
| Endpoints documented here | 36 | None yet |
| Error codes decoded here | 24 | 311 |
| Official documentation | open-api.capital.com | mql5.com |
Go deeper on each side
Capital.com
- Capital.com API page, the full record
- Capital.com API quickstart, credentials to a first call
- Capital.com API limits, in the table above
- Capital.com API error codes, each with its fix
- Capital.com API endpoints, each with its source
- Get your Capital.com trade history into a spreadsheet
- Capital.com API with Python
MetaTrader 5 (Python package and MQL5)
- MetaTrader 5 API page, the full record
- MetaTrader 5 API quickstart, credentials to a first call
- MetaTrader 5 API limits, in the table above: none recorded
- MetaTrader 5 API error codes, each with its fix
- Claude with MetaTrader 5: a safe, read-first setup
- MetaTrader 5 for Python: which platforms does it run on?
- MT5 trade history to a spreadsheet with Python
All comparisons. New to this? Getting started with API trading.