Market Data API

BBX OpenAPI provides a broad dataset ranging from futures/derivatives data to market indices and Kline charts, offering key indicators such as market depth, activity, and price trends to help users capture opportunities in complex markets. In addition, we provide exclusive crypto-related stock data covering U.S. and Hong Kong equities to support a complete crypto investment data ecosystem.


GET/api/upgrade/v2/crypto_stock/quotes

Get Crypto-Related Stock Quotes (Crypto Stock Data)

Get real-time quote data for crypto-related stocks. Supports querying multiple tickers at once.

Request Parameters

  • Name
    tickers
    Type
    string
    Description

    Comma-separated list of tickers. Format: i:symbol:market (e.g. i:mstr:nasdaq,i:bull:nasdaq)

  • Name
    AccessKeyId
    Type
    string
    Description

    Access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    code
    Type
    string
    Description

    Status code

  • Name
    msg
    Type
    string
    Description

    Response message

  • Name
    data
    Type
    array
    Description

    Stock quote list

    • Name
      ticker
      Type
      string
      Description

      Ticker

    • Name
      company_name
      Type
      string
      Description

      Company name

    • Name
      last_price
      Type
      number
      Description

      Last price

    • Name
      open
      Type
      number
      Description

      Open price

    • Name
      close
      Type
      number
      Description

      Close price

    • Name
      high
      Type
      number
      Description

      High price

    • Name
      low
      Type
      number
      Description

      Low price

    • Name
      volume
      Type
      number
      Description

      Volume

    • Name
      market_cap
      Type
      number
      Description

      Market cap

    • Name
      timestamp
      Type
      integer
      Description

      Data timestamp

Request

GET
/api/upgrade/v2/crypto_stock/quotes
# Fetch default quotes (MSTR + BULL)
curl -G https://open.bbx.com/api/upgrade/v2/crypto_stock/quotes \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

# Fetch quotes for specific tickers
curl -G https://open.bbx.com/api/upgrade/v2/crypto_stock/quotes \
  -d "tickers=i:mstr:nasdaq,i:coin:nasdaq" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "code": "0",
  "msg": "success",
  "data": [
    {
      "ticker": "MSTR",
      "company_name": "MicroStrategy Incorporated",
      "last_price": 425.67,
      "open": 420.00,
      "close": 418.55,
      "high": 428.90,
      "low": 415.20,
      "volume": 2847392.0,
      "market_cap": 83475000000,
      "open_today": 420.00,
      "start_ts": 1700000000,
      "end_ts": 1700086400,
      "timestamp": 1700043267
    }
  ]
}

GET/api/upgrade/v2/crypto_stock/company/{symbol}

Get Company Details (Crypto Stock Data)

Get detailed information about a specific crypto-related company, including fundamentals and description.

Path Parameters

  • Name
    symbol
    Type
    string
    Description

    Company ticker. Format: i:symbol:market (e.g. i:mstr:nasdaq)

Request Parameters

  • Name
    AccessKeyId
    Type
    string
    Description

    Access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    code
    Type
    string
    Description

    Status code

  • Name
    msg
    Type
    string
    Description

    Response message

  • Name
    data
    Type
    object
    Description

    Company details

    • Name
      company_name
      Type
      string
      Description

      Full company name

    • Name
      ticker
      Type
      string
      Description

      Ticker

    • Name
      market
      Type
      string
      Description

      Exchange

    • Name
      country_region
      Type
      string
      Description

      Country/region

    • Name
      fdv
      Type
      number
      Description

      Fully diluted valuation (FDV)

    • Name
      market_cap
      Type
      number
      Description

      Market cap

    • Name
      annual_high
      Type
      number
      Description

      52-week high

    • Name
      annual_low
      Type
      number
      Description

      52-week low

    • Name
      description
      Type
      string
      Description

      Company description

    • Name
      announcement
      Type
      string
      Description

      Announcement

Request

GET
/api/upgrade/v2/crypto_stock/company/{symbol}
# Fetch MicroStrategy company info
curl -G https://open.bbx.com/api/upgrade/v2/crypto_stock/company/i:mstr:nasdaq \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "code": "0",
  "msg": "success",
  "data": {
    "company_name": "MicroStrategy Incorporated",
    "ticker": "MSTR",
    "market": "NASDAQ",
    "country_region": "US",
    "fdv": 85000000000,
    "market_cap": 83475000000,
    "annual_high": 540.00,
    "annual_low": 118.50,
    "description": "MicroStrategy Incorporated是一家商业智能公司,也是全球最大的比特币持有企业之一。",
    "announcement": "公司继续增持比特币作为主要储备资产策略。"
  }
}

GET/POST/api/upgrade/v2/crypto_stock/top-gainer

Get Crypto Stock Top Gainers

Get a ranked list of top gainers among crypto-related stocks. Supports both U.S. and Hong Kong markets with smart filtering.

Key Features

  • Smart filtering: Automatically filters out index-like data to ensure the results are real stocks
  • Multi-market support: Supports both U.S. (NASDAQ/NYSE) and Hong Kong (HKEX)
  • Real-time ranking: Sorts by price change in real time to surface market hotspots

Request Parameters

  • Name
    us_stock
    Type
    boolean
    Description

    Whether to query the U.S. top gainers list (default: false)

  • Name
    hk_stock
    Type
    boolean
    Description

    Whether to query the Hong Kong top gainers list (default: false)

  • Name
    limit
    Type
    integer
    Description

    Max number of items to return (default: 50)

  • Name
    AccessKeyId
    Type
    string
    Description

    Access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    code
    Type
    string
    Description

    Status code

  • Name
    msg
    Type
    string
    Description

    Response message

  • Name
    data
    Type
    array
    Description

    Gainers list

    • Name
      symbol
      Type
      string
      Description

      Ticker symbol (simplified)

    • Name
      name
      Type
      string
      Description

      Company name

    • Name
      price
      Type
      number
      Description

      Current price

    • Name
      change
      Type
      number
      Description

      Price change amount

    • Name
      change_rate
      Type
      number
      Description

      Price change percentage

    • Name
      volume
      Type
      integer
      Description

      Volume

    • Name
      market_cap
      Type
      integer
      Description

      Market cap

    • Name
      market
      Type
      string
      Description

      Market (US/HK)

    • Name
      currency
      Type
      string
      Description

      Currency (USD/HKD)

    • Name
      update_time
      Type
      integer
      Description

      Update timestamp

Request

GET
/api/upgrade/v2/crypto_stock/top-gainer
# Top 10 gainers (U.S. stocks)
curl -G https://open.bbx.com/api/upgrade/v2/crypto_stock/top-gainer \
  -d "us_stock=true" \
  -d "limit=10" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

