History
Retrieve historical deals (executed trades) for the account. You can use either a named period or a custom date range.
Endpoint
Section titled “Endpoint”GET /v1/history
Query Parameters
Section titled “Query Parameters”You must provide either a period or a from/to date range.
Named Periods
Section titled “Named Periods”| Parameter | Type | Required | Description |
|---|---|---|---|
period | string | No | One of: today, last_3_days, last_week, last_month, last_3_months, last_6_months, all |
Custom Date Range
Section titled “Custom Date Range”| Parameter | Type | Required | Description |
|---|---|---|---|
from | string | No | Start date in YYYY-MM-DD format |
to | string | No | End date in YYYY-MM-DD format |
Example Requests
Section titled “Example Requests”Using a named period:
curl -X GET "https://interface.xbtfx.com/v1/history?period=last_week" \ -H "Authorization: Bearer your_api_key_here"Using a custom date range:
curl -X GET "https://interface.xbtfx.com/v1/history?from=2026-01-01&to=2026-03-31" \ -H "Authorization: Bearer your_api_key_here"Response
Section titled “Response”{ "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 } ]}Response Fields
Section titled “Response Fields”| Field | Type | Description |
|---|---|---|
ticket | integer | Deal ticket number |
symbol | string | Trading symbol |
side | string | Deal direction: buy or sell |
entry | string | Deal entry type: in (open), out (close), in_out (close and open), out_by (close by opposite) |
volume | number | Deal volume in lots |
price | number | Execution price |
profit | number | Realized profit/loss (non-zero for closing deals) |
time | string | Execution timestamp (ISO 8601) |
order | integer | Related order ticket |
position | integer | Related position ticket |