Skip to main content
GET
/
api
/
marketdata
/
getcoingecko
/
historical_trades
GET /historical_trades
curl --request GET \
  --url https://internal-api.binibit.com/api/marketdata/getcoingecko/historical_trades
{
  "buy": [
    {}
  ],
  "sell": [
    {}
  ],
  "trade_id": 123,
  "price": 123,
  "base_volume": 123,
  "target_volume": 123,
  "trade_timestamp": 123,
  "type": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.binibit.com/llms.txt

Use this file to discover all available pages before exploring further.

Description

Returns recent trades for one pair, split into buy and sell arrays. Convention — type reflects the taker side:
  • buy trades are those where the ask was removed from the order book (the taker bought into a resting ask).
  • sell trades are those where the bid was removed from the order book (the taker sold into a resting bid).

Parameters

ticker_id
string
required
Pair identifier in {base}_{target} format, e.g. TRX_USDT.
type
string
Filter by trade side. One of:
  • buy — only return trades in the buy array
  • sell — only return trades in the sell array
  • omitted — return both
limit
integer
default:"200"
Maximum number of trades per side to return.
  • Allowed values: 0, 100, 200, 500
  • 0 returns the maximum available history
start_time
integer
Inclusive lower bound on trade_timestamp, Unix epoch in milliseconds.
end_time
integer
Inclusive upper bound on trade_timestamp, Unix epoch in milliseconds.

Response

buy
array
required
Array of trade objects (see schema below) where the taker bought.
sell
array
required
Array of trade objects where the taker sold.

Trade object schema

trade_id
integer
required
Unique trade identifier. Strictly increasing per pair.
price
decimal
required
Trade price in target currency.
base_volume
decimal
required
Trade size in base currency.
target_volume
decimal
required
Trade size in target currency. Equals price * base_volume.
trade_timestamp
integer
required
Trade execution time, Unix epoch in milliseconds.
type
string
required
"buy" or "sell" — matches the array the trade appears in.

Example request

curl "https://internal-api.binibit.com/api/marketdata/getcoingecko/historical_trades?ticker_id=TRX_USDT&limit=50"

Example response

{
  "buy": [
    {
      "trade_id": 290334,
      "price": 0.32332854,
      "base_volume": 49.24,
      "target_volume": 15.9206973096,
      "trade_timestamp": 1777397315466,
      "type": "buy"
    }
  ],
  "sell": [
    {
      "trade_id": 290394,
      "price": 0.32428732,
      "base_volume": 72.56,
      "target_volume": 23.5302879392,
      "trade_timestamp": 1777397655839,
      "type": "sell"
    }
  ]
}

Notes

  • Trades are sorted by trade_timestamp descending (most recent first).
  • trade_id is unique within a pair, but is not guaranteed to be globally unique across pairs.
  • For very high-frequency consumers, a WebSocket trade stream is on the roadmap for v2.

Errors

CodeCause
400 INVALID_PARAMticker_id missing, or limit/type invalid, or start_time > end_time.
404 NOT_FOUNDThe ticker_id is not a valid trading pair.