# Market data and history

> MetaTrader API docs for developers and coding agents. Last updated: 2026-10-14. Index: https://www.metatraderapi.net/llms.txt
>
> © 2026 Apex Vanguard Dynamics LLC. You, and the software tools and AI agents working for you, may read and use this documentation to build, run and support integrations with MetaTrader API; its code examples may be copied into your own software. Republishing or redistributing the documentation, in whole or in substantial part, is not permitted. Terms: https://www.metatraderapi.net/en/terms/

All endpoints below are `GET`, with `x-api-key` and `?id=` like every call. Times in responses are UTC.

## Account

| Endpoint | Returns |
|---|---|
| `/AccountSummary` | `balance, credit, profit, equity, margin, freeMargin, marginLevel, leverage, currency, type ("demo"/"real"/"contest"), isInvestor, synced, currencyDigits` |
| `/AccountDetails` | `login`, `userName`, `server`, `company`, `currency`, `leverage`, `marginMode` |
| `/IsInvestor` | `true` when connected with the investor (read-only) password |
| `/CheckConnect` | `true` / `false`: is the account connected to its broker right now |
| `/Ping` | `"pong"`: your key, the account id and the account's API connection work. It does not check the broker: use `/CheckConnect` for that |

## Symbols

| Endpoint | Returns |
|---|---|
| `/SymbolList` | the account's symbol names |
| `/Symbols` | the number of symbols |
| `/SymbolParams?symbol=` | `symbolInfo` (digits, `points`, `contractSize`, `tickValue`, `tickSize`, `spread`, `stopsLevel`, `freezeLevel`, currencies) and `symbolGroup` (`minVolume`, `maxVolume`, `volumeStep` in lots x 10000, swaps, margins, filling and expiration modes) |
| `/SymbolParamsMany?symbol=A&symbol=B` | the same for several symbols |
| `/SymbolSessions?symbol=` | returns empty session lists on both platforms (kept for compatibility) |
| `/IsTradeSession?symbol=`, `/IsQuoteSession?symbol=` | `true` when a price for the symbol arrived in the last 2 minutes (`/IsTradeSession` also requires the symbol to be tradable). An estimate from live prices, not the broker's session calendar. `...Many` variants take several symbols |
| `/ServerTimezone` | the broker server's offset from UTC in minutes (e.g. `180` = UTC+3) |

Repeated parameters can be written as `symbol=EURUSD&symbol=GBPUSD` or `symbols=EURUSD,GBPUSD`.

## Quotes

| Endpoint | Returns |
|---|---|
| `/GetQuote?symbol=` | `symbol, bid, ask, time, last, volume` |
| `/GetQuoteMany?symbols=EURUSD,GBPUSD` | the same for several symbols |

`/GetQuote` answers are cached for 250 ms per account and symbol (response header `x-cache: HIT`). Add `cached=0` to bypass it. For continuous prices, use the WebSocket instead of polling: https://www.metatraderapi.net/docs/streaming.md.

## Price history (bars)

| Endpoint | Params |
|---|---|
| `/PriceHistory` | `symbol`, `from`, `to`, `timeFrame` (all required) |
| `/PriceHistoryEx` | `symbol`, `from`, `numBars`, `timeFrame`: the `numBars` bars up to `from`, counting backwards (MetaTrader's rule). `from` is read in broker server time here |
| `/PriceHistoryToday` | `symbol`, `timeFrame` |
| `/PriceHistoryMonth` | `symbol`, `year`, `month`, `day`, `timeFrame` |
| `/PriceHistoryHighLow` | like `/PriceHistory`, plus the range's `high` and `low` |
| `...Many` variants | the same for several symbols |

- `timeFrame`: `M1`, `M2`, `M3`, `M4`, `M5`, `M6`, `M10`, `M12`, `M15`, `M20`, `M30`, `H1`, `H2`, `H3`, `H4`, `H6`, `H8`, `H12`, `D1`, `W1`, `MN1`, or the numeric MetaTrader 5 code (e.g. `16385` for H1).
- `from` / `to`: ISO-8601 (`2026-10-01T00:00:00Z`) or unix seconds, UTC.
- Each bar: `time, openPrice, highPrice, lowPrice, closePrice, tickVolume, spread, volume`.
- Large ranges at small timeframes produce large responses; request what you need in pieces (for example one month of M1 at a time).

## Trade and balance history

See https://www.metatraderapi.net/docs/orders.md: `/OrderHistory`, `/OrderHistoryPagination`, `/HistoryPositions`, `/HistoryDealsByPositionId`, `/BalanceHistory`.

## Calculations

| Endpoint | Params | Returns |
|---|---|---|
| `/RequiredMargin` | `symbol`, `lots`, `operation`, `price` | margin needed for that order |
| `/GetTickValueMany` | `symbol` (repeatable) | tick values |

## Economic calendar

`GET /news` (any valid API key, no `?id=` needed) returns this week's events: `title, country, impact, time, forecast, previous`. Filter with `?country=USD&impact=High`.
