MetaTrader API
Metatrader 5 api

Account

Account functions

Register new account

Register new account

GET
/RegisterAccount
x-api-key<token>

Your API key

In: header

Query Parameters

type?string

Account Type. Either 'Metatrader 4' or 'Metatrader 5' depending on the account you would like to connect.

server?string

The name of the Metatrader server you would like to connect to. For example, 'ICMarketsSC-MT5-4'.

user?string

The Metatrader Login id. For example, '11582083'.

password?string

The Metatrader Password.

name?string

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.

GET
/DeleteAccount
x-api-key<token>

Your API key

In: header

Query Parameters

id?string

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

GET
/GetAccounts
x-api-key<token>

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"
  }
]

Accound details

GET
/Account
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"

Response Body

curl -X GET "https://api.metatraderapi.dev/Account?id=%7B%7Bid%7D%7D"
{
  "login": 0,
  "type": "string",
  "userName": "string",
  "tradeFlags": 0,
  "country": "string",
  "city": "string",
  "state": "string",
  "zipCode": "string",
  "userAddress": "string",
  "phone": "string",
  "email": "string",
  "balance": 0.1,
  "credit": 0.1,
  "blocked": 0.1,
  "leverage": 0
}
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Get Basic Account information, such as Balance, Equity, Margin Details

GET
/AccountSummary
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{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",
  "method": "Default",
  "type": "string",
  "isInvestor": true
}
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Get more detailed Account Information

GET
/AccountDetails
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{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",
  "accountName": "string",
  "group": "string",
  "accountType": "string",
  "accountLeverage": 0,
  "accountMethod": "Default",
  "isInvestor": true
}
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

List of opened orders

GET
/OpenedOrders
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

sort?string

Sort by open time or close time

Default"OpenTime"
Value in"OpenTime" | "CloseTime"
ascending?boolean

Ascending sort

Defaulttrue

Response Body