# Combined gainers (U.S. + Hong Kong)
curl -G https://open.bbx.com/api/upgrade/v2/crypto_stock/top-gainer \
  -d "us_stock=true" \
  -d "hk_stock=true" \
  -d "limit=30" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "code": "0",
  "msg": "success",
  "data": [
    {
      "symbol": "MSTR",
      "name": "MicroStrategy Incorporated",
      "price": 425.67,
      "change": 12.45,
      "change_rate": 3.01,
      "volume": 0,
      "market_cap": 0,
      "market": "US",
      "currency": "USD",
      "update_time": 1700043267
    },
    {
      "symbol": "COIN",
      "name": "Coinbase Global Inc",
      "price": 156.78,
      "change": 8.90,
      "change_rate": 6.02,
      "volume": 0,
      "market_cap": 0,
      "market": "US",
      "currency": "USD",
      "update_time": 1700043267
    }
  ]
}

GET/v2/futures/interest

Get Futures Open Interest Data

This endpoint returns futures open interest data.

Request Parameters

  • Name
    lan
    Type
    integer
    Description

    Language

  • Name
    page
    Type
    integer
    Description

    Page number

  • Name
    pageSize
    Type
    integer
    Description

    Page size (max: 20)

  • Name
    currency
    Type
    string
    Description

    Quote currency: cny or usd

  • Name
    AccessKeyId
    Type
    string
    Description

    Access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    success
    Type
    boolean
    Description

    Request success status

  • Name
    errorCode
    Type
    integer
    Description

    Status code

  • Name
    error
    Type
    string
    Description

    Error message

  • Name
    data
    Type
    object
    Description

    Response payload

    • Name
      list
      Type
      array
      Description

      Data list

      • Name
        key
        Type
        string
        Description

        Trading pair key

      • Name
        show
        Type
        string
        Description

        Trading pair display symbol

      • Name
        currency
        Type
        string
        Description

        Quote currency

      • Name
        market_name
        Type
        string
        Description

        Exchange name

      • Name
        trade
        Type
        string
        Description

        Turnover

      • Name
        vol_coin
        Type
        string
        Description

        Open interest (coin amount)

      • Name
        trend
        Type
        array
        Description

        Trend series

        • Name
          time
          Type
          string
          Description

          Timestamp (seconds)

        • Name
          close
          Type
          string
          Description

          Close open interest

Request

GET
/v2/futures/interest
curl -G https://open.bbx.com/api/upgrade/v2/futures/interest \
  -d "lan=cn" \
  -d "page=1" \
  -d "pageSize=20" \
  -d "currency=usd" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "success": true,
  "errorCode": 200,
  "error": "",
  "data": {
    "list": [
      {
        "key": "xbt:bitmex",
        "show": "BTC",
        "currency": "USD",
        "market_name": "BitMEX永续",
        "trade": "3485934999.08",
        "vol_coin": "97257.32371667",
        "trend": [
          {
            "time": "1554832800",
            "close": "470170798"
          }
        ]
      }
    ]
  }
}

GET/v2/index/indexPrice

Get Index Price

This endpoint returns index price data.

Request Parameters

  • Name
    key
    Type
    string
    Description

    Index key (obtain via /api/upgrade/v2/index/getIndex)

  • Name
    currency
    Type
    string
    Description

    Quote currency (e.g. cny, usd)

  • Name
    AccessKeyId
    Type
    string
    Description

    Access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    success
    Type
    boolean
    Description

    Request success status

  • Name
    errorCode
    Type
    integer
    Description

    Status code

  • Name
    error
    Type
    string
    Description

    Error message

  • Name
    data
    Type
    object
    Description

    Response payload

    • Name
      price
      Type
      string
      Description

      Latest price

    • Name
      open
      Type
      string
      Description

      Today's open price

    • Name
      high
      Type
      string
      Description

      24h high

    • Name
      low
      Type
      string
      Description

      24h low

    • Name
      close
      Type
      string
      Description

      Previous close

    • Name
      degree24H
      Type
      string
      Description

      24h change percentage

    • Name
      change24H
      Type
      string
      Description

      24h change

    • Name
      up
      Type
      string
      Description

      Up

    • Name
      down
      Type
      string
      Description

      Down

Request

GET
/v2/index/indexPrice
curl -G https://open.bbx.com/api/upgrade/v2/index/indexPrice \
  -d "key=i:diniw:ice" \
  -d "currency=usd" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "success": true,
  "errorCode": 200,
  "error": "",
  "data": {
    "price": "933.2206291652",
    "open": "966.1194468979",
    "high": "968.23409269",
    "low": "890.6764162168",
    "close": "906.5192845811",
    "degree24H": "2.88",
    "change24H": "26.13",
    "up": "0",
    "down": "0"
  }
}

GET/v2/index/indexInfo

Get Index Details

This endpoint returns detailed information for an index.

Request Parameters

  • Name
    key
    Type
    string
    Description

    Index key (obtain via /api/upgrade/v2/index/getIndex)

  • Name
    lan
    Type
    string
    Description

    Language: en, cn

  • Name
    AccessKeyId
    Type
    string
    Description

    Access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    success
    Type
    boolean
    Description

    Request success status

  • Name
    errorCode
    Type
    integer
    Description

    Status code

  • Name
    error
    Type
    string
    Description

    Error message

  • Name
    data
    Type
    object
    Description

    Response payload

    • Name
      show
      Type
      string
      Description

      Index symbol

    • Name
      name
      Type
      string
      Description

      Index name

    • Name
      link
      Type
      string
      Description

      Official website

    • Name
      release_date
      Type
      string
      Description

      Release date

    • Name
      amount
      Type
      string
      Description

      Number of constituent coins

    • Name
      introduce
      Type
      string
      Description

      Index description

    • Name
      file_name
      Type
      string
      Description

      Methodology file name

    • Name
      file_link
      Type
      string
      Description

      Methodology file link

Request

GET
/v2/index/indexInfo
curl -G https://open.bbx.com/api/upgrade/v2/index/indexInfo \
  -d "key=i:diniw:ice" \
  -d "lan=cn"

Response

{
  "success": true,
  "errorCode": 200,
  "error": "",
  "data": {
    "show": "DXY",
    "name": "美元指数",
    "link": "https://finance.sina.com.cn/money/forex/hq/DINIW.shtml",
    "release_date": "",
    "amount": "0",
    "introduce": "",
    "file_name": "",
    "file_link": ""
  }
}

GET/v2/index/getIndex

Get Index List

This endpoint returns the list of indices.

