Account
Account functions
Register new account
Register new account
Your API key
In: header
Query Parameters
Account Type. Either 'Metatrader 4' or 'Metatrader 5' depending on the account you would like to connect.
The name of the Metatrader server you would like to connect to. For example, 'ICMarketsSC-MT5-4'.
The Metatrader Login id. For example, '11582083'.
The Metatrader Password.
The name you would like to give to the account. For example, 'My IC-Markets Account'.
Response Body
curl -X GET "https://api.metatraderapi.dev/RegisterAccount?type=string&server=string&user=string&password=string&name=string"{
"message": "successfully connected to Account",
"id": "123e4567-e89b-12d3-a456-426614174000"
}{
"error": "Error message"
}{
"error": "Error message"
}{
"error": "Error message"
}Delete connected account
Delete a connected account. This will disconnect the account from the Dashboard. You can connect the account again using the Dashboard.
Your API key
In: header
Query Parameters
Account Id
Response Body
curl -X GET "https://api.metatraderapi.dev/DeleteAccount?id=string"{
"message": "successfully disconnected Account"
}{
"error": "Error message"
}Get an array of all your connected accounts
Returns an array of all your connected accounts
Your API key
In: header
Response Body
curl -X GET "https://api.metatraderapi.dev/GetAccounts"[
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"account_number": "10024567",
"account_server": "ICMarketsSC-Demo",
"type": "Metatrader 5",
"name": "My IC-Markets account"
}
]Get Basic Account information, such as Balance, Equity, Margin Details
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Response Body
curl -X GET "https://api.metatraderapi.dev/AccountSummary?id=%7B%7Bid%7D%7D"{
"balance": 0.1,
"credit": 0.1,
"profit": 0.1,
"equity": 0.1,
"margin": 0.1,
"freeMargin": 0.1,
"marginLevel": 0.1,
"leverage": 0.1,
"currency": "string",
"type": "Real",
"isInvestor": true
}{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Get more detailed Account Information
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Response Body
curl -X GET "https://api.metatraderapi.dev/AccountDetails?id=%7B%7Bid%7D%7D"{
"serverName": "string",
"user": 0,
"password": "string",
"host": "string",
"port": 0,
"serverTime": "2019-08-24T14:15:22Z",
"serverTimeZone": 0,
"company": "string",
"currency": "string",
"marginStopout": 0,
"marginCall": 0,
"accountName": "string",
"group": "string",
"accountType": "Real",
"accountLeverage": 0,
"isInvestor": true
}{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Full infromation about symbol groups
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Response Body
curl -X GET "https://api.metatraderapi.dev/Groups?id=%7B%7Bid%7D%7D"[
{
"name": "string",
"description": "string"
}
]{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Check investor mode
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Response Body
curl -X GET "https://api.metatraderapi.dev/IsInvestor?id=%7B%7Bid%7D%7D"true{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Get quote
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Symbol
"EURUSD"If last quote arrived less than msOlderMs milliseconds ago function returns last quote, overwise - wait for new quote. If zero - always returns last quote.
0int32Response Body
curl -X GET "https://api.metatraderapi.dev/Quote?id=%7B%7Bid%7D%7D&symbol=EURUSD&msNotOlder=0"{
"symbol": "string",
"bid": 0.1,
"ask": 0.1,
"time": "2019-08-24T14:15:22Z",
"high": 0.1,
"low": 0.1,
"spread": 0.1
}{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Latest quote for the specified symbol
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Symbols
If last quote arrived less than msOlderMs milliseconds ago function returns last quote, overwise - wait for new quote. If zero - always returns last quote.
0int32Response Body
curl -X GET "https://api.metatraderapi.dev/GetQuoteMany?id=%7B%7Bid%7D%7D&symbols=string&msNotOlder=0"[
{
"symbol": "string",
"bid": 0.1,
"ask": 0.1,
"time": "2019-08-24T14:15:22Z",
"high": 0.1,
"low": 0.1,
"spread": 0.1
}
]{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}List of opened orders
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Response Body
curl -X GET "https://api.metatraderapi.dev/OpenedOrders?id=%7B%7Bid%7D%7D"[
{
"ticket": 0,
"openTime": "2019-08-24T14:15:22Z",
"closeTime": "2019-08-24T14:15:22Z",
"expiration": "2019-08-24T14:15:22Z",
"type": "Buy",
"lots": 0.1,
"symbol": "string",
"openPrice": 0.1,
"stopLoss": 0.1,
"takeProfit": 0.1,
"closePrice": 0.1,
"magicNumber": 0,
"swap": 0.1,
"commission": 0.1,
"comment": "string",
"profit": 0.1,
"rateOpen": 0.1,
"rateClose": 0.1,
"rateMargin": 0.1,
"ex": {
"order": 0,
"login": 0,
"symbol": "string",
"digits": 0,
"cmd": 0,
"volume": 0,
"open_time": 0,
"state": 0,
"open_price": 0.1,
"sl": 0.1,
"tp": 0.1,
"close_time": 0,
"value_date": 0,
"expiration": 0,
"place_type": 0,
"conv_rates": [
0.1
],
"commission": 0.1,
"commission_agent": 0.1,
"storage": 0.1,
"close_price": 0.1,
"profit": 0.1,
"taxes": 0.1,
"magic": 0,
"comment": "string",
"internal_id": 0,
"activation": 0,
"spread": 0,
"margin_rate": 0.1,
"timestamp": 0,
"reserved": [
0
],
"next": 0
},
"placedType": "Client",
"state": "OPEN_NORMAL",
"digits": 0
}
]{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Last 100 orders closed during current session
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
Response Body
curl -X GET "https://api.metatraderapi.dev/ClosedOrders?id=string"[
{
"ticket": 0,
"openTime": "2019-08-24T14:15:22Z",
"closeTime": "2019-08-24T14:15:22Z",
"expiration": "2019-08-24T14:15:22Z",
"type": "Buy",
"lots": 0.1,
"symbol": "string",
"openPrice": 0.1,
"stopLoss": 0.1,
"takeProfit": 0.1,
"closePrice": 0.1,
"magicNumber": 0,
"swap": 0.1,
"commission": 0.1,
"comment": "string",
"profit": 0.1,
"rateOpen": 0.1,
"rateClose": 0.1,
"rateMargin": 0.1,
"ex": {
"order": 0,
"login": 0,
"symbol": "string",
"digits": 0,
"cmd": 0,
"volume": 0,
"open_time": 0,
"state": 0,
"open_price": 0.1,
"sl": 0.1,
"tp": 0.1,
"close_time": 0,
"value_date": 0,
"expiration": 0,
"place_type": 0,
"conv_rates": [
0.1
],
"commission": 0.1,
"commission_agent": 0.1,
"storage": 0.1,
"close_price": 0.1,
"profit": 0.1,
"taxes": 0.1,
"magic": 0,
"comment": "string",
"internal_id": 0,
"activation": 0,
"spread": 0,
"margin_rate": 0.1,
"timestamp": 0,
"reserved": [
0
],
"next": 0
},
"placedType": "Client",
"state": "OPEN_NORMAL",
"digits": 0
}
]{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Just tickets of opened orders
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Response Body
curl -X GET "https://api.metatraderapi.dev/OpenedOrdersTickets?id=%7B%7Bid%7D%7D"[
0
]{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}List of symbols.
Returns an array of avaliable symbols
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Response Body
curl -X GET "https://api.metatraderapi.dev/Symbols?id=%7B%7Bid%7D%7D"[
"string"
]{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}List of avaliable symbols
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
Response Body
curl -X GET "https://api.metatraderapi.dev/SymbolList?id=string"[
"string"
]{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Full infromation about symbol and his group
Go to
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Required symbol
"EURUSD"Response Body
curl -X GET "https://api.metatraderapi.dev/SymbolParams?id=%7B%7Bid%7D%7D&symbol=EURUSD"{
"symbolName": "string",
"symbol": {
"execution": "Request",
"stopsLevel": 0,
"digits": 0,
"point": 0.1,
"swapLong": 0.1,
"swapShort": 0.1,
"spread": 0,
"freezeLevel": 0,
"marginCurrency": "string",
"profitMode": "Forex",
"marginMode": "Forex",
"contractSize": 0.1,
"currency": "string",
"marginDivider": 0.1,
"ex": {
"symbol": "string",
"description": "string",
"source": "string",
"currency": "string",
"type": 0,
"digits": 0,
"trade": 0,
"background_color": 0,
"count": 0,
"count_original": 0,
"external_unused": [
0
],
"realtime": 0,
"starting": 0,
"expiration": 0,
"sessions": [
{
"quote": [
{
"open_hour": 0,
"open_min": 0,
"close_hour": 0,
"close_min": 0,
"open": 0,
"close": 0,
"align": [
0
]
}
],
"trade": [
{
"open_hour": 0,
"open_min": 0,
"close_hour": 0,
"close_min": 0,
"open": 0,
"close": 0,
"align": [
0
]
}
],
"quote_overnight": 0,
"trade_overnight": 0,
"reserved": [
0
]
}
],
"profit_mode": 0,
"profit_reserved": 0,
"filter": 0,
"filter_counter": 0,
"filter_limit": 0.1,
"filter_smoothing": 0,
"filter_reserved": 0,
"logging": 0,
"spread": 0,
"spread_balance": 0,
"exemode": 0,
"swap_enable": 0,
"swap_type": 0,
"swap_long": 0.1,
"swap_short": 0.1,
"swap_rollover3days": 0,
"contract_size": 0.1,
"tick_value": 0.1,
"tick_size": 0.1,
"stops_level": 0,
"gtc_pendings": 0,
"margin_mode": 0,
"margin_initial": 0.1,
"margin_maintenance": 0.1,
"margin_hedged": 0.1,
"margin_divider": 0.1,
"point": 0.1,
"multiply": 0.1,
"bid_tickvalue": 0.1,
"ask_tickvalue": 0.1,
"long_only": 0,
"instant_max_volume": 0,
"margin_currency": "string",
"freeze_level": 0,
"margin_hedged_strong": 0,
"value_date": 0,
"quotes_delay": 0,
"swap_openprice": 0,
"unused": [
0
],
"symbolAsString": "string"
},
"code": 0,
"tradeMode": "DISABLED"
},
"group": {
"name": "string",
"description": "string"
},
"groupParams": {
"show": 0,
"trade": 0,
"execution": 0,
"comm_base": 0.1,
"comm_type": 0,
"comm_lots": 0,
"comm_agent": 0.1,
"comm_agent_type": 0,
"spread_diff": 0,
"lot_min": 0,
"lot_max": 0,
"lot_step": 0,
"ie_deviation": 0,
"confirmation": 0,
"trade_rights": 0,
"ie_quick_mode": 0,
"autocloseout_mode": 0,
"comm_tax": 0.1,
"comm_agent_lots": 0,
"freemargin_mode": 0,
"reserved": [
0
],
"minLot": 0.1,
"maxLot": 0.1,
"lotStep": 0.1
}
}{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Server timezone.
Returns an array of avaliable symbols
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Response Body
curl -X GET "https://api.metatraderapi.dev/ServerTimezone?id=%7B%7Bid%7D%7D"0{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Full infromation about symbols
Go to
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Required symbols
Response Body
curl -X GET "https://api.metatraderapi.dev/SymbolParamsMany?id=%7B%7Bid%7D%7D&symbols=string"[
{
"symbolName": "string",
"symbol": {
"execution": "Request",
"stopsLevel": 0,
"digits": 0,
"point": 0.1,
"swapLong": 0.1,
"swapShort": 0.1,
"spread": 0,
"freezeLevel": 0,
"marginCurrency": "string",
"profitMode": "Forex",
"marginMode": "Forex",
"contractSize": 0.1,
"currency": "string",
"marginDivider": 0.1,
"ex": {
"symbol": "string",
"description": "string",
"source": "string",
"currency": "string",
"type": 0,
"digits": 0,
"trade": 0,
"background_color": 0,
"count": 0,
"count_original": 0,
"external_unused": [
0
],
"realtime": 0,
"starting": 0,
"expiration": 0,
"sessions": [
{
"quote": [
{
"open_hour": 0,
"open_min": 0,
"close_hour": 0,
"close_min": 0,
"open": 0,
"close": 0,
"align": [
0
]
}
],
"trade": [
{
"open_hour": 0,
"open_min": 0,
"close_hour": 0,
"close_min": 0,
"open": 0,
"close": 0,
"align": [
0
]
}
],
"quote_overnight": 0,
"trade_overnight": 0,
"reserved": [
0
]
}
],
"profit_mode": 0,
"profit_reserved": 0,
"filter": 0,
"filter_counter": 0,
"filter_limit": 0.1,
"filter_smoothing": 0,
"filter_reserved": 0,
"logging": 0,
"spread": 0,
"spread_balance": 0,
"exemode": 0,
"swap_enable": 0,
"swap_type": 0,
"swap_long": 0.1,
"swap_short": 0.1,
"swap_rollover3days": 0,
"contract_size": 0.1,
"tick_value": 0.1,
"tick_size": 0.1,
"stops_level": 0,
"gtc_pendings": 0,
"margin_mode": 0,
"margin_initial": 0.1,
"margin_maintenance": 0.1,
"margin_hedged": 0.1,
"margin_divider": 0.1,
"point": 0.1,
"multiply": 0.1,
"bid_tickvalue": 0.1,
"ask_tickvalue": 0.1,
"long_only": 0,
"instant_max_volume": 0,
"margin_currency": "string",
"freeze_level": 0,
"margin_hedged_strong": 0,
"value_date": 0,
"quotes_delay": 0,
"swap_openprice": 0,
"unused": [
0
],
"symbolAsString": "string"
},
"code": 0,
"tradeMode": "DISABLED"
},
"group": {
"name": "string",
"description": "string"
},
"groupParams": {
"show": 0,
"trade": 0,
"execution": 0,
"comm_base": 0.1,
"comm_type": 0,
"comm_lots": 0,
"comm_agent": 0.1,
"comm_agent_type": 0,
"spread_diff": 0,
"lot_min": 0,
"lot_max": 0,
"lot_step": 0,
"ie_deviation": 0,
"confirmation": 0,
"trade_rights": 0,
"ie_quick_mode": 0,
"autocloseout_mode": 0,
"comm_tax": 0.1,
"comm_agent_lots": 0,
"freemargin_mode": 0,
"reserved": [
0
],
"minLot": 0.1,
"maxLot": 0.1,
"lotStep": 0.1
}
}
]{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Opened order by ticket
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Ticket number
0int32Response Body
curl -X GET "https://api.metatraderapi.dev/OpenedOrder?id=%7B%7Bid%7D%7D&ticket=0"{
"ticket": 0,
"openTime": "2019-08-24T14:15:22Z",
"closeTime": "2019-08-24T14:15:22Z",
"expiration": "2019-08-24T14:15:22Z",
"type": "Buy",
"lots": 0.1,
"symbol": "string",
"openPrice": 0.1,
"stopLoss": 0.1,
"takeProfit": 0.1,
"closePrice": 0.1,
"magicNumber": 0,
"swap": 0.1,
"commission": 0.1,
"comment": "string",
"profit": 0.1,
"rateOpen": 0.1,
"rateClose": 0.1,
"rateMargin": 0.1,
"ex": {
"order": 0,
"login": 0,
"symbol": "string",
"digits": 0,
"cmd": 0,
"volume": 0,
"open_time": 0,
"state": 0,
"open_price": 0.1,
"sl": 0.1,
"tp": 0.1,
"close_time": 0,
"value_date": 0,
"expiration": 0,
"place_type": 0,
"conv_rates": [
0.1
],
"commission": 0.1,
"commission_agent": 0.1,
"storage": 0.1,
"close_price": 0.1,
"profit": 0.1,
"taxes": 0.1,
"magic": 0,
"comment": "string",
"internal_id": 0,
"activation": 0,
"spread": 0,
"margin_rate": 0.1,
"timestamp": 0,
"reserved": [
0
],
"next": 0
},
"placedType": "Client",
"state": "OPEN_NORMAL",
"digits": 0
}{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Price history.
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Symbol
"EURUSD"Timeframe. M1,M5,M15,M30,H1,H4,D1,W1,MN1
"D1""M1" | "M5" | "M15" | "M30" | "H1" | "H4" | "D1" | "W1" | "MN1"'From date' in format: yyyy-MM-ddTHH:mm:ss
"2022-10-01T00:00:00"Number of bars back from specified date.
10int32Response Body
curl -X GET "https://api.metatraderapi.dev/QuoteHistory?id=%7B%7Bid%7D%7D&symbol=EURUSD&timeframe=M1&from=2022-10-01T00%3A00%3A00&count=10"[
{
"time": "2019-08-24T14:15:22Z",
"open": 0.1,
"high": 0.1,
"low": 0.1,
"close": 0.1,
"volume": 0.1
}
]{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Price history.
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Symbols
Timeframe. M1,M5,M15,M30,H1,H4,D1,W1,MN1
"D1""M1" | "M5" | "M15" | "M30" | "H1" | "H4" | "D1" | "W1" | "MN1"'From date' in format: yyyy-MM-ddTHH:mm:ss
"2022-10-01T00:00:00"Number of bars back from specified date.
10int32Response Body
curl -X GET "https://api.metatraderapi.dev/QuoteHistoryMany?id=%7B%7Bid%7D%7D&symbol=string&timeframe=M1&from=2022-10-01T00%3A00%3A00&count=10"[
{
"symbol": "string",
"bars": [
{
"time": "2019-08-24T14:15:22Z",
"open": 0.1,
"high": 0.1,
"low": 0.1,
"close": 0.1,
"volume": 0.1
}
],
"exception": "string"
}
]{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Request price history and get result via /events socket connection
Use /events web socket to get result
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Symbol
"EURUSD"Timeframe. M1,M5,M15,M30,H1,H4,D1,W1,MN1
"D1""M1" | "M5" | "M15" | "M30" | "H1" | "H4" | "D1" | "W1" | "MN1"'From date' in format: yyyy-MM-ddTHH:mm:ss
"2022-10-01T00:00:00"Number of bars back from specified date.
10int32Response Body
curl -X GET "https://api.metatraderapi.dev/RequestQuoteHistory?id=%7B%7Bid%7D%7D&symbol=EURUSD&timeframe=M1&from=2022-10-01T00%3A00%3A00&count=10""string"{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Tick value.
Returns an array of double values
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"demo-token-mt5"Symbols array
Response Body
curl -X GET "https://api.metatraderapi.dev/GetTickValueMany?id=demo-token-mt5&symbol=string"[
{
"property1": 0.1,
"property2": 0.1
}
]{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Tick value.
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"demo-token-mt5"Symbols array
Response Body
curl -X GET "https://api.metatraderapi.dev/TickValueWithSize?id=demo-token-mt5&symbol=string"[
{
"tickValue": 0.1,
"tickSize": 0.1,
"symbol": "string"
}
]{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}Required margin
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Symbol
"EURUSD"Lots
1doubleBuy or Sell
"Buy""Buy" | "Sell" | "BuyLimit" | "SellLimit" | "BuyStop" | "SellStop" | "Balance" | "Credit"Price
0doubleResponse Body
curl -X GET "https://api.metatraderapi.dev/RequiredMargin?id=%7B%7Bid%7D%7D&symbol=EURUSD&lots=1&type=Buy&price=0"0.1{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}TRADE_DENY_NONE=0, TRADE_DENY_CLOSEBY=1, TRADE_DENY_MUCLOSEBY=2
Go to
Your API key
In: header
Query Parameters
Your Account UUID which you connected via the Dashboard
"{{id}}"Required symbols
Response Body
curl -X GET "https://api.metatraderapi.dev/TradeRightsMany?id=%7B%7Bid%7D%7D&symbols=string"[
"DENY_NONE"
]{
"message": "string",
"code": "INTERNAL_ERROR",
"stackTrace": "string"
}