GET /v4/trades/perpetualMarket/{market}

Auth X-Hub-Key from API_HUB_KEYExecute GET /run/dydx/v4/trades/perpetualMarket/{market}Cache cached 1s, never served stale past that windowCost free · weight 0 · standard rate classSource billing free

Recent public trades for one perpetual market, newest first, with side, price, size and block height.

Parameters

nameintypedescription
marketpathstrrequiredPerpetual market ticker.
example: BTC-USD
limitqueryintoptionalMaximum number of trades to return.
example: 2
startingBeforeOrAtHeightqueryintoptionalBlock height to start retrieving trades from.
example: 99999999

Response

type: object
data key: trades
pagination: none
sample: {
  "trades": "array[2]"
}

Safe request

Reads the credential from API_HUB_KEY; it never appears in the URL.

curl -sH "X-Hub-Key: $API_HUB_KEY" "https://openapihub.dev/run/dydx/v4/trades/perpetualMarket/BTC-USD?limit=2&startingBeforeOrAtHeight=99999999"