MetaTrader API
Metatrader 5 api

Quote History

OHLC history

Price history for 30 days

GET
/PriceHistoryMonth
x-api-key<token>

Your API key

In: header

Query Parameters

idstring
Default"{{id}}"
symbolstring
Default"EURUSD"
yearinteger
Default2022
Formatint32
monthinteger
Default6
Formatint32
dayinteger
Default1
Formatint32
timeFrameinteger
Default240
Formatint32

Response Body

curl -X GET "https://api.metatraderapi.dev/PriceHistoryMonth?id=%7B%7Bid%7D%7D&symbol=EURUSD&year=2022&month=6&day=1&timeFrame=240"
[
  {
    "time": "2019-08-24T14:15:22Z",
    "openPrice": 0.1,
    "highPrice": 0.1,
    "lowPrice": 0.1,
    "closePrice": 0.1,
    "tickVolume": 0,
    "spread": 0,
    "volume": 0
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

OHLC for 30 days for several symbols

GET
/PriceHistoryMonthMany
x-api-key<token>

Your API key

In: header

Query Parameters

idstring
Default"{{id}}"
symbolsarray<string>
yearinteger
Default2022
Formatint32
monthinteger
Default6
Formatint32
dayinteger
Default1
Formatint32
timeFrameinteger
Default240
Formatint32

Response Body

curl -X GET "https://api.metatraderapi.dev/PriceHistoryMonthMany?id=%7B%7Bid%7D%7D&symbols=string&year=2022&month=6&day=1&timeFrame=240"
[
  {
    "symbol": "string",
    "bars": [
      {
        "time": "2019-08-24T14:15:22Z",
        "openPrice": 0.1,
        "highPrice": 0.1,
        "lowPrice": 0.1,
        "closePrice": 0.1,
        "tickVolume": 0,
        "spread": 0,
        "volume": 0
      }
    ]
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Price history for today

GET
/PriceHistoryToday
x-api-key<token>

Your API key

In: header

Query Parameters

idstring
Default"{{id}}"
symbolstring

Symbol

Default"EURUSD"
timeFrameinteger
Default240
Formatint32

Response Body

curl -X GET "https://api.metatraderapi.dev/PriceHistoryToday?id=%7B%7Bid%7D%7D&symbol=EURUSD&timeFrame=240"
[
  {
    "time": "2019-08-24T14:15:22Z",
    "openPrice": 0.1,
    "highPrice": 0.1,
    "lowPrice": 0.1,
    "closePrice": 0.1,
    "tickVolume": 0,
    "spread": 0,
    "volume": 0
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Price history for today for several symbols

GET
/PriceHistoryTodayMany
x-api-key<token>

Your API key

In: header

Query Parameters

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

Symbol

timeFrameinteger
Default240
Formatint32

Response Body

curl -X GET "https://api.metatraderapi.dev/PriceHistoryTodayMany?id=%7B%7Bid%7D%7D&symbols=string&timeFrame=240"
[
  {
    "symbol": "string",
    "bars": [
      {
        "time": "2019-08-24T14:15:22Z",
        "openPrice": 0.1,
        "highPrice": 0.1,
        "lowPrice": 0.1,
        "closePrice": 0.1,
        "tickVolume": 0,
        "spread": 0,
        "volume": 0
      }
    ]
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Price history for range

GET
/PriceHistory
x-api-key<token>

Your API key

In: header

Query Parameters

idstring
Default"{{id}}"
symbolstring
Default"EURUSD"
fromstring
Default"2022-01-01T00:00:00"
tostring
Default"2022-03-01T00:00:00"
timeFrameinteger
Default240
Formatint32

Response Body

curl -X GET "https://api.metatraderapi.dev/PriceHistory?id=%7B%7Bid%7D%7D&symbol=EURUSD&from=2022-01-01T00%3A00%3A00&to=2022-03-01T00%3A00%3A00&timeFrame=240"
[
  {
    "time": "2019-08-24T14:15:22Z",
    "openPrice": 0.1,
    "highPrice": 0.1,
    "lowPrice": 0.1,
    "closePrice": 0.1,
    "tickVolume": 0,
    "spread": 0,
    "volume": 0
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Price history for several symbols

GET
/PriceHistoryMany
x-api-key<token>

Your API key

In: header

Query Parameters

idstring
Default"{{id}}"
symbolarray<string>
fromstring
Default"2024-01-01T00:00:00"
tostring
Default"2024-03-01T00:00:00"
timeFrameinteger
Default240
Formatint32

Response Body

curl -X GET "https://api.metatraderapi.dev/PriceHistoryMany?id=%7B%7Bid%7D%7D&symbol=string&from=2024-01-01T00%3A00%3A00&to=2024-03-01T00%3A00%3A00&timeFrame=240"
[
  {
    "symbol": "string",
    "bars": [
      {
        "time": "2019-08-24T14:15:22Z",
        "openPrice": 0.1,
        "highPrice": 0.1,
        "lowPrice": 0.1,
        "closePrice": 0.1,
        "tickVolume": 0,
        "spread": 0,
        "volume": 0
      }
    ],
    "exception": "string"
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Price history for range

GET
/PriceHistoryHighLow
x-api-key<token>

Your API key

In: header

Query Parameters

idstring
Default"{{id}}"
symbolstring
Default"EURUSD"
fromstring
Default"2022-11-01T00:00:00"
tostring
Default"2022-11-02T00:00:00"
timeFrameinteger
Default60
Formatint32

Response Body

curl -X GET "https://api.metatraderapi.dev/PriceHistoryHighLow?id=%7B%7Bid%7D%7D&symbol=EURUSD&from=2022-11-01T00%3A00%3A00&to=2022-11-02T00%3A00%3A00&timeFrame=60"
{
  "time": "2019-08-24T14:15:22Z",
  "openPrice": 0.1,
  "highPrice": 0.1,
  "lowPrice": 0.1,
  "closePrice": 0.1,
  "tickVolume": 0,
  "spread": 0,
  "volume": 0
}
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Request quote history from specified date for several bars back to the past

GET
/PriceHistoryEx
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"
symbolstring
Default"EURUSD"
fromstring
Default"2022-03-01T00:00:00"
numBarsinteger
Default10
Formatint32
timeFrameinteger
Default240
Formatint32

Response Body

curl -X GET "https://api.metatraderapi.dev/PriceHistoryEx?id=demo-token-mt5&symbol=EURUSD&from=2022-03-01T00%3A00%3A00&numBars=10&timeFrame=240"
[
  {
    "time": "2019-08-24T14:15:22Z",
    "openPrice": 0.1,
    "highPrice": 0.1,
    "lowPrice": 0.1,
    "closePrice": 0.1,
    "tickVolume": 0,
    "spread": 0,
    "volume": 0
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}

Request quote history from specified date for several bars back to the past

GET
/PriceHistoryExMany
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"
symbolarray<string>
fromstring
Default"2022-03-01T00:00:00"
numBarsinteger
Default10
Formatint32
timeFrameinteger
Default240
Formatint32

Response Body

curl -X GET "https://api.metatraderapi.dev/PriceHistoryExMany?id=demo-token-mt5&symbol=string&from=2022-03-01T00%3A00%3A00&numBars=10&timeFrame=240"
[
  {
    "symbol": "string",
    "bars": [
      {
        "time": "2019-08-24T14:15:22Z",
        "openPrice": 0.1,
        "highPrice": 0.1,
        "lowPrice": 0.1,
        "closePrice": 0.1,
        "tickVolume": 0,
        "spread": 0,
        "volume": 0
      }
    ],
    "exception": "string"
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}