---
updatedAt: 2026-08-18T12:22:52.000Z
agentTools:
  projectIndex: https://apidocs.bct.host/llms.txt
---

# Query Trade History

Get recent exchange trade history records (authentication required).

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HK Spot OpenAPI",
    "description": "Hong Kong Station Spot OpenAPI documentation v5. Uses Header + HMAC-SHA512 signature authentication mechanism.",
    "version": "5.0.0"
  },
  "servers": [
    {
      "url": "https://trade-hk.osl.com",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Spot - Trade Module",
      "description": "Trade history endpoints"
    }
  ],
  "paths": {
    "/api/v5/trades": {
      "get": {
        "tags": [
          "Spot - Trade Module"
        ],
        "summary": "Query Trade History",
        "description": "Get recent exchange trade history records (authentication required).",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "description": "Trading pair, optional; if omitted, defaults to querying data for all pairs",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "query",
            "description": "Order ID, optional",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tradeId",
            "in": "query",
            "description": "Trade ID, optional; if tradeId is provided, orderId becomes required",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "isPre",
            "in": "query",
            "description": "Forward/backward pagination query; default false represents backward pagination",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "count",
            "in": "query",
            "description": "Number of records to query; default 100, max 500, min 1",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "startTime",
            "in": "query",
            "description": "Start time (timestamp); start time must be earlier than end time",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "endTime",
            "in": "query",
            "description": "End time (timestamp); end time must be later than start time, time interval cannot exceed 7 days",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "lastIndex",
            "in": "query",
            "description": "Starting index for query; backward pagination requires max id on current page, forward pagination requires min id on current page",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Query successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SpotTradeItem"
                  }
                },
                "example": [
                  {
                    "id": "2615123",
                    "tradeId": "2267044964435636225",
                    "orderId": "2267044964435636224",
                    "orderType": "MARKET",
                    "symbol": "BTCUSD",
                    "baseAsset": "BTC",
                    "quoteAsset": "USD",
                    "side": "SELL",
                    "qty": "0.0007739",
                    "amount": "49.6077639",
                    "price": "64101",
                    "matchOrderId": "2267044817660162049",
                    "feeAsset": "USD",
                    "transactFee": "-0.024803881",
                    "feeRate": "0.0005",
                    "transactTime": "1784988819590",
                    "maker": false,
                    "bestMatch": false
                  }
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "api-key",
        "description": "API Key, obtained via the OpenAPI management page"
      }
    },
    "schemas": {
      "SpotTradeItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Primary key ID",
            "example": "2022134"
          },
          "tradeId": {
            "type": "string",
            "description": "Trade ID, identical across counter-parties",
            "example": "2126251837589253121"
          },
          "orderId": {
            "type": "string",
            "description": "Order ID",
            "example": "2184230858150785792"
          },
          "orderType": {
            "type": "string",
            "description": "Order type (LIMIT/MARKET)",
            "example": "LIMIT"
          },
          "symbol": {
            "type": "string",
            "description": "Trading pair name",
            "example": "BTCUSD"
          },
          "baseAsset": {
            "type": "string",
            "description": "Base asset",
            "example": "BTC"
          },
          "quoteAsset": {
            "type": "string",
            "description": "Quote asset",
            "example": "USD"
          },
          "side": {
            "type": "string",
            "description": "Order side",
            "example": "BUY"
          },
          "qty": {
            "type": "string",
            "description": "Executed quantity",
            "example": "1000"
          },
          "amount": {
            "type": "string",
            "description": "Executed amount",
            "example": "100.0001"
          },
          "price": {
            "type": "string",
            "description": "Executed price",
            "example": "1.002"
          },
          "matchOrderId": {
            "type": "string",
            "description": "Matching counter-order ID",
            "example": "1501008778302599"
          },
          "maker": {
            "type": "boolean",
            "description": "Whether maker",
            "example": false
          },
          "bestMatch": {
            "type": "boolean",
            "description": "Whether best match",
            "example": false
          },
          "feeAsset": {
            "type": "string",
            "description": "Fee asset currency",
            "example": "USDC"
          },
          "transactFee": {
            "type": "string",
            "description": "Transaction fee",
            "example": "0.001"
          },
          "feeRate": {
            "type": "string",
            "description": "Fee rate",
            "example": "0.001"
          },
          "transactTime": {
            "type": "string",
            "description": "Transaction time",
            "example": "1775116608852"
          }
        }
      }
    }
  },
  "x-readme": {}
}
```