Skip to main content
cURL
curl --request GET \
  --url https://test.deribit.com/api/v2/private/get_order_history_by_instrument \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "id": 1032,
  "method": "private/get_order_history_by_instrument",
  "params": {
    "instrument_name": "BTC-PERPETUAL",
    "count": 1
  }
}
'
{
  "jsonrpc": "2.0",
  "id": 9305,
  "result": [
    {
      "time_in_force": "good_til_cancelled",
      "reduce_only": false,
      "price": 3886.5,
      "post_only": false,
      "order_type": "limit",
      "order_state": "filled",
      "order_id": "146475",
      "max_show": 40,
      "last_update_timestamp": 1550661808761,
      "label": "",
      "is_rebalance": false,
      "is_liquidation": false,
      "instrument_name": "BTC-PERPETUAL",
      "filled_amount": 40,
      "direction": "buy",
      "creation_timestamp": 1550661808761,
      "average_price": 3659.8,
      "api": true,
      "amount": 40
    }
  ]
}

Query Parameters

instrument_name
string
required

Instrument name Unique instrument identifier

Example:

"BTC-PERPETUAL"

count
integer

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

Required range: 1 <= x <= 1000
offset
integer

The offset for pagination, default - 0

Example:

10

include_old
boolean

Include in result orders older than 2 days, default - false

Example:

false

include_unfilled
boolean

Include in result fully unfilled closed orders, default - false

Example:

false

with_continuation
boolean

When set to true, the API response format changes from a simple list of orders to an object containing the orders and a continuation token.

continuation
string

Continuation token for pagination

Example:

"xY7T6cutS3t2B9YtaDkE6TS379oKnkzTvmEDUnEUP2Msa9xKWNNaT"

historical
boolean

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

Response

200 - application/json

Success response

jsonrpc
enum<string>
required

The JSON-RPC version (2.0)

Available options:
2.0
result
object[]
required
id
integer

The id that was sent in the request