Orders
Get trade execution history
Returns the authenticated user’s recent executed trades (fills) from about the last hour. Each trade represents a single fill event with the execution price, quantity, realized P&L, fee, and the parent order reference. realized_pnl is gross P&L (price difference only). fee is the trading cost. Net P&L = realized_pnl - fee. Use this for a live view of recent fills. For older fills or performance statistics, page through /trade/orders/history with status=filled.
GET
/
trade
/
trades
fetch
const response = await fetch('/trade/trades', {
headers: { 'Authorization': `Bearer ${token}` }
});
const { data: trades } = await response.json();
trades.forEach(t => {
console.log(`${t.side} ${t.quantity} ${t.contract} @ ${t.price}`);
});curl --request GET \
--url https://api.hyperprop.com/trade/trades \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hyperprop.com/trade/trades"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperprop.com/trade/trades",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.hyperprop.com/trade/trades"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.hyperprop.com/trade/trades")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperprop.com/trade/trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": null,
"data": [
{
"account_id": "550e8400-e29b-41d4-a716-446655440001",
"commission": 2,
"contract": "ESH6",
"fee": 3,
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"order_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"price": 6045.5,
"quantity": 2,
"realized_pnl": 0,
"side": "buy",
"timestamp": "2024-01-15T10:30:00Z",
"user_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"error": null,
"success": true
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}Authorizations
⌘I
fetch
const response = await fetch('/trade/trades', {
headers: { 'Authorization': `Bearer ${token}` }
});
const { data: trades } = await response.json();
trades.forEach(t => {
console.log(`${t.side} ${t.quantity} ${t.contract} @ ${t.price}`);
});curl --request GET \
--url https://api.hyperprop.com/trade/trades \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hyperprop.com/trade/trades"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperprop.com/trade/trades",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.hyperprop.com/trade/trades"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.hyperprop.com/trade/trades")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperprop.com/trade/trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": null,
"data": [
{
"account_id": "550e8400-e29b-41d4-a716-446655440001",
"commission": 2,
"contract": "ESH6",
"fee": 3,
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"order_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"price": 6045.5,
"quantity": 2,
"realized_pnl": 0,
"side": "buy",
"timestamp": "2024-01-15T10:30:00Z",
"user_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"error": null,
"success": true
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}