Get price history
get_price_historyRecent price bars (candles: open, high, low, close, tick volume, spread) for one symbol from this account's broker, oldest first with bar-open times in UTC, for technical analysis such as trend, support and resistance, volatility or moving averages; timeframes M1 to MN1, up to 500 bars, the last bar still forming, and tick volume counts price changes rather than traded lots. The account must be online; an account whose terminal is not yet updated — rare — answers CAPABILITY_UNAVAILABLE instead, so use get_quotes for the current price meanwhile. Example: {"account_id": "", "instrument": "XAUUSD", "timeframe": "H1", "count": 100}
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"account_id": "<account_id>",
"timeframe": "<timeframe>"
},
"name": "get_price_history"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Bars to return, counting back from the current one: 1–500, default 100. Ask for what the analysis needs. | |
| symbol | No | Or the broker's own symbol, exactly as this broker names it. Send instrument or symbol, not both. | |
| timeframe | Yes | Bar size: M1–M30 minutes, H1 or H4 hours, D1 a day, W1 a week, MN1 a month. | |
| account_id | Yes | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. | |
| instrument | No | An instrument from list_instruments, e.g. XAUUSD; read as this account's own symbol for it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | One bar per row, oldest first; the last is still forming. | |
| symbol | Yes | ||
| columns | Yes | The order of each row's values: time_utc, open, high, low, close, tick_volume, spread (points). | |
| timeframe | Yes |