Open & Recent Orders

GET/gateway/v1/hyperliquid/orders

Returns a wallet's live resting orders (`open` — stops, take-profits, limits, with trigger type) plus its recent terminal orders (`historical` — filled / canceled / rejected). Use `open` for "is a stop set right now?" and `historical` for the set-then-cancelled timeline. Order `side` is in trade terms (`buy`/`sell`), not position terms — a sell stop protects a long; join to `/hyperliquid/positions` by `symbol`.

Sections are truncated to `open_limit` (default 500) / `historical_limit` (default 200) — `open_total`/`historical_total` carry the pre-truncation counts. Both sections mix PERP and SPOT orders — check `market_type`: spot orders carry raw spot-pair-index symbols (`@107`) that never join to `/positions`, `/trades`, or `/fills` (perp-only surfaces); filter `market_type=perp` for a perp working-orders panel.

`historical` is one row per order at its final status, newest first: the upstream feed is a status-transition stream (an order appears as `open`, then `filled`/`canceled`), so we collapse it to the latest status per order id and drop still-`open` orders (those are in the `open` section) — a passthrough would double-count ids and mislabel status. Status values pass through Hyperliquid's raw camelCase vocabulary: `filled`, `canceled`, plus reject variants like `iocCancelRejected`, `badAloPxRejected`, `selfTradeCanceled`, `insufficientSpotBalanceRejected` — treat any status other than `filled`/`canceled` as a rejection bucket. Derived from the most-recent ~2000 status updates.

The two sections fetch independently: a failed section is named in `errors[]` and the call still returns 200 (502 only if both fail).

Query Parameters

addressstringrequired

Wallet address: a 0x EVM address or an ENS name (e.g. vitalik.eth). Solana addresses are not supported.

open_limitinteger

Max open orders returned (market makers can hold 1500+; open_total reports the pre-truncation count).

historical_limitinteger

Max terminal orders returned, newest first (the upstream feed holds ~1000 post-collapse; historical_total reports the pre-truncation count).

Open & Recent Orders
const options = {method: 'GET'};

fetch('https://api.asksurf.ai/gateway/v1/hyperliquid/orders', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
OK
{
  "$schema": "https://example.com/schemas/DataObjectResponseHyperliquidOrders.json",
  "data": {
    "address": "<string>",
    "as_of": 123,
    "errors": [
      {
        "reason": "<string>",
        "section": "<string>"
      }
    ],
    "historical": [
      {
        "is_position_tpsl": true,
        "is_trigger": true,
        "limit_price": 123,
        "market_type": "<string>",
        "order_id": 123,
        "order_type": "<string>",
        "original_size": 123,
        "placed_time": 123,
        "reduce_only": true,
        "side": "<string>",
        "size": 123,
        "status": "<string>",
        "status_time": 123,
        "symbol": "<string>",
        "trigger_condition": "<string>",
        "trigger_price": 123
      }
    ],
    "historical_total": 123,
    "open": [
      {
        "is_position_tpsl": true,
        "is_trigger": true,
        "limit_price": 123,
        "market_type": "<string>",
        "order_id": 123,
        "order_type": "<string>",
        "original_size": 123,
        "reduce_only": true,
        "side": "<string>",
        "size": 123,
        "symbol": "<string>",
        "timestamp": 123,
        "trigger_condition": "<string>",
        "trigger_price": 123
      }
    ],
    "open_total": 123
  },
  "meta": {
    "cached": true,
    "credits_used": 123,
    "empty_reason": "<string>"
  }
}