v2

OpenAPI 3.0.02026-07-311824171.4 MB
Market Data
Public

Retrieves the latest trades that have occurred for instruments in a specific currency within a specified time range. Returns trade details including price, amount, direction, timestamp, and trade ID.

Results can be filtered by instrument kind. Use the count parameter to limit the number of trades returned, and sorting to control the order (ascending or descending by trade ID).

Scope: trade:read

Try in API console

get/public/get_last_trades_by_currency_and_time

Query parameters

currency'BTC' | 'ETH' | 'USDC' | 'USDT' | 'EURR' required

Currency, i.e "BTC", "ETH", "USDC"

The currency symbol

kind'future' | 'option' | 'spot' | 'future_combo' | 'option_combo' | 'combo' | 'any'

Instrument kind: "future", "option", "spot", "future_combo", "option_combo", "combo" for any combo or "any" for all

Instrument kind, "combo" for any combo or "any" for all. If not provided instruments of all kinds are considered

start_timestampinteger required

The timestamp (milliseconds since the Unix epoch)

Example:1536569522277

The earliest timestamp to return result from (milliseconds since the UNIX epoch). When param is provided trades are returned from the earliest

end_timestampinteger required

The timestamp (milliseconds since the Unix epoch)

Example:1536569522277

The most recent timestamp to return result from (milliseconds since the UNIX epoch). Only one of params: start_timestamp, end_timestamp is truly required

countinteger

Number of requested items, default - 10, maximum - 1000

sorting'asc' | 'desc' | 'default'

Direction of results sorting (default value means no sorting, results will be returned in order in which they left the database)

Response

Success response

jsonrpc'2.0' required

The JSON-RPC version (2.0)

idinteger

The id that was sent in the request

Example response

{
  "result": {
    "trades": [
      {
        "instrument_name": "BTC-PERPETUAL",
        "timestamp": 1517329113791,
        "starbase_timestamp": 1536569522277000000,
        "block_trade_id": "154",
        "block_trade_leg_count": 3
      }
    ]
  }
}