Skip to main content
GET
/
user
/
historic-orders
Historic Orders
curl --request GET \
  --url https://api.qfex.com/user/historic-orders \
  --header 'x-qfex-hmac-signature: <api-key>' \
  --header 'x-qfex-nonce: <api-key>' \
  --header 'x-qfex-public-key: <api-key>' \
  --header 'x-qfex-timestamp: <api-key>'
import requests

url = "https://api.qfex.com/user/historic-orders"

headers = {
"x-qfex-hmac-signature": "<api-key>",
"x-qfex-nonce": "<api-key>",
"x-qfex-public-key": "<api-key>",
"x-qfex-timestamp": "<api-key>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
method: 'GET',
headers: {
'x-qfex-hmac-signature': '<api-key>',
'x-qfex-nonce': '<api-key>',
'x-qfex-public-key': '<api-key>',
'x-qfex-timestamp': '<api-key>'
}
};

fetch('https://api.qfex.com/user/historic-orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.qfex.com/user/historic-orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-qfex-hmac-signature: <api-key>",
"x-qfex-nonce: <api-key>",
"x-qfex-public-key: <api-key>",
"x-qfex-timestamp: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.qfex.com/user/historic-orders"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-qfex-hmac-signature", "<api-key>")
req.Header.Add("x-qfex-nonce", "<api-key>")
req.Header.Add("x-qfex-public-key", "<api-key>")
req.Header.Add("x-qfex-timestamp", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.qfex.com/user/historic-orders")
.header("x-qfex-hmac-signature", "<api-key>")
.header("x-qfex-nonce", "<api-key>")
.header("x-qfex-public-key", "<api-key>")
.header("x-qfex-timestamp", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.qfex.com/user/historic-orders")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-qfex-hmac-signature"] = '<api-key>'
request["x-qfex-nonce"] = '<api-key>'
request["x-qfex-public-key"] = '<api-key>'
request["x-qfex-timestamp"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "count": 123,
  "data": [
    {
      "avg_price": 123,
      "client_order_id": "<string>",
      "execution_state": "<string>",
      "filled_qty": 123,
      "first_fill_ts": "2023-11-07T05:31:56Z",
      "last_fill_ts": "2023-11-07T05:31:56Z",
      "order_id": "<string>",
      "passive_qty": 123,
      "price": 123,
      "quantity": 123,
      "side": "<string>",
      "status_ts": "2023-11-07T05:31:56Z",
      "symbol": "<string>",
      "terminal_status": "<string>",
      "time_in_force": "<string>",
      "type": "<string>"
    }
  ],
  "$schema": "<string>"
}
{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}

Authorizations

x-qfex-hmac-signature
string
header
required

HMAC-SHA256 signature (hex-encoded).

x-qfex-nonce
string
header
required

Unique request nonce (hex encoded, max 100 characters).

x-qfex-public-key
string
header
required

QFEX API Authentication requires these headers:

  • x-qfex-public-key: Your public API key
  • x-qfex-hmac-signature: HMAC signature of the request (hex encoded)
  • x-qfex-nonce: Unique nonce for the request (hex encoded, max 100 characters)
  • x-qfex-timestamp: Unix timestamp of the request

These four are required. Optionally send x-qfex-requested-account-id (UUID) to act as a subaccount; see Signature Generation below.

Signature Generation:

  1. Generate a cryptographically secure random nonce (hex encoded, max 100 characters) and capture the current Unix timestamp.
  2. Build the string ${nonce}:${unix_ts} and compute an HMAC-SHA256 using your secret key.
  3. Hex-encode the HMAC result to get the signature.
  4. Send the required auth headers below. The nonce must be unique within a 15 minute window.

Important: The signature itself must be hex-encoded before being sent in the x-qfex-hmac-signature header.

Optional header: x-qfex-requested-account-id (UUID) selects a subaccount; omit it to use the primary account.

x-qfex-timestamp
string
header
required

Unix timestamp (seconds since epoch).

Query Parameters

symbol
string
client_order_id
string
start
string<date-time>
end
string<date-time>
limit
integer<int64>
default:100
Required range: 1 <= x <= 1000
offset
integer<int64>
default:0
Required range: x >= 0

Response

OK

count
integer<int64>
required
data
object[] | null
required
$schema
string<uri>
read-only

A URL to the JSON Schema for this object.

Example:

"https://api.qfex.com/schemas/HistoricOrdersResponseBody.json"