Request Parameters

  • Name
    AccessKeyId
    Type
    string
    Description

    Access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    success
    Type
    boolean
    Description

    Request success status

  • Name
    errorCode
    Type
    integer
    Description

    Status code

  • Name
    error
    Type
    string
    Description

    Error message

  • Name
    data
    Type
    object
    Description

    Response payload

    • Name
      list
      Type
      array
      Description

      Index list

      • Name
        key
        Type
        string
        Description

        Index key

      • Name
        cn_name
        Type
        string
        Description

        Index name (Chinese)

      • Name
        en_name
        Type
        string
        Description

        Index name (English)

      • Name
        show
        Type
        string
        Description

        Index symbol

      • Name
        describe
        Type
        string
        Description

        Index description

      • Name
        degree24h
        Type
        string
        Description

        24h change percentage

      • Name
        price
        Type
        string
        Description

        Latest price

      • Name
        en_type
        Type
        string
        Description

        Type (English)

      • Name
        cn_type
        Type
        string
        Description

        Type (Chinese)

    • Name
      count
      Type
      string
      Description

      Index count

Request

GET
/v2/index/getIndex
curl -G https://open.bbx.com/api/upgrade/v2/index/getIndex \
  -H "AccessKeyId: YOUR_ACCESS_KEY" \
  -H "SignatureNonce: RANDOM_NONCE" \
  -H "Timestamp: TIMESTAMP" \
  -H "Signature: YOUR_SIGNATURE"

Response

{
  "success": true,
  "errorCode": 200,
  "error": "",
  "data": {
    "list": [
      {
        "key": "i:fgi:alternative",
        "cn_name": "恐惧&贪婪指数",
        "en_name": "Crypto Fear & Greed Index",
        "show": "FGI",
        "describe": "描述",
        "degree24h": "-6.00",
        "price": "47",
        "cn_type": "",
        "en_type": ""
      }
    ],
    "count": "156"
  }
}

GET/v2/indicatorKline/getTradingPair

Indicator Kline Trading Pairs

This endpoint returns trading pairs available for indicator Kline data.

Request Parameters

  • Name
    coinType
    Type
    string
    Description

    Coin type, for example: bitcoin

  • Name
    indicator_key
    Type
    string
    Description

    Indicator key:

    • fundflow: fund flow. Fields: timestmap (timestamp), value (fund flow value)
    • ttsi: top trader sentiment indicator. Fields: time (timestamp), buyAccount (long account ratio), sellAccount (short account ratio)
    • ttmu: top trader long/short average position ratio. Fields: time (timestamp), buyInterest (avg long position ratio), sellInterest (avg short position ratio)
    • position: open interest. Fields: time (timestamp), open (open), high (high), low (low), close (close)
    • lsur: long/short account ratio. Fields: time (timestamp), sellAccount (sell count), buyAccount (buy count), ratios (long/short ratio)
    • tvolume: trading volume. Fields: time (timestamp), openInterest (total contracts), volume (volume)
    • ftbs: futures taker buy/sell. Fields: time (timestamp), buyVolume (taker buy volume), sellVolume (taker sell volume)
    • basis: futures basis. Fields: time (timestamp), basis (basis value), basisRate
    • mlr: margin long/short ratio. Fields: time (timestamp), ratios (leverage ratio value)
    • bsv: spot taker buy/sell. Fields: time (timestamp), buyVolume (taker buy volume), sellVolume (taker sell volume)
    • fr: funding rate. Fields: fundingTime (funding time), time (data timestamp), fundingRate (funding rate)
    • aibst: buy/sell trade count. Fields: timestamp (timestamp), buyAccount (buy count), sellAccount (sell count)
    • aili: liquidation stats. Fields: timestamp (timestamp), buySize (close short size), sellSize (close long size)
    • aiaggtrade: aggregated large trades. Fields: timestamp (timestamp), key (pair key), coin_type (coin key), trade_type (side), etc.
  • Name
    AccessKeyId
    Type
    string
    Description

    Access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    success
    Type
    boolean
    Description

    Request success status

  • Name
    errorCode
    Type
    integer
    Description

    Status code

  • Name
    error
    Type
    string
    Description

    Error message

  • Name
    data
    Type
    object
    Description

    Response payload

    • Name
      list
      Type
      array
      Description

      Trading pair list

Request

GET
/v2/indicatorKline/getTradingPair
curl -G https://open.bbx.com/api/upgrade/v2/indicatorKline/getTradingPair \
  -d "coinType=bitcoin" \
  -d "indicator_key=aiaggtrade" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "success": true,
  "errorCode": 200,
  "error": "",
  "data": {
    "list": [
      [
        "btcusdt:okex",
        "btcusdt:okex"
      ]
    ]
  }
}

GET/v2/indicatorKline/dataRecords

Indicator Kline Data

This endpoint returns indicator Kline data. You can fetch up to 500 Klines per request.

Request Parameters

  • Name
    symbol
    Type
    string
    Description

    Trading pair, for example: btcusdt:okex

  • Name
    indicator_key
    Type
    string
    Description

    Indicator key, for example: fundflow

  • Name
    size
    Type
    integer
    Description

    Number of records (range: 1-500)

  • Name
    open_time
    Type
    integer
    Description

    Open time: 0 for 00:00 Beijing time, 8 for 08:00 Beijing time (default: 0)

  • Name
    period
    Type
    integer
    Description

    Interval in seconds (e.g. 900 for 15m, 14400 for 4h)

  • Name
    since
    Type
    integer
    Description

    Start time (default: current time)

  • Name
    AccessKeyId
    Type
    string
    Description

    Access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    success
    Type
    boolean
    Description

    Request success status

  • Name
    errorCode
    Type
    integer
    Description

    Status code

  • Name
    error
    Type
    string
    Description

    Error message

  • Name
    data
    Type
    object
    Description

    Response payload

    • Name
      kline_data
      Type
      object
      Description

      Kline data

      • Name
        mapping
        Type
        array
        Description

        Field mapping for the Kline records

      • Name
        list
        Type
        array
        Description

        Kline records

      • Name
        request_state
        Type
        integer
        Description

        Request state

Request

GET
/v2/indicatorKline/dataRecords
curl -G https://open.bbx.com/api/upgrade/v2/indicatorKline/dataRecords \
  -d "symbol=btcusdt:okex" \
  -d "indicator_key=aiaggtrade" \
  -d "period=900" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "success": true,
  "errorCode": 200,
  "error": "",
  "data": {
    "kline_data": {
      "mapping": [
        "timestamp",
        "buyTurnover",
        "sellTurnover"
      ],
      "list": [
        [
          "1692688800",
          "102115751.81482554",
          "56985363.47174822"
        ]
      ],
      "request_state": 0
    }
  }
}

GET/v2/commonKline/dataRecords

Get Kline Data

This endpoint returns Kline data. You can fetch up to 500 Klines per request.

