MetaApi API endpoints
17 documented MetaApi 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.
Historical data
- GET/users/current/accounts/{accountId}/history-deals/position/{positionId}List the history deals that belong to one position.
- GET/users/current/accounts/{accountId}/history-deals/time/{startTime}/{endTime}List the account's history deals inside a time range, a page at a time.
- GET/users/current/accounts/{accountId}/history-orders/time/{startTime}/{endTime}List the account's completed orders inside a time range, a page at a time.
Market data
- GET/users/current/accounts/{accountId}/historical-market-data/symbols/{symbol}/timeframes/{timeframe}/candlesDownload historical candles for one symbol and timeframe, loaded backwards from a start time, up to 1000 at a time.
- GET/users/current/accounts/{accountId}/symbolsList the symbols available on the MetaTrader account, as plain names.
- GET/users/current/accounts/{accountId}/symbols/{symbol}/current-candles/{timeframe}Read the candle now forming for one symbol at one timeframe.
- GET/users/current/accounts/{accountId}/symbols/{symbol}/current-priceRead the current price of one symbol.
- GET/users/current/accounts/{accountId}/symbols/{symbol}/current-tickRead the latest tick of one symbol. The page says MT4 G1 accounts do not support this call.
- GET/users/current/accounts/{accountId}/symbols/{symbol}/specificationRead the trading specification of one symbol.
Terminal state
- GET/users/current/accounts/{accountId}/account-informationRead the MetaTrader account's balance, equity, margin, free margin, leverage and currency, with its broker and server.
- GET/users/current/accounts/{accountId}/ordersList the open, pending orders on the MetaTrader account.
- GET/users/current/accounts/{accountId}/orders/{orderId}Read one open order by its id, the ticket number.
- GET/users/current/accounts/{accountId}/positionsList the open positions on the MetaTrader account.
- GET/users/current/accounts/{accountId}/positions/{positionId}Read one open position by its id, the ticket number.
- GET/users/current/accounts/{accountId}/server-timeRead the trading server's time for the MetaTrader account.
Trade
- POST/users/current/accounts/{accountId}/calculate-marginWork out the margin that opening a given trade on the account would need, without placing it.
- POST/users/current/accounts/{accountId}/tradeSend one trade command to the MetaTrader account. The actionType in the body decides what it does: open at market, place, change or cancel a pending order, or change or close a position.