Skip to Content
Trading

Get Trades

GET
/v1/account/trades

Retrieves trades of the account the token acts on, executed within the specified date range, sorted by timestamp in descending order (use order=ASC for ascending).

Parameter Specification

ParameterAccepted FormatsExample Values
fromISO 8601 (UTC, ending in Z)2025-09-25T13:45:30Z (s), 2025-09-25T13:45:30.123Z (ms), 2025-09-25T13:45:30.123456Z (us)
Epoch1695647130 (s), 1695647130123 (ms), 1695647130123456 (us), 1695647130123456789 (ns)
Date2025-09-25
toISO 8601 (UTC, ending in Z)2025-09-26T18:00:00Z (s), 2025-09-26T18:00:00.456Z (ms), 2025-09-26T18:00:00.456789Z (us)
Epoch1695734400 (s), 1695734400456 (ms), 1695734400456789 (us), 1695734400456789123 (ns)
Date2025-09-26
instrument_codeStringBTC_EUR_P (a single instrument code)
orderStringASC or DESC
max_page_sizeInteger3
cursorStringeyJlcG9jaCI6IjE3NjQ2NzUxNDk5MzkzNjQwMDEiLCJjcW8iOiIyMTA1MzM3MTM0NDYxMjU3In0=

Parameter Limits

ParameterConstraints / Range
fromOn or after 2024-01-01; cannot be in the future
toOn or after 2024-01-01; must be strictly after from and no more than 30 days after from; exclusive
max_page_sizeInteger between 1 and 100
instrument_codeOptional; must be a valid instrument code
orderOptional; ASC or DESC (case-insensitive)

Parameter Defaults

Parameter(s)Default Behavior
from / toNeither provided: from = midnight UTC of the previous day, to = present time
from / toOnly from provided: to = 1 day later or present time, whichever is smaller
from / toOnly to provided: from = midnight UTC of the day before to
instrument_codeDefaults to all instruments
orderDefaults to DESC
max_page_sizeDefaults to 100

from/to accept epoch (s, ms, µs or ns) or an ISO 8601 UTC timestamp ending in Z (or YYYY-MM-DD). from must be on or after 2024-01-01, not in the future, and strictly before to; to is exclusive.

cursor is an opaque string. Pass the value from the previous response unchanged; it is null on the last page.

Unknown query parameters are rejected with 400 UNEXPECTED_PARAMETERS.

Required API scope: any valid API key. This endpoint is rate-limited.

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key created in the One Trading UI, sent as Authorization: Bearer <token>. Each endpoint lists the key permission it needs.

Query Parameters

from?string

Specifies the start of the period (inclusive). Accepts date strings (YYYY-MM-DD), ISO 8601 UTC strings ending in Z, or numeric timestamps in seconds, milliseconds, microseconds or nanoseconds.

to?string

Specifies the end of the period (exclusive). Accepts date strings (YYYY-MM-DD), ISO 8601 UTC strings ending in Z, or numeric timestamps in seconds, milliseconds, microseconds or nanoseconds.

instrument_code?string

Instrument code to filter by, e.g. BTC_EUR_P. Defaults to all instruments.

max_page_size?string

Set max desired page size, between 1 and 100. If no value is provided, by default a maximum of 100 results per page are returned.

cursor?string

Opaque pointer to the next page, taken unchanged from the cursor of the previous response.

order?string

Sort order by trade time. DESC (default) or ASC, case-insensitive.

Default"DESC"
Value in"ASC""DESC"

Response Body

OK

application/json
  1. response
trade_history*array<>
max_page_size*integer

The page size applied to this request.

cursor*|

Opaque cursor for the next page. Pass it unchanged as the cursor query parameter; null on the last page.

from*string

Start of the queried period (ISO 8601, nanosecond precision), after defaults are applied.

Formatdate-time
to*string

End of the queried period (ISO 8601, nanosecond precision, exclusive), after defaults are applied.

Formatdate-time
Example Request
curl -X GET 'https://api.onetrading.com/fast/v1/account/trades?from=2026-01-01&to=2026-01-30&max_page_size=2'
Example Response
{  "trade_history": [    {      "fee": {        "fee_amount": "0.0020505",        "fee_currency": "USD"      },      "trade": {        "account_id": "aaaba8bd-3195-4f72-87ff-98720a940f23",        "order_id": "71912cd5-1df2-4c14-3e59-377765d23b01",        "trade_id": "aa765409-4719-5358-b27a-3fabedf27164",        "time": "2025-12-02T11:32:32.515Z",        "time_nanos": "2025-12-02T11:32:32.515915000Z",        "instrument_code": "DOGE_USD_P",        "side": "BUY",        "matched_as": "TAKER",        "time_in_force": "GOOD_TILL_CANCELLED",        "order_type": "API",        "price": "0.1367",        "amount": "100",        "filled_amount": "100",        "sequence": "92096745784",        "open_position_amount": "0",        "position_id": "1764675149939364"      }    },    {      "fee": {        "fee_amount": "0.002052",        "fee_currency": "USD"      },      "trade": {        "account_id": "aaaba8bd-3195-4f72-87ff-98720a940f23",        "order_id": "02f52442-066e-4ebb-3f85-fbe8010d2861",        "trade_id": "ed076827-96b9-52af-80fa-b516fd2c02c1",        "time": "2025-12-02T11:32:29.939Z",        "time_nanos": "2025-12-02T11:32:29.939364000Z",        "instrument_code": "DOGE_USD_P",        "side": "BUY",        "matched_as": "TAKER",        "time_in_force": "GOOD_TILL_CANCELLED",        "order_type": "API",        "price": "0.1368",        "amount": "100",        "filled_amount": "100",        "sequence": "92096745379",        "open_position_amount": "100",        "position_id": "1764675149939364"      }    }  ],  "from": "2025-12-01T00:00:00.000000000Z",  "to": "2025-12-02T12:00:00.000000000Z",  "max_page_size": 2,  "cursor": "eyJlcG9jaCI6IjE3NjQ2NzUxNDk5MzkzNjQwMDEiLCJjcW8iOiIyMTA1MzM3MTM0NDYxMjU3In0="}