Request Parameters

  • Name
    symbol
    Type
    string
    Description

    Trading pair, for example: btcusdt:okex. Index example: i:ixic:nasdaq

  • Name
    size
    Type
    integer
    Description

    Number of records (range: 1-500)

  • Name
    open_time
    Type
    integer
    Description

    Open time: 0 for 00:00 Beijing time, 8 for 08:00 Beijing time (default: 0)

  • Name
    period
    Type
    integer
    Description

    Interval in seconds (e.g. 900 for 15m, 14400 for 4h). Use a period supported by BBX to avoid empty results.

  • Name
    since
    Type
    integer
    Description

    Start time (default: current time)

  • Name
    AccessKeyId
    Type
    string
    Description

    Access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    success
    Type
    boolean
    Description

    Request success status

  • Name
    errorCode
    Type
    integer
    Description

    Status code

  • Name
    error
    Type
    string
    Description

    Error message

  • Name
    data
    Type
    object
    Description

    Response payload

    • Name
      kline_data
      Type
      array
      Description

      Kline records. Each item is: [time (seconds), open, high, low, close, volume]

Request

GET
/v2/commonKline/dataRecords
curl -G https://open.bbx.com/api/upgrade/v2/commonKline/dataRecords \
  -d "symbol=btcusdt:okex" \
  -d "period=900" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "success": true,
  "errorCode": 200,
  "error": "",
  "data": {
    "kline_data": [
      [
        1539172800,
        6501.95,
        6515.58,
        6489.88,
        6490.2,
        721688
      ],
      [
        1539187200,
        6490.21,
        6549.8,
        6485,
        6532.19,
        704650
      ]
    ]
  }
}

GET/v2/market/hotTabCoins

Get Hot Tag Coin List

This endpoint returns the list of coins under a popular tag.

Request Parameters

  • Name
    key
    Type
    string
    Description

    Tag type. Allowed values:

    • gamefi (GameFi)
    • anonymous (Anonymous coins)
    • market (Exchange tokens)
    • web (Web3.0)
    • newcoin (New coins)
    • stable (Stablecoins)
    • defi (DeFi)
  • Name
    currency
    Type
    string
    Description

    Quote currency. Allowed values: cny or usd

  • Name
    AccessKeyId
    Type
    string
    Description

    Access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    success
    Type
    boolean
    Description

    Request success status

  • Name
    errorCode
    Type
    integer
    Description

    Status code

  • Name
    error
    Type
    string
    Description

    Error message

  • Name
    data
    Type
    object
    Description

    Response payload

    • Name
      list
      Type
      array
      Description

      Coin list

      • Name
        key
        Type
        string
        Description

        Coin key

      • Name
        logo
        Type
        string
        Description

        Coin logo URL

      • Name
        show
        Type
        string
        Description

        Ticker symbol

      • Name
        cn_name
        Type
        string
        Description

        Coin name (Chinese)

      • Name
        en_name
        Type
        string
        Description

        Coin name (English)

      • Name
        price
        Type
        string
        Description

        Price

      • Name
        vol24H
        Type
        string
        Description

        24h volume

      • Name
        trade24H
        Type
        string
        Description

        24h turnover

      • Name
        degree24H
        Type
        string
        Description

        24h change percentage

Request

GET
/v2/market/hotTabCoins
curl -G https://open.bbx.com/api/upgrade/v2/market/hotTabCoins \
  -d "key=newcoin" \
  -d "currency=cny" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "success": true,
  "errorCode": 200,
  "error": "",
  "data": {
    "list": [
      {
        "key": "CAITOKEN",
        "logo": "https://static.bbxstorge.com/coin/20180530/152767311568822.png?x-oss-process=image/resize,m_lfit,h_45,w_45,image/circle,r_21/format,png",
        "show": "CAI",
        "cn_name": "",
        "en_name": "CAI TOKEN",
        "price": "0.0278",
        "vol24H": "10500000000",
        "trade24H": "21457158.638175",
        "degree24H": "0.72"
      }
    ]
  }
}

GET/v2/market/ticker

Get Market Ticker Data

This endpoint returns market ticker data for exchanges, including net fund inflow.

Request Parameters

  • Name
    market_list
    Type
    string
    Description

    Comma-separated exchange list. Up to 100 markets

  • Name
    AccessKeyId
    Type
    string
    Description

    Access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    success
    Type
    boolean
    Description

    Request success status

  • Name
    errorCode
    Type
    integer
    Description

    Status code

  • Name
    error
    Type
    string
    Description

    Error message

  • Name
    data
    Type
    array
    Description

    Response data

    • Name
      market_key
      Type
      string
      Description

      Market key

    • Name
      fundNetInCny
      Type
      string
      Description

      Net inflow (CNY). Empty string means no data

    • Name
      fundNetInUsd
      Type
      string
      Description

      Net inflow (USD). Empty string means no data

Request

GET
/v2/market/ticker
curl -G https://open.bbx.com/api/upgrade/v2/market/ticker \
  -d "market_list=okex,binance" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "success": true,
  "errorCode": 200,
  "error": "",
  "data": [
    {
      "market_key": "okex",
      "fundNetInCny": "1000",
      "fundNetInUsd": "1000"
    }
  ]
}

GET/v2/market

Get All Markets

This endpoint returns basic information for all exchanges/markets.

Request Parameters

  • Name
    AccessKeyId
    Type
    string
    Description

    Access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    success
    Type
    boolean
    Description

    Request success status

  • Name
    errorCode
    Type
    integer
    Description

    Status code

  • Name
    error
    Type
    string
    Description

    Error message

  • Name
    data
    Type
    array
    Description

    Response data

    • Name
      key
      Type
      string
      Description

      Market key

    • Name
      en_name
      Type
      string
      Description

      Market name (English)

    • Name
      cn_name
      Type
      string
      Description

      Market name (Chinese)

Request

GET
/v2/market
curl -G https://open.bbx.com/api/upgrade/v2/market \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "success": true,
  "errorCode": 200,
  "error": "",
  "data": [
    {
      "key": "okex",
      "en_name": "OKEx",
      "cn_name": "欧易OKX"
    }
  ]
}

Was this page helpful?

POST/api/upgrade/v2/coin-treasuries/entities

Get Coin Treasury Entity Data

Retrieve treasury entity data for a specific coin. Supports pagination and multiple filters.

Required Permission

coin_treasury_COIN_TREASURY_ENTITIES

