Get private orders history [Private]

Get a list of client orders by pair (e.g. BTC_USDT). Returns a list of order objects, newest first, 100 orders maximum, but not more than specified by the limit parameter.

📘

To call any private endpoint, headers should include authorization key(s).

You may use a single API key or a public-private key pair based on your current tasks. Here you may find typical Header configurations for both options.

Method name:/v4/order/private/history
Request type:GET

Data dictionary

NameTypeParameter typeRequiredRangeDescription
pairsstringQUERYNO-A trading pair as per the list from Get all traded markets endpoint.
limitintQUERYNO1-100Maximum amount of results in a response.
sortenumQUERYNOasc, descSort the resulting list newest-on-top (desc) or oldest-on-top (asc).
startstringQUERYNO-Show orders from this date. Time in ISO format. Default is 2 weeks ago.
endstringQUERYNO-Show orders up to this date. Time in ISO format. Defaults to the current time.
statusenumQUERYNOCanceled, Closed, Expired, Open, Pending, Rejected, WaitStopOrder status. By default, orders with all statuses except Open are returned. To get active orders, please use Get active client orders endpoint.

📘

You need to know:

Parameter pairs may take several arguments separated by commas, e.g. BTC_USDT,ETH_USDT,ETH_BTC. If not provided, returns all pairs.

Parameter limit defaults to 100 if not provided.

Parameter sort defaults to desc if not provided.

Exemplary request

First you will need to create a new order using Create a new order endpoint. Once done, please try these requests for a start:

Example pathDescription
/v4/order/private/history?limit=5Returns information about your last 5 orders.
/v4/order/private/history?limit=5&pairs=BTC_USDTReturns information about your last 5 orders in BTC_USDT pair.
/v4/order/private/history?sort=ascReturns information about all your orders which are sorted by "oldest-on-top".
const apiKey = "YOUR_API_KEY"; // put here your Api key

const url = "https://api.kuna.io";
const path = "/v4/order/private/history?limit=5&pairs=BTC_USDT";
const options = {
  method: "GET",
  headers: {
    accept: "application/json",
    "Content-Type": "application/json",
    "api-key": apiKey,
  },
};

fetch(url + path, options)
  .then((response) => response.json())
  .then((showResponse) => console.log(showResponse.data));
import requests

api_key = "YOUR_API_KEY"  # put here your Api key

url = "https://api.kuna.io"
path = "/v4/order/private/history?limit=5&pairs=BTC_USDT"
headers = {
    "accept": "application/json",
    "Content-Type": "application/json",
    "api-key": api_key,
}

request = requests.get(url + path, headers=headers)
print(request.json())

How to call private endpoints here

Swagger here

Response

[
  {
      "id": "4b9b9705-e85f-4180-bdec-219fbf025fa3",           // Unique identifier of an order
      "type": "Limit",                                        // Type of an order
      "quantity": "0.00054",                                  // Original order quantity
      "executedQuantity": "0.00054",                          // Traded quantity in stock (>0 if traded)
      "cumulativeQuoteQty": "14.99580",                       // Traded quantity in money (>0 if traded)
      "cost": "14.9958",                                      // Total amount
      "side": "Bid",                                          // Bid for buying base asset, Ask for selling base asset. FYI: For BTC_USDT trading pair, BTC is the base asset
      "pair": "BTC_USDT",                                     // Traded pair
      "price": "27770",                                       // Price of the trade
      "status": "Closed",                                     // The status of the order
      "createdAt": "2023-05-08T08:39:46.708Z",                // Date-time of order creation, UTC
      "updatedAt": "2023-05-08T08:53:58.332Z",                // Date-time of the last update of the order, UTC
      "closedAt": "2023-05-08T08:53:58.333Z"                  // Date-time of order finish time, UTC
    },
    {
      "id": "5992a049-8612-409d-8599-2c3d7298b106",
      "type": "Limit",
      "quantity": "5",  
      "executedQuantity": "0",  
      "cumulativeQuoteQty": "0", 
      "cost": "0.05", 
      "side": "Bid",
      "pair": "TRX_USDT",
      "price": "0.01",
      "status": "Open",
      "createdAt": "2023-07-11T07:04:20.131Z",
      "updatedAt": "2023-07-11T07:04:20.131Z"
    }
  ]