Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/bullish-exchange/api-docs/llms.txt

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

The Trades API provides authenticated access to your execution records. You can query recent trades (last 24 hours), look up a specific trade by ID, or retrieve up to 90 days of historical trade data with datetime filtering. All endpoints require a valid bearer JWT.

GET /trading-api/v1/trades

Returns a list of trades for the authenticated trading account based on specified filters. Only the last 24 hours of data is available. Supports pagination and filtering on createdAtDatetime and createdAtTimestamp.
Authentication: Required. Rate limited: Yes.

Query Parameters

tradingAccountId
string
required
ID of the trading account.
symbol
string
Filter by market symbol, e.g. BTCUSD.
orderId
string
Filter by unique order ID.
otcTradeId
string
Filter by unique Bullish OTC trade ID.
clientOtcTradeId
string
Filter by unique client OTC trade ID.
_pageSize
integer
Page size. One of: 5, 25, 50, 100. Defaults to 25.

Response Fields (array of Trade objects)

tradeId
string
Unique exchange-assigned trade ID.
orderId
string
The order ID that generated this trade.
symbol
string
Market symbol. E.g. BTCUSD.
price
string
Execution price. E.g. "50000.0000".
quantity
string
Executed quantity. E.g. "0.50000000".
quoteAmount
string
Quote quantity deducted from the asset account (price × quantity net of fees).
baseFee
string
Base asset fee charged for this trade. E.g. "0.00050000".
quoteFee
string
Quote asset fee charged for this trade. E.g. "0.0005".
side
string
Trade side: BUY or SELL.
isTaker
boolean
Whether the account was the taker on this trade.
tradeRebateAmount
string
Amount of rebate credited to the account as part of this trade.
tradeRebateAssetSymbol
string
Asset symbol in which the rebate is paid.
otcMatchId
string
Unique OTC match ID (if applicable).
otcTradeId
string
Unique Bullish OTC trade ID (if applicable).
clientOtcTradeId
string
Unique client OTC trade ID (if applicable).
createdAtDatetime
string
ISO 8601 datetime when the trade was executed by the exchange.
createdAtTimestamp
string
Millisecond EPOCH timestamp when the trade was executed.

Example Request

curl -X GET "https://api.exchange.bullish.com/trading-api/v1/trades?tradingAccountId=111000000000001&symbol=BTCUSD" \
  -H "Authorization: Bearer <JWT>"

Example Response

{
  "data": [
    {
      "tradeId": "390755652232282200",
      "orderId": "390755652232282113",
      "symbol": "BTCUSD",
      "price": "50000.0000",
      "quantity": "0.50000000",
      "quoteAmount": "25000.0000",
      "baseFee": "0.00000000",
      "quoteFee": "0.0050",
      "side": "BUY",
      "isTaker": true,
      "tradeRebateAmount": "0.0000",
      "tradeRebateAssetSymbol": "USD",
      "otcMatchId": null,
      "otcTradeId": null,
      "clientOtcTradeId": null,
      "createdAtDatetime": "2024-10-04T08:01:00.000Z",
      "createdAtTimestamp": "1728028860000"
    }
  ],
  "links": {
    "next": null,
    "previous": null
  }
}

GET /trading-api/v1/trades/

Retrieves a specific trade record by its exchange-assigned trade ID.
Authentication: Required. Rate limited: Yes.

Path Parameters

tradeId
number
required
Unique exchange-assigned trade ID.

Query Parameters

tradingAccountId
string
required
ID of the trading account that owns the trade.

Example Request

curl -X GET "https://api.exchange.bullish.com/trading-api/v1/trades/390755652232282200?tradingAccountId=111000000000001" \
  -H "Authorization: Bearer <JWT>"

Example Response

{
  "tradeId": "390755652232282200",
  "orderId": "390755652232282113",
  "symbol": "BTCUSD",
  "price": "50000.0000",
  "quantity": "0.50000000",
  "quoteAmount": "25000.0000",
  "baseFee": "0.00000000",
  "quoteFee": "0.0050",
  "side": "BUY",
  "isTaker": true,
  "tradeRebateAmount": "0.0000",
  "tradeRebateAssetSymbol": "USD",
  "otcMatchId": null,
  "otcTradeId": null,
  "clientOtcTradeId": null,
  "createdAtDatetime": "2024-10-04T08:01:00.000Z",
  "createdAtTimestamp": "1728028860000"
}

GET /trading-api/v1/history/trades

Returns a paginated list of historical trades for the authenticated trading account. Only the last 90 days of data are available. Supports pagination and filtering on createdAtDatetime and createdAtTimestamp.
Authentication: Required. Rate limited: Yes.

Query Parameters

tradingAccountId
string
required
ID of the trading account.
symbol
string
Filter by market symbol. E.g. BTCUSD.
orderId
string
Filter by order ID.
tradeId
string
Filter by specific trade ID.
otcTradeId
string
Filter by Bullish OTC trade ID.
clientOtcTradeId
string
Filter by client OTC trade ID.
createdAtDatetime[gte]
string
Start of the datetime range. ISO 8601 with millisecond, e.g. 2024-09-01T00:00:00.000Z.
createdAtDatetime[lte]
string
End of the datetime range. ISO 8601 with millisecond.
_pageSize
integer
Page size. One of: 5, 25, 50, 100. Defaults to 25.
_nextPage
string
Cursor to retrieve the next page, returned in paginated responses.
_previousPage
string
Cursor to retrieve the previous page, returned in paginated responses.

Example Request

curl -X GET "https://api.exchange.bullish.com/trading-api/v1/history/trades?tradingAccountId=111000000000001&symbol=BTCUSD&createdAtDatetime%5Bgte%5D=2024-09-01T00%3A00%3A00.000Z&createdAtDatetime%5Blte%5D=2024-09-30T23%3A59%3A59.000Z" \
  -H "Authorization: Bearer <JWT>"

Example Response

{
  "data": [
    {
      "tradeId": "380612345678901234",
      "orderId": "380612345678901100",
      "symbol": "BTCUSD",
      "price": "45000.0000",
      "quantity": "1.00000000",
      "quoteAmount": "45000.0000",
      "baseFee": "0.00000000",
      "quoteFee": "0.0090",
      "side": "SELL",
      "isTaker": false,
      "tradeRebateAmount": "0.0000",
      "tradeRebateAssetSymbol": "USD",
      "otcMatchId": null,
      "otcTradeId": null,
      "clientOtcTradeId": null,
      "createdAtDatetime": "2024-09-15T10:30:00.000Z",
      "createdAtTimestamp": "1726392600000"
    }
  ],
  "links": {
    "next": "/trading-api/v1/history/trades?tradingAccountId=111000000000001&_nextPage=abc123",
    "previous": null
  }
}

Build docs developers (and LLMs) love