Request Parameters

  • Name
    coin
    Type
    string
    Description

    Filter by coin (e.g. BTC, ETH)

  • Name
    entity_type
    Type
    string
    Description

    Filter by entity type

  • Name
    name
    Type
    string
    Description

    Fuzzy search by entity name

  • Name
    ticker
    Type
    string
    Description

    Filter by stock ticker

  • Name
    start_date
    Type
    string
    Description

    Start time in ISO 8601 format

  • Name
    end_date
    Type
    string
    Description

    End time in ISO 8601 format

  • Name
    page
    Type
    integer
    Description

    Page number (starts from 1). Default: 1

  • Name
    page_size
    Type
    integer
    Description

    Page size. Default: 20. Max: 100

  • Name
    sort_order
    Type
    string
    Description

    Sort direction: asc/desc. Default: desc

  • Name
    AccessKeyId
    Type
    string
    Description

    User access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    code
    Type
    string
    Description

    Status code

  • Name
    msg
    Type
    string
    Description

    Response message

  • Name
    data
    Type
    object
    Description

    Response payload

    • Name
      list
      Type
      array
      Description

      Coin treasury entity list

      • Name
        id
        Type
        string
        Description

        Unique entity record identifier

      • Name
        coin
        Type
        string
        Description

        Coin code (e.g. BTC, ETH)

      • Name
        name
        Type
        string
        Description

        Entity name

      • Name
        ticker
        Type
        string
        Description

        Stock ticker (if applicable)

      • Name
        entity_type
        Type
        string
        Description

        Entity type (e.g. public-companies, eth-treasuries)

      • Name
        hold_amount
        Type
        number
        Description

        Holding amount

      • Name
        days30
        Type
        number
        Description

        30-day change

      • Name
        last
        Type
        number
        Description

        Most recent change

      • Name
        share
        Type
        number
        Description

        Market share ratio

      • Name
        in_usd
        Type
        number
        Description

        Value in USD

      • Name
        market_cap
        Type
        number
        Description

        Market cap (USD)

      • Name
        enterprise_value
        Type
        number
        Description

        Enterprise value (USD, can be null)

      • Name
        btc_share
        Type
        number
        Description

        BTC market share (can be null)

      • Name
        cost_basis
        Type
        number
        Description

        Cost basis (can be null)

      • Name
        ngu
        Type
        number
        Description

        NGU metric (can be null)

      • Name
        mnav
        Type
        number
        Description

        MNAV metric

      • Name
        mcap
        Type
        number
        Description

        Market cap multiple

Request

POST
/api/upgrade/v2/coin-treasuries/entities
curl -X POST https://open.bbx.com/api/upgrade/v2/coin-treasuries/entities \
  -H "Content-Type: application/json" \
  -d '{
    "coin": "BTC",
    "entity_type": "Company",
    "name": "Tesla",
    "ticker": "TSLA",
    "start_date": "2025-01-01T00:00:00Z",
    "end_date": "2025-01-31T23:59:59Z",
    "page": 1,
    "page_size": 20,
    "sort_order": "desc",
    "AccessKeyId": "YOUR_ACCESS_KEY_ID",
    "SignatureNonce": "RANDOM_NONCE",
    "Timestamp": "CURRENT_TIMESTAMP",
    "Signature": "YOUR_SIGNATURE"
  }'

Response

{
  "code": "0",
  "msg": "success",
  "data": {
    "list": [
      {
        "id": "6899db84277d4951ab27938b",
        "coin": "BTC",
        "name": "Bitcoin Group SE",
        "ticker": "ADE.DE",
        "entity_type": "public-companies",
        "hold_amount": 3605,
        "days30": 0,
        "last": 0,
        "share": 0.00017,
        "in_usd": 435000000,
        "market_cap": 254000000,
        "enterprise_value": 231000000,
        "btc_share": 0.00070882,
        "cost_basis": null,
        "ngu": null,
        "mnav": 0.585,
        "mcap": 1.709
      }
    ]
  }
}

POST/api/upgrade/v2/coin-treasuries/history

Get Coin Treasury History

Retrieve coin treasury historical change data to track buy and sell activities.

Required Permission

coin_treasury_COIN_TREASURY_HISTORY

Request Parameters

  • Name
    coin
    Type
    string
    Description

    Filter by coin

  • Name
    name
    Type
    string
    Description

    Entity name

  • Name
    type
    Type
    string
    Description

    Filter by type: Buy/Sell

  • Name
    start_date
    Type
    string
    Description

    Start time

  • Name
    end_date
    Type
    string
    Description

    End time

  • Name
    page
    Type
    integer
    Description

    Page number. Default: 1

  • Name
    page_size
    Type
    integer
    Description

    Page size. Default: 20

  • Name
    sort_by
    Type
    string
    Description

    Sort field. Default: date

  • Name
    sort_order
    Type
    string
    Description

    Sort direction. Default: desc

  • Name
    AccessKeyId
    Type
    string
    Description

    User access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    code
    Type
    string
    Description

    Status code

  • Name
    msg
    Type
    string
    Description

    Response message

  • Name
    data
    Type
    object
    Description

    Response payload

    • Name
      list
      Type
      array
      Description

      Coin treasury history list

      • Name
        id
        Type
        string
        Description

        Unique history record identifier

      • Name
        coin
        Type
        string
        Description

        Coin code

      • Name
        name
        Type
        string
        Description

        Entity name

      • Name
        date
        Type
        number
        Description

        Trade date timestamp

      • Name
        type
        Type
        string
        Description

        Trade type (Buy/Sell)

      • Name
        balance
        Type
        number
        Description

        Balance after the trade

      • Name
        change
        Type
        number
        Description

        Change amount

      • Name
        total_cost_usd
        Type
        number
        Description

        Total cost (USD, can be null)

      • Name
        price
        Type
        number
        Description

        Trade price

      • Name
        stock_price
        Type
        number
        Description

        Stock price (can be null)

Request

POST
/api/upgrade/v2/coin-treasuries/history
curl -X POST https://open.bbx.com/api/upgrade/v2/coin-treasuries/history \
  -H "Content-Type: application/json" \
  -d '{
    "coin": "BTC",
    "name": "MicroStrategy",
    "type": "Buy",
    "start_date": "2025-01-01T00:00:00Z",
    "end_date": "2025-01-31T23:59:59Z",
    "page": 1,
    "page_size": 20,
    "sort_by": "date",
    "sort_order": "desc",
    "AccessKeyId": "YOUR_ACCESS_KEY_ID",
    "SignatureNonce": "RANDOM_NONCE",
    "Timestamp": "CURRENT_TIMESTAMP",
    "Signature": "YOUR_SIGNATURE"
  }'

Response

{
  "code": "0",
  "msg": "success",
  "data": {
    "list": [
      {
        "id": "6899de38277d4951ab279611",
        "coin": "BTC",
        "name": "Sequans Communications S.A.",
        "date": 1754870400,
        "type": "Buy",
        "balance": 3170,
        "change": 13,
        "total_cost_usd": null,
        "price": 116484,
        "stock_price": 1.28
      }
    ]
  }
}

