Skip to content

History

Retrieve historical deals (executed trades) for the account. You can use either a named period or a custom date range.

GET /v1/history

You must provide either a period or a from/to date range.

ParameterTypeRequiredDescription
periodstringNoOne of: today, last_3_days, last_week, last_month, last_3_months, last_6_months, all
ParameterTypeRequiredDescription
fromstringNoStart date in YYYY-MM-DD format
tostringNoEnd date in YYYY-MM-DD format

Using a named period:

Terminal window
curl -X GET "https://interface.xbtfx.com/v1/history?period=last_week" \
-H "Authorization: Bearer your_api_key_here"

Using a custom date range:

Terminal window
curl -X GET "https://interface.xbtfx.com/v1/history?from=2026-01-01&to=2026-03-31" \
-H "Authorization: Bearer your_api_key_here"
{
"deals": [
{
"ticket": 11223344,
"symbol": "EURUSD",
"side": "buy",
"entry": "in",
"volume": 0.1,
"price": 1.08757,
"profit": 0.00,
"time": "2026-03-15T10:30:00Z",
"order": 55667788,
"position": 12345678
},
{
"ticket": 11223345,
"symbol": "EURUSD",
"side": "sell",
"entry": "out",
"volume": 0.1,
"price": 1.08950,
"profit": 19.30,
"time": "2026-03-15T14:45:00Z",
"order": 55667789,
"position": 12345678
}
]
}
FieldTypeDescription
ticketintegerDeal ticket number
symbolstringTrading symbol
sidestringDeal direction: buy or sell
entrystringDeal entry type: in (open), out (close), in_out (close and open), out_by (close by opposite)
volumenumberDeal volume in lots
pricenumberExecution price
profitnumberRealized profit/loss (non-zero for closing deals)
timestringExecution timestamp (ISO 8601)
orderintegerRelated order ticket
positionintegerRelated position ticket