MetaTrader 5 APIMarket data
For AI agents: this page is also available as Markdown at /docs/mt5/market-data.md. The index of every docs page is /docs/llms.txt.
MetaTrader 5 Market Data API
Pull MetaTrader 5 market data over REST: the broker's symbol list, latest quotes, full contract specifications, OHLC price history for any timeframe, and broker server time. For a continuous tick feed, use the WebSocket prices stream instead of polling.
How market data works on MT5
- Real volume where the broker has it. For exchange instruments such as stocks and futures, MT5 can carry traded volume and a last price; realVolume and last are then filled. For forex they stay 0 and tickVolume is the figure to use.
- Same nine timeframes as MT4. The API serves M1, M5, M15, M30, H1, H4, D1, W1 and MN1 (or 5min, 1h, 1d) on both platforms. MT5's extra intermediate timeframes such as M2 or H6 are not exposed.
- Warm symbols before trading. A symbol outside Market Watch has no live price until it's added. /SymbolSelect adds up to 100 in one call and waits for their first quotes, so the first order on each one doesn't have to.
/mt5/{account_id}/symbolsNames of all symbols available in Market Watch. Use the returned names verbatim with /getQuote, /SymbolInfo, /PriceHistory, and /OrderSend. Many brokers suffix their symbols (EURUSD.sd, XAUUSD.r), so discover the exact spelling here instead of assuming plain names. A symbol not in Market Watch can't stream ticks until it's added; a getQuote call enables it on demand, and /SymbolSelect adds up to 100 at once.
curl -H "X-API-Key: fxs_live_..." \
https://api.fxsocket.com/mt5/{account_id}/symbols["EURUSD.sd", "GBPUSD.sd", "USDJPY.sd", "XAUUSD.sd", "..."]
/mt5/{account_id}/getQuoteLatest tick for a symbol: the most recent bid, ask, last, volume, and broker server time. If the symbol isn't yet in Market Watch it's enabled on demand, which may add a small delay on the first call. For continuous ticks use the WebSocket prices topic instead.
symbol(required): Symbol name as listed by /symbols (e.g. EURUSD, XAUUSD).
curl -H "X-API-Key: fxs_live_..." \
"https://api.fxsocket.com/mt5/{account_id}/getQuote?symbol=EURUSD"{
"symbol": "EURUSD",
"bid": 1.15325,
"ask": 1.15333,
"time": "2026-06-11T08:55:56.728Z",
"last": 0.0,
"volume": 0
}/mt5/{account_id}/PriceHistoryOHLC bars for a symbol and timeframe: one candle per bar in the requested window. MT5 fetches missing history from the broker on demand, so wide ranges on small timeframes can take several seconds. An empty response is normal when the window predates the broker's retained history or covers a closed market.
symbol(required): Symbol name as listed by /symbols.timeframe(required): MT5 labels (M1, M5, M15, M30, H1, H4, D1, W1, MN1) or human forms (5min, 1h, 1d).from: Inclusive lower bound (broker server time). ISO-8601 or YYYY-MM-DD. Absent → epoch.to: Inclusive upper bound, same formats. Absent → now.
curl -H "X-API-Key: fxs_live_..." \
"https://api.fxsocket.com/mt5/{account_id}/PriceHistory?symbol=EURUSD&timeframe=H1&from=2026-01-01&to=2026-12-31"[{
"time": "2026-06-11T08:00:00Z",
"open": 1.15301,
"high": 1.15348,
"low": 1.15289,
"close": 1.15330,
"tickVolume": 1243,
"realVolume": 0,
"spread": 7
}]/mt5/{account_id}/SymbolInfoContract specification for a symbol: digits, point, spread, contract size, tick size/value, volume min/max/step, trade mode, swap rates, base/quote/margin currencies, and what the broker accepts for it: orderModes (market, limit, stop, stopLimit, sl, tp, closeBy), expirationModes for pending orders (gtc, day, specified, specifiedDay) and fillingModes (fok, ioc, boc). Call this before /OrderSend to validate volumes and round prices to the right precision. Pass symbols instead of symbol to look up to 100 at once: the reply is then {"symbols": [...], "errors": [...]}, and a symbol that fails lands in errors with its own symbol, error code and message instead of failing the whole request.
symbol: Symbol name as listed by /symbols. Required unless symbols is given.symbols: Comma-separated list of up to 100 symbols, instead of symbol.
curl -H "X-API-Key: fxs_live_..." \
"https://api.fxsocket.com/mt5/{account_id}/SymbolInfo?symbol=EURUSD"{
"symbol": "EURUSD",
"description": "1 Lot= 100,000 EUR",
"digits": 5,
"point": 0.00001,
"tickSize": 0.00001,
"tickValue": 1.0,
"contractSize": 100000.0,
"volumeMin": 0.01,
"volumeMax": 150000.0,
"volumeStep": 0.01,
"stopsLevel": 1,
"freezeLevel": 0,
"spread": 7,
"tradeMode": "Full",
"swapLong": -3.22,
"swapShort": 1.1,
"bid": 1.15324,
"ask": 1.15331,
"currencyBase": "EUR",
"currencyProfit": "USD",
"currencyMargin": "EUR",
"orderModes": ["market", "limit", "stop", "stopLimit", "sl", "tp", "closeBy"],
"expirationModes": ["gtc", "day", "specified", "specifiedDay"],
"fillingModes": ["fok", "ioc"]
}/mt5/{account_id}/SymbolSelectPut up to 100 symbols into Market Watch in one call, then wait once, at most a second, until the newly added ones quote. Send a strategy's or a copier's symbols before its first order, so that order doesn't wait for a cold symbol. selected false means the broker has no symbol by that name; quoting false means it was added but had no price yet within that second (or the broker lists it without a feed). A read-only key gets a 403 here, since the call changes the terminal's Market Watch.
symbols(required): Array of up to 100 symbol names as listed by /symbols.
{
"symbols": ["EURUSD", "GBPUSD", "XAUUSD"]
}curl -X POST https://api.fxsocket.com/mt5/{account_id}/SymbolSelect \
-H "X-API-Key: fxs_live_..." \
-H "Content-Type: application/json" \
-d '{"symbols":["EURUSD","GBPUSD","XAUUSD"]}'[
{ "symbol": "EURUSD", "selected": true, "quoting": true },
{ "symbol": "GBPUSD", "selected": true, "quoting": true },
{ "symbol": "XAUUSD", "selected": true, "quoting": false }
]/mt5/{account_id}/ServerTimezoneBroker server time and its offset from UTC. Timestamps across the API are labelled Z but run on broker server time; use utcOffsetSeconds to translate them to real UTC (utc = serverTime − utcOffsetSeconds). Most MetaTrader brokers run on EET (UTC+2, UTC+3 with DST). Fields whose names end in Utc, and the ts of stream frames, are real UTC already. Live data (trade replies, stream events, /PendingOrders) carries them next to the server time; history endpoints stay in server time only, because today's offset would be an hour off for times on the other side of a daylight-saving switch.
curl -H "X-API-Key: fxs_live_..." \
https://api.fxsocket.com/mt5/{account_id}/ServerTimezone{
"serverTime": "2026-06-11T08:55:57.000Z",
"utcOffsetSeconds": 0
}