POST/api/upgrade/v2/coin-treasuries/history/accumulated

Get Accumulated Coin Treasury History

Retrieve accumulated coin treasury holdings history, showing accumulated changes over time.

Required Permission

coin_treasury_COIN_TREASURY_HISTORY_ACCUMULATED

Request Parameters

  • Name
    coin
    Type
    string
    Description

    Coin (required)

  • Name
    entity_type
    Type
    string
    Description

    Filter by entity type

  • Name
    start_date
    Type
    string
    Description

    Start time

  • Name
    end_date
    Type
    string
    Description

    End time

  • Name
    interval
    Type
    string
    Description

    Time interval: daily/weekly/monthly

  • Name
    AccessKeyId
    Type
    string
    Description

    User access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    code
    Type
    string
    Description

    Status code

  • Name
    msg
    Type
    string
    Description

    Response message

  • Name
    data
    Type
    object
    Description

    Response payload

    • Name
      coin
      Type
      string
      Description

      Coin code

    • Name
      total_entities
      Type
      number
      Description

      Total number of entities

    • Name
      latest_value_usd
      Type
      number
      Description

      Latest value in USD

    • Name
      latest_hold_amount
      Type
      number
      Description

      Latest holding amount

    • Name
      accumulated_data
      Type
      array
      Description

      Accumulated data list

      • Name
        date
        Type
        string
        Description

        Date

      • Name
        timestamp
        Type
        number
        Description

        Timestamp

      • Name
        accumulated_amount
        Type
        number
        Description

        Accumulated amount

      • Name
        activities
        Type
        array
        Description

        Activity records

        • Name
          name
          Type
          string
          Description

          Entity name

        • Name
          change
          Type
          number
          Description

          Change amount

        • Name
          type
          Type
          string
          Description

          Action type (Buy/Sell)

Request

POST
/api/upgrade/v2/coin-treasuries/history/accumulated
curl -X POST https://open.bbx.com/api/upgrade/v2/coin-treasuries/history/accumulated \
  -H "Content-Type: application/json" \
  -d '{
    "coin": "BTC",
    "entity_type": "Company",
    "start_date": "2024-01-01T00:00:00Z",
    "end_date": "2025-01-31T23:59:59Z",
    "interval": "daily",
    "AccessKeyId": "YOUR_ACCESS_KEY_ID",
    "SignatureNonce": "RANDOM_NONCE",
    "Timestamp": "CURRENT_TIMESTAMP",
    "Signature": "YOUR_SIGNATURE"
  }'

Response

{
  "code": "0",
  "msg": "success",
  "data": {
    "coin": "BTC",
    "total_entities": 291,
    "latest_value_usd": 440049000000,
    "latest_hold_amount": 3649917,
    "accumulated_data": [
      {
        "date": "2025-07-12",
        "timestamp": 1752278400,
        "accumulated_amount": 3508890,
        "activities": [
          {
            "name": "bitmax",
            "change": 0,
            "type": "Buy"
          },
          {
            "name": "Bhutan",
            "change": 100,
            "type": "Sell"
          },
          {
            "name": "El Salvador",
            "change": 1,
            "type": "Buy"
          },
          {
            "name": "GIGA Inc.",
            "change": 1129,
            "type": "Buy"
          }
        ]
      }
    ]
  }
}

GET/api/upgrade/v2/coin-treasuries/latest/entities

Get Latest Coin Treasury Entity Data

Retrieve the latest coin treasury entity data list for the specified coin.

Required Permission

coin_treasury_LATEST_COIN_TREASURY_ENTITIES

Request Parameters

  • Name
    coin
    Type
    string
    Description

    Coin (required), e.g. BTC, ETH

  • Name
    AccessKeyId
    Type
    string
    Description

    User access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    code
    Type
    string
    Description

    Status code

  • Name
    msg
    Type
    string
    Description

    Response message

  • Name
    data
    Type
    array
    Description

    Latest coin treasury entity data list

    • Name
      id
      Type
      string
      Description

      Unique entity record identifier

    • Name
      coin
      Type
      string
      Description

      Coin code (e.g. BTC, ETH)

    • Name
      name
      Type
      string
      Description

      Entity name

    • Name
      ticker
      Type
      string
      Description

      Stock ticker (if applicable)

    • Name
      entity_type
      Type
      string
      Description

      Entity type (e.g. public-companies, eth-treasuries)

    • Name
      hold_amount
      Type
      number
      Description

      Holding amount

    • Name
      days30
      Type
      number
      Description

      30-day change

    • Name
      last
      Type
      number
      Description

      Most recent change

    • Name
      share
      Type
      number
      Description

      Market share ratio

    • Name
      in_usd
      Type
      number
      Description

      Value in USD

    • Name
      market_cap
      Type
      number
      Description

      Market cap (USD)

    • Name
      enterprise_value
      Type
      number
      Description

      Enterprise value (USD, can be null)

    • Name
      btc_share
      Type
      number
      Description

      BTC market share (can be null)

    • Name
      cost_basis
      Type
      number
      Description

      Cost basis (can be null)

    • Name
      ngu
      Type
      number
      Description

      NGU metric (can be null)

    • Name
      mnav
      Type
      number
      Description

      MNAV metric

    • Name
      mcap
      Type
      number
      Description

      Market cap multiple

Request

GET
/api/upgrade/v2/coin-treasuries/latest/entities
curl -G https://open.bbx.com/api/upgrade/v2/coin-treasuries/latest/entities \
  -d "coin=BTC" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "code": "0",
  "msg": "success",
  "data": [
    {
      "id": "6899db84277d4951ab27937a",
      "coin": "BTC",
      "name": "XXI",
      "ticker": "CEP",
      "entity_type": "public-companies",
      "hold_amount": 43514,
      "days30": 0,
      "last": 0,
      "share": 0.00207,
      "in_usd": 5247000000,
      "market_cap": 276000000,
      "enterprise_value": null,
      "btc_share": null,
      "cost_basis": null,
      "ngu": null,
      "mnav": 0.053,
      "mcap": 18.987
    }
  ]
}

GET/api/upgrade/v2/coin-treasuries/latest/history

Get Latest Coin Treasury History Data

Retrieve the latest coin treasury historical change data for the specified coin.

Required Permission

coin_treasury_LATEST_COIN_TREASURY_HISTORY