curl -X GET "https://api.metatraderapi.dev/OpenedOrders?id=string&sort=OpenTime&ascending=true"
[
  {
    "ticket": 0,
    "profit": 0.1,
    "swap": 0.1,
    "commission": 0.1,
    "fee": 0.1,
    "closePrice": 0.1,
    "closeTime": "2019-08-24T14:15:22Z",
    "closeLots": 0.1,
    "closeComment": "string",
    "openPrice": 0.1,
    "openTime": "2019-08-24T14:15:22Z",
    "lots": 0.1,
    "contractSize": 0.1,
    "expertId": 0,
    "placedType": "Manually",
    "orderType": "Buy",
    "dealType": "DealBuy",
    "symbol": "string",
    "comment": "string",
    "state": "Started",
    "stopLoss": 0.1,
    "takeProfit": 0.1,
    "requestId": 0,
    "digits": 0,
    "profitRate": 0.1,
    "stopLimitPrice": 0.1,
    "dealInternalIn": {
      "ticketNumber": 0,
      "id": "string",
      "login": 0,
      "historyTime": 0,
      "orderTicket": 0,
      "openTime": 0,
      "symbol": "string",
      "type": "DealBuy",
      "direction": "In",
      "openPrice": 0.1,
      "price": 0.1,
      "stopLoss": 0.1,
      "takeProfit": 0.1,
      "volume": 0,
      "profit": 0.1,
      "profitRate": 0.1,
      "volumeRate": 0.1,
      "commission": 0.1,
      "fee": 0.1,
      "swap": 0.1,
      "expertId": 0,
      "positionTicket": 0,
      "comment": "string",
      "contractSize": 0.1,
      "digits": 0,
      "moneyDigits": 0,
      "freeProfit": 0.1,
      "trailRounder": 0.1,
      "openTimeMs": 0,
      "placedType": "Manually",
      "openTimeAsDateTime": "2019-08-24T14:15:22Z",
      "lots": 0.1
    },
    "dealInternalOut": {
      "ticketNumber": 0,
      "id": "string",
      "login": 0,
      "historyTime": 0,
      "orderTicket": 0,
      "openTime": 0,
      "symbol": "string",
      "type": "DealBuy",
      "direction": "In",
      "openPrice": 0.1,
      "price": 0.1,
      "stopLoss": 0.1,
      "takeProfit": 0.1,
      "volume": 0,
      "profit": 0.1,
      "profitRate": 0.1,
      "volumeRate": 0.1,
      "commission": 0.1,
      "fee": 0.1,
      "swap": 0.1,
      "expertId": 0,
      "positionTicket": 0,
      "comment": "string",
      "contractSize": 0.1,
      "digits": 0,
      "moneyDigits": 0,
      "freeProfit": 0.1,
      "trailRounder": 0.1,
      "openTimeMs": 0,
      "placedType": "Manually",
      "openTimeAsDateTime": "2019-08-24T14:15:22Z",
      "lots": 0.1
    },
    "orderInternal": {
      "ticketNumber": 0,
      "id": "string",
      "login": 0,
      "symbol": "string",
      "historyTime": 0,
      "openTime": 0,
      "expirationTime": 0,
      "executionTime": 0,
      "type": "Buy",
      "fillPolicy": "FillOrKill",
      "expirationType": "GTC",
      "placedType": "Manually",
      "openPrice": 0.1,
      "stopLimitPrice": 0.1,
      "price": 0.1,
      "stopLoss": 0.1,
      "takeProfit": 0.1,
      "volume": 0,
      "requestVolume": 0,
      "state": "Started",
      "expertId": 0,
      "dealTicket": 0,
      "comment": "string",
      "contractSize": 0.1,
      "digits": 0,
      "baseDigits": 0,
      "profitRate": 0.1,
      "openTimeMs": 0,
      "ticket": 0,
      "executionTimeAsDateTime": "2019-08-24T14:15:22Z",
      "lots": 0.1,
      "requestLots": 0.1,
      "openTimeMsAsDateTime": "2019-08-24T14:15:22Z",
      "openTimeAsDateTime": "2019-08-24T14:15:22Z"
    },
    "partialCloseDeals": [
      {
        "ticketNumber": 0,
        "id": "string",
        "login": 0,
        "historyTime": 0,
        "orderTicket": 0,
        "openTime": 0,
        "symbol": "string",
        "type": "DealBuy",
        "direction": "In",
        "openPrice": 0.1,
        "price": 0.1,
        "stopLoss": 0.1,
        "takeProfit": 0.1,
        "volume": 0,
        "profit": 0.1,
        "profitRate": 0.1,
        "volumeRate": 0.1,
        "commission": 0.1,
        "fee": 0.1,
        "swap": 0.1,
        "expertId": 0,
        "positionTicket": 0,
        "comment": "string",
        "contractSize": 0.1,
        "digits": 0,
        "moneyDigits": 0,
        "freeProfit": 0.1,
        "trailRounder": 0.1,
        "openTimeMs": 0,
        "placedType": "Manually",
        "openTimeAsDateTime": "2019-08-24T14:15:22Z",
        "lots": 0.1
      }
    ],
    "partialFillDeals": [
      {
        "ticketNumber": 0,
        "id": "string",
        "login": 0,
        "historyTime": 0,
        "orderTicket": 0,
        "openTime": 0,
        "symbol": "string",
        "type": "DealBuy",
        "direction": "In",
        "openPrice": 0.1,
        "price": 0.1,
        "stopLoss": 0.1,
        "takeProfit": 0.1,
        "volume": 0,
        "profit": 0.1,
        "profitRate": 0.1,
        "volumeRate": 0.1,
        "commission": 0.1,
        "fee": 0.1,
        "swap": 0.1,
        "expertId": 0,
        "positionTicket": 0,
        "comment": "string",
        "contractSize": 0.1,
        "digits": 0,
        "moneyDigits": 0,
        "freeProfit": 0.1,
        "trailRounder": 0.1,
        "openTimeMs": 0,
        "placedType": "Manually",
        "openTimeAsDateTime": "2019-08-24T14:15:22Z",
        "lots": 0.1
      }
    ],
    "closeVolume": 0,
    "volume": 0,
    "expirationType": "GTC",
    "expirationTime": "2019-08-24T14:15:22Z",
    "fillPolicy": "FillOrKill",
    "openTimestampUTC": 0,
    "closeTimestampUTC": 0
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Last 100 orders closed during current session

GET
/ClosedOrders
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Response Body

curl -X GET "https://api.metatraderapi.dev/ClosedOrders?id=string"
[
  {
    "ticket": 0,
    "profit": 0.1,
    "swap": 0.1,
    "commission": 0.1,
    "fee": 0.1,
    "closePrice": 0.1,
    "closeTime": "2019-08-24T14:15:22Z",
    "closeLots": 0.1,
    "closeComment": "string",
    "openPrice": 0.1,
    "openTime": "2019-08-24T14:15:22Z",
    "lots": 0.1,
    "contractSize": 0.1,
    "expertId": 0,
    "placedType": "Manually",
    "orderType": "Buy",
    "dealType": "DealBuy",
    "symbol": "string",
    "comment": "string",
    "state": "Started",
    "stopLoss": 0.1,
    "takeProfit": 0.1,
    "requestId": 0,
    "digits": 0,
    "profitRate": 0.1,
    "stopLimitPrice": 0.1,
    "dealInternalIn": {
      "ticketNumber": 0,
      "id": "string",
      "login": 0,
      "historyTime": 0,
      "orderTicket": 0,
      "openTime": 0,
      "symbol": "string",
      "type": "DealBuy",
      "direction": "In",
      "openPrice": 0.1,
      "price": 0.1,
      "stopLoss": 0.1,
      "takeProfit": 0.1,
      "volume": 0,
      "profit": 0.1,
      "profitRate": 0.1,
      "volumeRate": 0.1,
      "commission": 0.1,
      "fee": 0.1,
      "swap": 0.1,
      "expertId": 0,
      "positionTicket": 0,
      "comment": "string",
      "contractSize": 0.1,
      "digits": 0,
      "moneyDigits": 0,
      "freeProfit": 0.1,
      "trailRounder": 0.1,
      "openTimeMs": 0,
      "placedType": "Manually",
      "openTimeAsDateTime": "2019-08-24T14:15:22Z",
      "lots": 0.1
    },
    "dealInternalOut": {
      "ticketNumber": 0,
      "id": "string",
      "login": 0,
      "historyTime": 0,
      "orderTicket": 0,
      "openTime": 0,
      "symbol": "string",
      "type": "DealBuy",
      "direction": "In",
      "openPrice": 0.1,
      "price": 0.1,
      "stopLoss": 0.1,
      "takeProfit": 0.1,
      "volume": 0,
      "profit": 0.1,
      "profitRate": 0.1,
      "volumeRate": 0.1,
      "commission": 0.1,
      "fee": 0.1,
      "swap": 0.1,
      "expertId": 0,
      "positionTicket": 0,
      "comment": "string",
      "contractSize": 0.1,
      "digits": 0,
      "moneyDigits": 0,
      "freeProfit": 0.1,
      "trailRounder": 0.1,
      "openTimeMs": 0,
      "placedType": "Manually",
      "openTimeAsDateTime": "2019-08-24T14:15:22Z",
      "lots": 0.1
    },
    "orderInternal": {
      "ticketNumber": 0,
      "id": "string",
      "login": 0,
      "symbol": "string",
      "historyTime": 0,
      "openTime": 0,
      "expirationTime": 0,
      "executionTime": 0,
      "type": "Buy",
      "fillPolicy": "FillOrKill",
      "expirationType": "GTC",
      "placedType": "Manually",
      "openPrice": 0.1,
      "stopLimitPrice": 0.1,
      "price": 0.1,
      "stopLoss": 0.1,
      "takeProfit": 0.1,
      "volume": 0,
      "requestVolume": 0,
      "state": "Started",
      "expertId": 0,
      "dealTicket": 0,
      "comment": "string",
      "contractSize": 0.1,
      "digits": 0,
      "baseDigits": 0,
      "profitRate": 0.1,
      "openTimeMs": 0,
      "ticket": 0,
      "executionTimeAsDateTime": "2019-08-24T14:15:22Z",
      "lots": 0.1,
      "requestLots": 0.1,
      "openTimeMsAsDateTime": "2019-08-24T14:15:22Z",
      "openTimeAsDateTime": "2019-08-24T14:15:22Z"
    },
    "partialCloseDeals": [
      {
        "ticketNumber": 0,
        "id": "string",
        "login": 0,
        "historyTime": 0,
        "orderTicket": 0,
        "openTime": 0,
        "symbol": "string",
        "type": "DealBuy",
        "direction": "In",
        "openPrice": 0.1,
        "price": 0.1,
        "stopLoss": 0.1,
        "takeProfit": 0.1,
        "volume": 0,
        "profit": 0.1,
        "profitRate": 0.1,
        "volumeRate": 0.1,
        "commission": 0.1,
        "fee": 0.1,
        "swap": 0.1,
        "expertId": 0,
        "positionTicket": 0,
        "comment": "string",
        "contractSize": 0.1,
        "digits": 0,
        "moneyDigits": 0,
        "freeProfit": 0.1,
        "trailRounder": 0.1,
        "openTimeMs": 0,
        "placedType": "Manually",
        "openTimeAsDateTime": "2019-08-24T14:15:22Z",
        "lots": 0.1
      }
    ],
    "partialFillDeals": [
      {
        "ticketNumber": 0,
        "id": "string",
        "login": 0,
        "historyTime": 0,
        "orderTicket": 0,
        "openTime": 0,
        "symbol": "string",
        "type": "DealBuy",
        "direction": "In",
        "openPrice": 0.1,
        "price": 0.1,
        "stopLoss": 0.1,
        "takeProfit": 0.1,
        "volume": 0,
        "profit": 0.1,
        "profitRate": 0.1,
        "volumeRate": 0.1,
        "commission": 0.1,
        "fee": 0.1,
        "swap": 0.1,
        "expertId": 0,
        "positionTicket": 0,
        "comment": "string",
        "contractSize": 0.1,
        "digits": 0,
        "moneyDigits": 0,
        "freeProfit": 0.1,
        "trailRounder": 0.1,
        "openTimeMs": 0,
        "placedType": "Manually",
        "openTimeAsDateTime": "2019-08-24T14:15:22Z",
        "lots": 0.1
      }
    ],
    "closeVolume": 0,
    "volume": 0,
    "expirationType": "GTC",
    "expirationTime": "2019-08-24T14:15:22Z",
    "fillPolicy": "FillOrKill",
    "openTimestampUTC": 0,
    "closeTimestampUTC": 0
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Opened order by ticket

GET
/OpenedOrder
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

ticket?integer

Ticket number

Formatint64

Response Body

curl -X GET "https://api.metatraderapi.dev/OpenedOrder?id=string&ticket=0"
{
  "ticket": 0,
  "profit": 0.1,
  "swap": 0.1,
  "commission": 0.1,
  "fee": 0.1,
  "closePrice": 0.1,
  "closeTime": "2019-08-24T14:15:22Z",
  "closeLots": 0.1,
  "closeComment": "string",
  "openPrice": 0.1,
  "openTime": "2019-08-24T14:15:22Z",
  "lots": 0.1,
  "contractSize": 0.1,
  "expertId": 0,
  "placedType": "Manually",
  "orderType": "Buy",
  "dealType": "DealBuy",
  "symbol": "string",
  "comment": "string",
  "state": "Started",
  "stopLoss": 0.1,
  "takeProfit": 0.1,
  "requestId": 0,
  "digits": 0,
  "profitRate": 0.1,
  "stopLimitPrice": 0.1,
  "dealInternalIn": {
    "ticketNumber": 0,
    "id": "string",
    "login": 0,
    "historyTime": 0,
    "orderTicket": 0,
    "openTime": 0,
    "symbol": "string",
    "type": "DealBuy",
    "direction": "In",
    "openPrice": 0.1,
    "price": 0.1,
    "stopLoss": 0.1,
    "takeProfit": 0.1,
    "volume": 0,
    "profit": 0.1,
    "profitRate": 0.1,
    "volumeRate": 0.1,
    "commission": 0.1,
    "fee": 0.1,
    "swap": 0.1,
    "expertId": 0,
    "positionTicket": 0,
    "comment": "string",
    "contractSize": 0.1,
    "digits": 0,
    "moneyDigits": 0,
    "freeProfit": 0.1,
    "trailRounder": 0.1,
    "openTimeMs": 0,
    "placedType": "Manually",
    "openTimeAsDateTime": "2019-08-24T14:15:22Z",
    "lots": 0.1
  },
  "dealInternalOut": {
    "ticketNumber": 0,
    "id": "string",
    "login": 0,
    "historyTime": 0,
    "orderTicket": 0,
    "openTime": 0,
    "symbol": "string",
    "type": "DealBuy",
    "direction": "In",
    "openPrice": 0.1,
    "price": 0.1,
    "stopLoss": 0.1,
    "takeProfit": 0.1,
    "volume": 0,
    "profit": 0.1,
    "profitRate": 0.1,
    "volumeRate": 0.1,
    "commission": 0.1,
    "fee": 0.1,
    "swap": 0.1,
    "expertId": 0,
    "positionTicket": 0,
    "comment": "string",
    "contractSize": 0.1,
    "digits": 0,
    "moneyDigits": 0,
    "freeProfit": 0.1,
    "trailRounder": 0.1,
    "openTimeMs": 0,
    "placedType": "Manually",
    "openTimeAsDateTime": "2019-08-24T14:15:22Z",
    "lots": 0.1
  },
  "orderInternal": {
    "ticketNumber": 0,
    "id": "string",
    "login": 0,
    "symbol": "string",
    "historyTime": 0,
    "openTime": 0,
    "expirationTime": 0,
    "executionTime": 0,
    "type": "Buy",
    "fillPolicy": "FillOrKill",
    "expirationType": "GTC",
    "placedType": "Manually",
    "openPrice": 0.1,
    "stopLimitPrice": 0.1,
    "price": 0.1,
    "stopLoss": 0.1,
    "takeProfit": 0.1,
    "volume": 0,
    "requestVolume": 0,
    "state": "Started",
    "expertId": 0,
    "dealTicket": 0,
    "comment": "string",
    "contractSize": 0.1,
    "digits": 0,
    "baseDigits": 0,
    "profitRate": 0.1,
    "openTimeMs": 0,
    "ticket": 0,
    "executionTimeAsDateTime": "2019-08-24T14:15:22Z",
    "lots": 0.1,
    "requestLots": 0.1,
    "openTimeMsAsDateTime": "2019-08-24T14:15:22Z",
    "openTimeAsDateTime": "2019-08-24T14:15:22Z"
  },
  "partialCloseDeals": [
    {
      "ticketNumber": 0,
      "id": "string",
      "login": 0,
      "historyTime": 0,
      "orderTicket": 0,
      "openTime": 0,
      "symbol": "string",
      "type": "DealBuy",
      "direction": "In",
      "openPrice": 0.1,
      "price": 0.1,
      "stopLoss": 0.1,
      "takeProfit": 0.1,
      "volume": 0,
      "profit": 0.1,
      "profitRate": 0.1,
      "volumeRate": 0.1,
      "commission": 0.1,
      "fee": 0.1,
      "swap": 0.1,
      "expertId": 0,
      "positionTicket": 0,
      "comment": "string",
      "contractSize": 0.1,
      "digits": 0,
      "moneyDigits": 0,
      "freeProfit": 0.1,
      "trailRounder": 0.1,
      "openTimeMs": 0,
      "placedType": "Manually",
      "openTimeAsDateTime": "2019-08-24T14:15:22Z",
      "lots": 0.1
    }
  ],
  "partialFillDeals": [
    {
      "ticketNumber": 0,
      "id": "string",
      "login": 0,
      "historyTime": 0,
      "orderTicket": 0,
      "openTime": 0,
      "symbol": "string",
      "type": "DealBuy",
      "direction": "In",
      "openPrice": 0.1,
      "price": 0.1,
      "stopLoss": 0.1,
      "takeProfit": 0.1,
      "volume": 0,
      "profit": 0.1,
      "profitRate": 0.1,
      "volumeRate": 0.1,
      "commission": 0.1,
      "fee": 0.1,
      "swap": 0.1,
      "expertId": 0,
      "positionTicket": 0,
      "comment": "string",
      "contractSize": 0.1,
      "digits": 0,
      "moneyDigits": 0,
      "freeProfit": 0.1,
      "trailRounder": 0.1,
      "openTimeMs": 0,
      "placedType": "Manually",
      "openTimeAsDateTime": "2019-08-24T14:15:22Z",
      "lots": 0.1
    }
  ],
  "closeVolume": 0,
  "volume": 0,
  "expirationType": "GTC",
  "expirationTime": "2019-08-24T14:15:22Z",
  "fillPolicy": "FillOrKill",
  "openTimestampUTC": 0,
  "closeTimestampUTC": 0
}
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Just tickets of opened orders

GET
/OpenedOrdersTickets
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"demo-token-mt5"

Response Body

curl -X GET "https://api.metatraderapi.dev/OpenedOrdersTickets?id=demo-token-mt5"
[
  0
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

List of avaliable symbols with parameters

GET
/Symbols
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Response Body

curl -X GET "https://api.metatraderapi.dev/Symbols?id=string"
{
  "property1": {
    "updateTime": 0,
    "currency": "string",
    "isin": "string",
    "description": "string",
    "basis": "string",
    "refToSite": "string",
    "custom": 0,
    "profitCurrency": "string",
    "marginCurrency": "string",
    "precision": 0,
    "bkgndColor": 0,
    "digits": 0,
    "points": 0.1,
    "limitPoints": 0.1,
    "id": 0,
    "depthOfMarket": 0,
    "spread": 0,
    "tickValue": 0.1,
    "tickSize": 0.1,
    "contractSize": 0.1,
    "gtcMode": "Cancelled",
    "calcMode": "Forex",
    "settlementPrice": 0.1,
    "lowerLimit": 0.1,
    "upperLimit": 0.1,
    "faceValue": 0.1,
    "accruedInterest": 0.1,
    "firstTradeTime": 0,
    "lastTradeTime": 0,
    "bid_tickvalue": 0.1,
    "ask_tickvalue": 0.1
  },
  "property2": {
    "updateTime": 0,
    "currency": "string",
    "isin": "string",
    "description": "string",
    "basis": "string",
    "refToSite": "string",
    "custom": 0,
    "profitCurrency": "string",
    "marginCurrency": "string",
    "precision": 0,
    "bkgndColor": 0,
    "digits": 0,
    "points": 0.1,
    "limitPoints": 0.1,
    "id": 0,
    "depthOfMarket": 0,
    "spread": 0,
    "tickValue": 0.1,
    "tickSize": 0.1,
    "contractSize": 0.1,
    "gtcMode": "Cancelled",
    "calcMode": "Forex",
    "settlementPrice": 0.1,
    "lowerLimit": 0.1,
    "upperLimit": 0.1,
    "faceValue": 0.1,
    "accruedInterest": 0.1,
    "firstTradeTime": 0,
    "lastTradeTime": 0,
    "bid_tickvalue": 0.1,
    "ask_tickvalue": 0.1
  }
}
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

List of avaliable symbols

GET
/SymbolList
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

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": "DONE",
  "stackTrace": "string"
}

Latest quote for the specified symbol

GET
/GetQuote
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"
symbolstring

Symbol

Default"EURUSD"
msNotOlder?integer

If last quote arrived less than msOlderMs milliseconds ago function returns last quote, overwise - wait for new quote. If zero - always returns last quote.

Default0
Formatint32

Response Body

curl -X GET "https://api.metatraderapi.dev/GetQuote?id=%7B%7Bid%7D%7D&symbol=EURUSD&msNotOlder=0"
{
  "symbol": "string",
  "bid": 0.1,
  "ask": 0.1,
  "time": "2019-08-24T14:15:22Z",
  "last": 0.1,
  "volume": 0
}
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Latest quote for the specified symbol

GET
/GetQuoteMany
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"
symbolsarray<string>

Symbols

msNotOlder?integer

If last quote arrived less than msOlderMs milliseconds ago function returns last quote, overwise - wait for new quote. If zero - always returns last quote.

Default0
Formatint32

Response 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",
    "last": 0.1,
    "volume": 0
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Market Watch for the specified symbols

GET
/MarketWatchMany
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"
symbolsarray<string>

Symbols

Response Body

curl -X GET "https://api.metatraderapi.dev/MarketWatchMany?id=%7B%7Bid%7D%7D&symbols=string"
[
  {
    "symbol": "string",
    "high": 0.1,
    "low": 0.1,
    "openPrice": 0.1,
    "closePrice": 0.1,
    "dailyChange": 0.1,
    "bid": 0.1,
    "ask": 0.1,
    "spread": 0,
    "volume": 0
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Full infromation about symbol and his group

Go to

GET
/SymbolParams
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"
symbolstring

Required symbol

Default"EURUSD"

Response Body

curl -X GET "https://api.metatraderapi.dev/SymbolParams?id=%7B%7Bid%7D%7D&symbol=EURUSD"
{
  "symbol": "string",
  "symbolInfo": {
    "updateTime": 0,
    "currency": "string",
    "isin": "string",
    "description": "string",
    "basis": "string",
    "refToSite": "string",
    "custom": 0,
    "profitCurrency": "string",
    "marginCurrency": "string",
    "precision": 0,
    "bkgndColor": 0,
    "digits": 0,
    "points": 0.1,
    "limitPoints": 0.1,
    "id": 0,
    "depthOfMarket": 0,
    "spread": 0,
    "tickValue": 0.1,
    "tickSize": 0.1,
    "contractSize": 0.1,
    "gtcMode": "Cancelled",
    "calcMode": "Forex",
    "settlementPrice": 0.1,
    "lowerLimit": 0.1,
    "upperLimit": 0.1,
    "faceValue": 0.1,
    "accruedInterest": 0.1,
    "firstTradeTime": 0,
    "lastTradeTime": 0,
    "bid_tickvalue": 0.1,
    "ask_tickvalue": 0.1
  },
  "symbolGroup": {
    "groupName": "string",
    "deviationRate": 0,
    "roundRate": 0,
    "tradeMode": "Disabled",
    "sl": 0,
    "tp": 0,
    "tradeType": "Request",
    "fillPolicy": "NONE",
    "expiration": "NONE",
    "orderFlags": 0,
    "priceTimeout": 0,
    "requoteTimeout": 0,
    "requestLots": 0,
    "tmp1": 0,
    "minVolume": 0,
    "maxVolume": 0,
    "volumeStep": 0,
    "initialMargin": 0.1,
    "maintenanceMargin": 0.1,
    "initMarginRate": [
      0.1
    ],
    "mntnMarginRate": [
      0.1
    ],
    "hedgedMargin": 0.1,
    "swapType": "SwapNone",
    "swapLong": 0.1,
    "swapShort": 0.1,
    "threeDaysSwap": "Sunday",
    "swapRates": [
      0.1
    ],
    "minLots": 0.1,
    "maxLots": 0.1,
    "lotsStep": 0.1
  }
}
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Full infromation about symbol and his group for several symbols

Go to

GET
/SymbolParamsMany
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"
symbol?array<string>

Required symbol

limit?integer

If server has more than 'limit' symbols functon throws an exception

Default10000
Formatint32
filter?array<string>

List of fields that need to return. If not specified - all fields.

Response Body

curl -X GET "https://api.metatraderapi.dev/SymbolParamsMany?id=%7B%7Bid%7D%7D&symbol=string&limit=10000&filter=string"
[
  {
    "symbol": "string",
    "symbolInfo": {
      "updateTime": 0,
      "currency": "string",
      "isin": "string",
      "description": "string",
      "basis": "string",
      "refToSite": "string",
      "custom": 0,
      "profitCurrency": "string",
      "marginCurrency": "string",
      "precision": 0,
      "bkgndColor": 0,
      "digits": 0,
      "points": 0.1,
      "limitPoints": 0.1,
      "id": 0,
      "depthOfMarket": 0,
      "spread": 0,
      "tickValue": 0.1,
      "tickSize": 0.1,
      "contractSize": 0.1,
      "gtcMode": "Cancelled",
      "calcMode": "Forex",
      "settlementPrice": 0.1,
      "lowerLimit": 0.1,
      "upperLimit": 0.1,
      "faceValue": 0.1,
      "accruedInterest": 0.1,
      "firstTradeTime": 0,
      "lastTradeTime": 0,
      "bid_tickvalue": 0.1,
      "ask_tickvalue": 0.1
    },
    "symbolGroup": {
      "groupName": "string",
      "deviationRate": 0,
      "roundRate": 0,
      "tradeMode": "Disabled",
      "sl": 0,
      "tp": 0,
      "tradeType": "Request",
      "fillPolicy": "NONE",
      "expiration": "NONE",
      "orderFlags": 0,
      "priceTimeout": 0,
      "requoteTimeout": 0,
      "requestLots": 0,
      "tmp1": 0,
      "minVolume": 0,
      "maxVolume": 0,
      "volumeStep": 0,
      "initialMargin": 0.1,
      "maintenanceMargin": 0.1,
      "initMarginRate": [
        0.1
      ],
      "mntnMarginRate": [
        0.1
      ],
      "hedgedMargin": 0.1,
      "swapType": "SwapNone",
      "swapLong": 0.1,
      "swapShort": 0.1,
      "threeDaysSwap": "Sunday",
      "swapRates": [
        0.1
      ],
      "minLots": 0.1,
      "maxLots": 0.1,
      "lotsStep": 0.1
    }
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Quote and trade sessions(open and close time) for the symbol. Returns 2 arrays. One for quotes and one for trades. Each array contains 7 elements for each day of weeks starting from Sunday.

GET
/SymbolSessions
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"
symbolstring

Required symbol

Default"EURUSD"

Response Body

curl -X GET "https://api.metatraderapi.dev/SymbolSessions?id=%7B%7Bid%7D%7D&symbol=EURUSD"
{
  "quotes": [
    [
      {
        "startTime": 0,
        "endTime": 0
      }
    ]
  ],
  "trades": [
    [
      {
        "startTime": 0,
        "endTime": 0
      }
    ]
  ]
}
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Server timezone.

Returns an array of avaliable symbols

GET
/ServerTimezone
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Response Body

curl -X GET "https://api.metatraderapi.dev/ServerTimezone?id=string"
0
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Check market open or not for specified symbol.

Returns an array of avaliable symbols

GET
/IsTradeSession
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"
symbolstring

Symbol

Default"EURUSD"

Response Body

curl -X GET "https://api.metatraderapi.dev/IsTradeSession?id=%7B%7Bid%7D%7D&symbol=EURUSD"
true
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Check market open or not for specified symbol.

Returns an array of avaliable symbols

GET
/IsTradeSessionMany
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"
symbols?array<string>

Symbols. If not specified - all symbols.

Response Body

curl -X GET "https://api.metatraderapi.dev/IsTradeSessionMany?id=%7B%7Bid%7D%7D&symbols=string"
[
  {
    "symbol": "string",
    "active": true
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Check market open or not for specified symbol.

Returns an array of avaliable symbols

GET
/IsQuoteSession
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"
symbolstring

Symbol

Default"EURUSD"

Response Body

curl -X GET "https://api.metatraderapi.dev/IsQuoteSession?id=%7B%7Bid%7D%7D&symbol=EURUSD"
[
  {
    "symbol": "string",
    "active": true
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Check market open or not for specified symbol.

Returns an array of avaliable symbols

GET
/IsQuoteSessionMany
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"
symbols?array<string>

Symbols. If not specified - all symbols.

Response Body

curl -X GET "https://api.metatraderapi.dev/IsQuoteSessionMany?id=%7B%7Bid%7D%7D&symbols=string"
[
  {
    "symbol": "string",
    "active": true
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Tick value.

Returns an array of double values

GET
/GetTickValueMany
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"
symbol?array<string>

Symbols array

Response Body

curl -X GET "https://api.metatraderapi.dev/GetTickValueMany?id=%7B%7Bid%7D%7D&symbol=string"
[
  {
    "property1": 0.1,
    "property2": 0.1
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Tick value as array.

GET
/TickValueWithSize
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"
symbol?array<string>

Symbols array

Response Body

curl -X GET "https://api.metatraderapi.dev/TickValueWithSize?id=%7B%7Bid%7D%7D&symbol=string"
[
  {
    "symbol": "string",
    "tickValue": 0.1,
    "tickSize": 0.1,
    "tickValueMq": 0.1
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Mail inbox

GET
/Mails
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"

Response Body

curl -X GET "https://api.metatraderapi.dev/Mails?id=%7B%7Bid%7D%7D"
[
  {
    "id": 0,
    "time": "2019-08-24T14:15:22Z",
    "from": "string",
    "to": "string",
    "subject": "string",
    "body": "string"
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Required margin

GET
/RequiredMargin
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"{{id}}"
symbolstring

Symbol

Default"EURUSD"
lotsnumber

Lots

Default1
Formatdouble
type?string

Buy or Sell

Default"DealBuy"
Value in"DealBuy" | "DealSell" | "Balance" | "Credit" | "Charge" | "Correction" | "Bonus" | "Commission" | "DailyCommission" | "MonthlyCommission" | "DailyAgentCommission" | "MonthlyAgentCommission" | "InterestRate" | "CanceledBuy" | "CanceledSell"
price?number

Price

Default0
Formatdouble

Response Body

curl -X GET "https://api.metatraderapi.dev/RequiredMargin?id=%7B%7Bid%7D%7D&symbol=EURUSD&lots=1&type=DealBuy&price=0"
0.1
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}