v3

latestOpenAPI 3.0.02026-07-311784111.3 MB
Trading
Private

Retrieves the latest user trades that have occurred for a specific instrument. Returns trade details including price, amount, direction, timestamp, trade ID, and order ID.

Results can be filtered by sequence number range or timestamp range. Use the count parameter to limit the number of trades returned, and sorting to control the order (ascending or descending by trade ID). Use historical to retrieve historical trade data.

Main accounts may use the subaccount_id parameter to retrieve trade data for a specific subaccount (requires mainaccount scope).

📖 Related Article: Accessing Historical Trades and Orders Using API

Scope: trade:read

Try in API console

get/private/get_user_trades_by_instrument

Query parameters

instrument_namestring required

Unique instrument identifier

Example:BTC-PERPETUAL

Instrument name

start_seqinteger

The sequence number of the first trade to be returned

end_seqinteger

The sequence number of the last trade to be returned

countinteger

Number of requested items, default - 10, maximum - 1000

start_timestampinteger

The timestamp (milliseconds since the Unix epoch)

Example:1536569522277

The earliest timestamp to return result from (milliseconds since the UNIX epoch). When param is provided trades are returned from the earliest

end_timestampinteger

The timestamp (milliseconds since the Unix epoch)

Example:1536569522277

The most recent timestamp to return result from (milliseconds since the UNIX epoch). Only one of params: start_timestamp, end_timestamp is truly required

historicalboolean

Determines whether historical trade and order records should be retrieved.

  • false (default): Returns recent records: orders for 30 min, trades for 24h.
  • true: Fetches historical records, available after a short delay due to indexing. Recent data is not included.

📖 Related Article: Accessing Historical Trades and Orders Using API

sorting'asc' | 'desc' | 'default'

Direction of results sorting (default value means no sorting, results will be returned in order in which they left the database)

subaccount_idinteger
Example:9

Id of a subaccount

Response

Success response

jsonrpc'2.0' required

The JSON-RPC version (2.0)

idinteger

The id that was sent in the request

Example response

{
  "result": {
    "trades": [
      {
        "instrument_name": "BTC-PERPETUAL",
        "timestamp": 1517329113791,
        "block_trade_id": "154"
      }
    ]
  }
}