Request Parameters

  • Name
    coin
    Type
    string
    Description

    Coin (required), e.g. BTC, ETH

  • Name
    AccessKeyId
    Type
    string
    Description

    User access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    code
    Type
    string
    Description

    Status code

  • Name
    msg
    Type
    string
    Description

    Response message

  • Name
    data
    Type
    array
    Description

    Latest coin treasury history data list

    • Name
      id
      Type
      string
      Description

      Unique history record identifier

    • Name
      coin
      Type
      string
      Description

      Coin code

    • Name
      name
      Type
      string
      Description

      Entity name

    • Name
      date
      Type
      number
      Description

      Trade date timestamp

    • Name
      type
      Type
      string
      Description

      Trade type (Buy/Sell)

    • Name
      balance
      Type
      number
      Description

      Balance after the trade

    • Name
      change
      Type
      number
      Description

      Change amount

    • Name
      total_cost_usd
      Type
      number
      Description

      Total cost (USD, can be null)

    • Name
      price
      Type
      number
      Description

      Trade price

    • Name
      stock_price
      Type
      number
      Description

      Stock price (can be null)

Request

GET
/api/upgrade/v2/coin-treasuries/latest/history
curl -G https://open.bbx.com/api/upgrade/v2/coin-treasuries/latest/history \
  -d "coin=BTC" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "code": "0",
  "msg": "success",
  "data": [
    {
      "id": "6899de38277d4951ab27992d",
      "coin": "BTC",
      "name": "El Salvador",
      "date": 1754870400,
      "type": "Buy",
      "balance": 6265,
      "change": 1,
      "total_cost_usd": null,
      "price": 116484,
      "stock_price": null
    }
  ]
}

GET/api/upgrade/v2/coin-treasuries/summary

Get Coin Treasury Summary

Retrieve aggregated treasury statistics for the specified coin.

Required Permission

coin_treasury_COIN_TREASURY_SUMMARY

Request Parameters

  • Name
    coin
    Type
    string
    Description

    Coin (required), e.g. BTC, ETH

  • Name
    AccessKeyId
    Type
    string
    Description

    User access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Response

  • Name
    code
    Type
    string
    Description

    Status code

  • Name
    msg
    Type
    string
    Description

    Response message

  • Name
    data
    Type
    object
    Description

    Coin treasury summary data

    • Name
      total_entities
      Type
      number
      Description

      Total number of entities

    • Name
      total_hold_amount
      Type
      number
      Description

      Total holding amount

    • Name
      total_value_usd
      Type
      number
      Description

      Total value (USD)

    • Name
      total_market_cap
      Type
      number
      Description

      Total market cap (USD)

    • Name
      average_share
      Type
      number
      Description

      Average market share

    • Name
      last_update_time
      Type
      string
      Description

      Last updated time

Request

GET
/api/upgrade/v2/coin-treasuries/summary
curl -G https://open.bbx.com/api/upgrade/v2/coin-treasuries/summary \
  -d "coin=BTC" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "code": "0",
  "msg": "success",
  "data": {
    "total_entities": 291,
    "total_hold_amount": 3649917,
    "total_value_usd": 440049000000,
    "total_market_cap": 1876344000000,
    "average_share": 0.0005970790378006872,
    "last_update_time": "2025-08-11T12:01:08Z"
  }
}

GET/api/upgrade/v2/futures/latest-depth

Get Latest Depth Data

Retrieve the latest order book depth data for a trading pair. The data is sourced from a Redis List and returns the most recent depth snapshot.

Required Permission

LATEST_DEPTH (same level as TRADE_DATA, low privilege)

Description

This endpoint reads the latest depth snapshot for the specified trading pair from a Redis List. You can choose how many levels to return (1-500). It uses Redis Pipeline to optimize performance, and is suitable for real-time order book monitoring, spread analysis, and liquidity evaluation.

Data Source

  • Redis List: depth:<dbkey>:asks and depth:<dbkey>:bids
  • Fetch the latest entry with LRANGE -1 -1

Use Cases

  • Real-time order book monitoring: retrieve the latest bid/ask levels to monitor price movement
  • Spread analysis: compare spread opportunities across exchanges
  • Liquidity evaluation: assess current market depth liquidity

Request Parameters

  • Name
    dbKey
    Type
    string
    Description

    Trading pair identifier. Format: {symbol}:{exchange} (e.g. btcusdt:binance, ethusdt:okex)

  • Name
    size
    Type
    integer
    Description

    Number of depth levels to return. Default: 50. Min: 1. Max: 500

  • Name
    AccessKeyId
    Type
    string
    Description

    User access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Supported Exchanges

  • Binance (binance)
  • OKEx (okex)
  • Huobi (huobi)
  • Bybit (bybit)
  • And any other configured exchanges

Response

  • Name
    code
    Type
    string
    Description

    Response status code. "200" indicates success

  • Name
    msg
    Type
    string
    Description

    Response message

  • Name
    data
    Type
    object
    Description

    Depth data object

    • Name
      max
      Type
      integer
      Description

      Maximum number of levels (corresponds to the requested size)

    • Name
      asks
      Type
      array
      Description

      Ask-side levels, sorted by price ascending. Each entry is [price, quantity]

    • Name
      bids
      Type
      array
      Description

      Bid-side levels, sorted by price descending. Each entry is [price, quantity]

    • Name
      now
      Type
      string
      Description

      Current time (format: YYYY-MM-DD HH:mm:ss)

    • Name
      result
      Type
      string
      Description

      Result status (success / error)

    • Name
      length
      Type
      integer
      Description

      Total number of returned levels (asks + bids)

    • Name
      ds
      Type
      integer
      Description

      Data source identifier (fixed to 1)

FAQ

Q: How often is the data updated?
A: It depends on the data collector. Typically it is real-time or near real-time (seconds-level).

Q: What happens if Redis has no data?
A: It returns empty asks and bids arrays with length = 0, but the request still succeeds (HTTP 200).

Q: What if the size parameter is greater than 500?
A: The server automatically caps it at 500 levels and does not return an error.

Q: What is the difference between this endpoint and /full-depth?
A: /latest-depth reads the latest snapshot from a Redis List and is suitable for the newest order book. /full-depth reads the full depth snapshot from a Redis String and the structure may differ.

Request

GET
/api/upgrade/v2/futures/latest-depth
curl -G https://open.bbx.com/api/upgrade/v2/futures/latest-depth \
  -d "dbKey=btcusdt:binance" \
  -d "size=50" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "code": "200",
  "msg": "success",
  "data": {
    "max": 50,
    "asks": [
      [50100.5, 1.234],
      [50101.0, 2.567],
      [50101.5, 0.891]
    ],
    "bids": [
      [50099.5, 1.456],
      [50099.0, 2.789],
      [50098.5, 1.234]
    ],
    "now": "2025-11-07 15:30:45",
    "result": "success",
    "length": 6,
    "ds": 1
  }
}

Response - No data

{
  "code": "200",
  "msg": "success",
  "data": {
    "max": 50,
    "asks": [],
    "bids": [],
    "now": "2025-11-07 15:30:45",
    "result": "success",
    "length": 0,
    "ds": 1
  }
}

Error - Missing parameter

{
  "code": "400",
  "msg": "Missing required parameter: dbKey",
  "data": null
}

Error - Authentication failed

{
  "code": "401",
  "msg": "Invalid signature",
  "data": null
}

Error - Insufficient permission

{
  "code": "403",
  "msg": "Permission denied: LATEST_DEPTH",
  "data": null
}

GET/api/upgrade/v2/futures/full-depth

Get Full Depth Data

Retrieve the full order book depth data for a trading pair and return the raw bid/ask levels.

Required Permission

FULL_DEPTH

Description

This endpoint reads the full depth snapshot for the specified trading pair and returns the raw bid/ask levels. The data format is a two-dimensional array, where each entry contains price and quantity.

Request Parameters

  • Name
    dbKey
    Type
    string
    Description

    Database key in the format symbol:exchange (e.g. btcswapusd:hbdm)

  • Name
    AccessKeyId
    Type
    string
    Description

    User access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

Example dbKey values

  • btcswapusd:hbdm - Huobi BTC perpetual swap
  • ethswapusd:hbdm - Huobi ETH perpetual swap
  • btcswapusdt:binance - Binance BTC perpetual swap
  • ethswapusdt:binance - Binance ETH perpetual swap

Response

  • Name
    code
    Type
    string
    Description

    Response status code. "0" indicates success

  • Name
    msg
    Type
    string
    Description

    Response message

  • Name
    data
    Type
    object
    Description

    Depth data object

    • Name
      timestamp
      Type
      integer
      Description

      Data timestamp (milliseconds)

    • Name
      action
      Type
      string
      Description

      Action type, usually "partial"

    • Name
      bids
      Type
      array
      Description

      Bid-side levels in the format [[price, quantity], ...], sorted by price descending

    • Name
      asks
      Type
      array
      Description

      Ask-side levels in the format [[price, quantity], ...], sorted by price ascending

Request

GET
/api/upgrade/v2/futures/full-depth
curl -G https://open.bbx.com/api/upgrade/v2/futures/full-depth \
  -d "dbKey=btcswapusd:hbdm" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response

{
  "code": "0",
  "msg": "success",
  "data": {
    "timestamp": 1755179093165,
    "action": "partial",
    "bids": [
      [118332.4, 169],
      [118326.5, 5],
      [118326.4, 169],
      [118320.4, 169],
      [118314.4, 169]
    ],
    "asks": [
      [118365.1, 169],
      [118371, 100],
      [118371.1, 169],
      [118377, 1],
      [118377.7, 100]
    ]
  }
}

GET/api/upgrade/v2/futures/full-depth/grouped

Get Grouped Full Depth Data

Retrieve depth data grouped and aggregated by a specified price interval, supporting price analysis at different granularities.

Required Permission

FULL_DEPTH_GROUPED

Description

This endpoint groups and aggregates full depth data based on the specified price interval. For example, when groupSize=100, prices are grouped into intervals of 100: [0,100), [100,200), [200,300), and so on, and quantities are summed within each interval.

Use Cases

  • Price distribution analysis
  • Large order aggregation view
  • Support and resistance analysis
  • Market depth visualization

Request Parameters

  • Name
    dbKey
    Type
    string
    Description

    Database key in the format symbol:exchange (e.g. btcswapusd:hbdm)

  • Name
    groupSize
    Type
    number
    Description

    Price grouping interval. Must be greater than 0 (e.g. 100.0)

  • Name
    AccessKeyId
    Type
    string
    Description

    User access key ID

  • Name
    SignatureNonce
    Type
    string
    Description

    Signature nonce

  • Name
    Timestamp
    Type
    string
    Description

    Request timestamp (seconds). Valid for 30 seconds

  • Name
    Signature
    Type
    string
    Description

    Signature generated with HmacSHA1 + Base64. See Generate API Signature

groupSize Notes

  • Small interval (e.g. 50, 100): suitable for fine-grained analysis, with more groups
  • Medium interval (e.g. 500, 1000): suitable for general analysis, balancing precision and readability
  • Large interval (e.g. 5000, 10000): suitable for high-level analysis, with fewer groups

Response

  • Name
    code
    Type
    string
    Description

    Response status code. "0" indicates success

  • Name
    msg
    Type
    string
    Description

    Response message

  • Name
    data
    Type
    object
    Description

    Grouped depth data object

    • Name
      timestamp
      Type
      integer
      Description

      Data timestamp (milliseconds)

    • Name
      action
      Type
      string
      Description

      Action type, usually "partial"

    • Name
      groupSize
      Type
      number
      Description

      Price grouping interval

    • Name
      bids
      Type
      array
      Description

      Grouped bid-side data in the format [[startPrice, endPrice, totalQuantity], ...], sorted by price descending

    • Name
      asks
      Type
      array
      Description

      Grouped ask-side data in the format [[startPrice, endPrice, totalQuantity], ...], sorted by price ascending

Grouping Notes

  • Price interval: half-open interval [startPrice, endPrice)
  • Sorting: bids sorted by price descending; asks sorted by price ascending
  • Quantity aggregation: quantities within the same interval are summed

Request

GET
/api/upgrade/v2/futures/full-depth/grouped
curl -G https://open.bbx.com/api/upgrade/v2/futures/full-depth/grouped \
  -d "dbKey=btcswapusd:hbdm" \
  -d "groupSize=100" \
  -d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
  -d "SignatureNonce=RANDOM_NONCE" \
  -d "Timestamp=CURRENT_TIMESTAMP" \
  -d "Signature=YOUR_SIGNATURE"

Response - groupSize=100

{
  "code": "0",
  "msg": "success",
  "data": {
    "timestamp": 1755179093165,
    "action": "partial",
    "groupSize": 100.0,
    "bids": [
      [118300, 118400, 1250.5],
      [118200, 118300, 980.2],
      [118100, 118200, 756.8],
      [118000, 118100, 1120.3],
      [117900, 118000, 834.7]
    ],
    "asks": [
      [118400, 118500, 1180.8],
      [118500, 118600, 756.3],
      [118600, 118700, 934.1],
      [118700, 118800, 678.9],
      [118800, 118900, 1045.2]
    ]
  }
}

Response - groupSize=1000

{
  "code": "0",
  "msg": "success",
  "data": {
    "timestamp": 1755179093165,
    "action": "partial",
    "groupSize": 1000.0,
    "bids": [
      [118000, 119000, 8750.2],
      [117000, 118000, 6543.1],
      [116000, 117000, 4321.8]
    ],
    "asks": [
      [119000, 120000, 7654.3],
      [120000, 121000, 5432.1],
      [121000, 122000, 3210.9]
    ]
  }
}

Was this page helpful?

Was this page helpful?