市场数据

加密市场数据 API

一个 API 获取实时加密价格与成交量:1 分钟到 1 周的 OHLCV K 线、价格变动、逐笔成交、成交 K 线与大额订单。所有交易所的数据已合并并统一格式,无需逐个对接交易所、自行对齐格式。

从 K 线到逐笔:市场实际成交的情况,未经任何解读。成交量、成交与逐笔数据均在所有交易所间聚合。

#面向 AI 智能体与 LLM 的加密市场数据

向接入 BytNode 的 AI 智能体提问:“BTC 过去 24 小时走势如何?”“今天上午 ETH 有大额成交吗?”“给我看 SOL 本周的小时 K 线”:它通过 MCP 工具 get_pair_data 用本数据族作答,无需构造 URL。

MCP tools/call
第一个问题背后的 MCP 工具调用:BTCUSDT 的 24 根小时 K 线与涨跌幅。
{
  "name": "get_pair_data",
  "arguments": {
    "symbol": "BTCUSDT",
    "fields": ["klines", "price_change"],
    "timeframe": "1h",
    "limit": 24
  }
}
  • 给 LLM 的提示:K 线以其窗口的起始时间(time,UTC)标注——14:00 的小时 K 线覆盖 14:00 至 15:00——且各行从新到旧排列。
  • 给开发者:在构建自己的 AI 智能体?把 /v1/klines/history 暴露为工具(tool calling),模型即可自行获取 K 线;或直接加载 MCP 工具,省去封装。
  • 适用环境:Claude、ChatGPT、Cursor 及任何 MCP 客户端,包括支持 MCP 的 AI 智能体框架,如 LangChain 或 n8n。

通过 MCP 服务器指南接入你的 AI 智能体,或用开源的 Agent Skills 教它使用 BytNode。

#OHLCV K 线

GET/v1/klines/historydata_type · klines_history完整参考
此接口的全部 18 个字段(取自接口契约)
timeISO 8601 UTC, milliseconds (2026-09-28T14:00:00.000Z)Start of the bucket the row covers: a 1h bucket at 14:00 covers 14:00:00 to 14:59:59.999.
openquote currency (USDT for BTCUSDT)Opening price of the candle.
highquote currency (USDT for BTCUSDT)Highest price of the candle.
lowquote currency (USDT for BTCUSDT)Lowest price of the candle.
closequote currency (USDT for BTCUSDT)Closing price of the candle (last price for the open candle).
volumebase asset quantity (BTC for BTCUSDT)Traded volume over the row, base asset units (BTC for BTCUSDT, NOT dollars), aggregated across venues, over the market(s) the route covers: spot + perpetual futures on `/v1/klines` and `/v1/trades-kline`, the path's market alone on a `/spot` or `/futures` route (a name without a market suffix covers every market of its route; `volume_spot` / `volume_futures` restrict). `null` when a market is not available (never a partial sum).
buy_volumebase asset quantity (BTC for BTCUSDT)Aggressive (taker) buy volume, base asset units, aggregated across venues.
sell_volumebase asset quantity (BTC for BTCUSDT)Aggressive (taker) sell volume, base asset units, aggregated across venues.
is_volume_estimated`true` when some base-asset quantities of this row were ESTIMATED from USD amounts (history where a source reported amounts but not quantities): a buy or sell amount is converted at that source's own average price when its total quantity is known, otherwise at the candle's typical price (high + low + close) / 3. Every quantity a source measured is kept as is. `false` = all measured. `null` when the volume itself is `null` (not available).
volume_spotbase asset quantity (BTC for BTCUSDT)Volume traded on the SPOT market, summed across venues, base asset units. `null` while not available yet (never a partial sum).
buy_volume_spotbase asset quantity (BTC for BTCUSDT)Aggressive (taker) buy volume on the SPOT market, across venues.
sell_volume_spotbase asset quantity (BTC for BTCUSDT)Aggressive (taker) sell volume on the SPOT market, across venues.
is_volume_spot_estimated`true` when the spot quantities of this candle were ESTIMATED from USD amounts and the candle's typical price (high + low + close) / 3 (data written before quantities were recorded; mean error 0.04 % in 1m, 0.37 % in 1d); `false` = measured. `null` when the volume itself is `null` (not available).
volume_futuresbase asset quantity (BTC for BTCUSDT)Volume traded on PERPETUAL FUTURES, summed across venues, in base asset units. `null` when not available yet (never a partial sum).
buy_volume_futuresbase asset quantity (BTC for BTCUSDT)Aggressive (taker) buy volume on PERPETUAL FUTURES, across venues.
sell_volume_futuresbase asset quantity (BTC for BTCUSDT)Aggressive (taker) sell volume on PERPETUAL FUTURES, across venues.
is_volume_futures_estimated`true` when `volume_futures` was ESTIMATED from USD amounts and the candle's typical price; `false` = measured. `null` when the volume itself is `null` (not available).
is_closed`true` = the row is final; `false` = provisional: the latest bucket while it still settles (a few seconds after its end, e.g. a candle whose volumes are not final yet), or the period in progress with `?live=1` on the routes that take it. Exception, rare: when a venue delivers trades LATE (seconds to minutes, e.g. during a burst), a closed row built from trades (trade candles, candle volumes, CVD, buy/sell ratio, trades per second) is corrected afterwards to include them, usually within minutes and at most one hour later; the correction only adds the late trades.

两条路由:/v1/klines 返回最近一根已收盘的 K 线(一个对象;加 ?live=1 返回进行中的 K 线,is_closed: false),/v1/klines/history 返回 K 线列表,从新到旧(参数见下)。K 线周期放在 timeframe 中,必填:1m、5m、15m、30m、1h、4h、1d、1w。缺失或不在列表中:422。

参数类型默认值说明
symbolstring必填资产。
timeframestring必填K 线周期:1m、5m、15m、30m、1h、4h、1d 或 1w。
limitinteger100K 线数量,1 到 1000。
since_ms / until_msinteger—带日期的时间窗口,以毫秒为单位,在 limit 之前生效。
curl
curl -H "X-API-KEY: $BYTNODE_API_KEY" \
  "https://api.bytnode.com/v1/klines/history?symbol=BTCUSDT&timeframe=1h&limit=100"
字段类型说明
timestringK 线起始时间,ISO 8601。
open, high, low, closefloat四个价格。
volumefloat所有市场的成交量:现货加永续合约,汇总所有交易所,以基础资产为单位(不带市场后缀的字段名覆盖所有市场)。任一部分未知时为 null;稳定币为现货成交量。
buy_volume / sell_volumefloat所有市场(现货 + 合约)的主动买入与卖出成交量,以基础资产为单位。任一部分未知时为 null。
is_volume_estimatedboolean当该 K 线的聚合成交量经过重建(较早的历史)时为 true,实测时为 false。
volume_spotfloat现货市场所有平台合计成交量,以基础资产为单位:buy_volume_spot + sell_volume_spot。在尚未最终确定或未知时为 null。
buy_volume_spotfloat现货市场所有平台以市价买入成交的数量,以基础资产为单位。
sell_volume_spotfloat现货市场所有平台以市价卖出成交的数量,以基础资产为单位。
is_volume_spot_estimatedboolean当该 K 线的聚合成交量经过重建(较早的历史)时为 true,实测时为 false。
volume_futuresfloat该 K 线的永续合约成交量,跨交易所求和,以基础资产为单位(未知时为 null;稳定币没有合约市场,为 null)。
buy_volume_futures / sell_volume_futuresfloat永续合约上的主动买入与卖出成交量,汇总所有交易所,以基础资产为单位。
is_closedboolean只提供已收盘的 K 线(从不提供正在形成的 K 线)。K 线成交量最终确定后为 true(收盘后几秒);在此之前成交量可能为 null。

#涨跌幅

GET/v1/price-changedata_type · price_change完整参考
此接口的全部 11 个字段(取自接口契约)
timeISO 8601 UTC, milliseconds (2026-09-28T14:00:00.000Z)Instant of the latest trade of the reference spot market (`price` is that trade's price, the close of `/v1/klines?live=1`); if it has not traded since the latest closed one-minute candle, the end of that candle (`price` = its close). Exception: USDTUSDC, which no spot candle source lists, gives the instant of its latest trade, `price` being the volume-weighted price of its last 90 seconds.
pricequote currency (USDT for BTCUSDT)Price.
changes_pctPrice change over each window, keyed by window (`1m` … `1w`), in percent.
changes_pct.1mpercentPrice change over the last 1m, in percent.
changes_pct.5mpercentPrice change over the last 5m, in percent.
changes_pct.15mpercentPrice change over the last 15m, in percent.
changes_pct.30mpercentPrice change over the last 30m, in percent.
changes_pct.1hpercentPrice change over the last 1h, in percent.
changes_pct.4hpercentPrice change over the last 4h, in percent.
changes_pct.1dpercentPrice change over the last 1d, in percent.
changes_pct.1wpercentPrice change over the last 1w, in percent.

八个周期的百分比变化,按需计算,分别相对一分钟、五分钟、一小时、一周前的价格。缺少历史的周期为 null,绝不会报错。

响应
{
  "status": "ok",
  "server_time": "2026-10-10T08:51:08.454Z",
  "data_type": "price_change",
  "symbol": "BTCUSDT",
  "data": {
    "time": "2026-10-10T08:50:00.000Z",
    "price": 82818.72,
    "changes_pct": {
      "1m": 0.0201927489674, "5m": 0.0452759586592, "15m": -0.0102140384352,
      "30m": -0.0437873393277, "1h": 0.0500741326695, "4h": 0.18183489701,
      "1d": 0.240522875817, "1w": -2.15235074281
    }
  }
}

这是少数为稳定币提供数据的接口之一:此时会回退使用现货逐笔数据。

#按秒聚合的成交

GET/v1/trades-kline/futures/secondsdata_type · trades_kline_futures_seconds完整参考
此接口的全部 10 个字段(取自接口契约)
timeISO 8601 UTC, milliseconds (2026-09-28T14:00:00.000Z)Start of the second the row covers.
volumebase asset quantity (BTC for BTCUSDT)Traded volume over the row, base asset units (BTC for BTCUSDT, NOT dollars), aggregated across venues, over the market(s) the route covers: spot + perpetual futures on `/v1/klines` and `/v1/trades-kline`, the path's market alone on a `/spot` or `/futures` route (a name without a market suffix covers every market of its route; `volume_spot` / `volume_futures` restrict). `null` when a market is not available (never a partial sum).
trade_countcountNumber of trades. `null` when the number is not known: history imported from an outside source carries the buy and sell volumes, not the trade count.
buy_volumebase asset quantity (BTC for BTCUSDT)Aggressive (taker) buy volume, base asset units, aggregated across venues.
sell_volumebase asset quantity (BTC for BTCUSDT)Aggressive (taker) sell volume, base asset units, aggregated across venues.
is_closed`true` = the row is final; `false` = provisional: the latest bucket while it still settles (a few seconds after its end, e.g. a candle whose volumes are not final yet), or the period in progress with `?live=1` on the routes that take it. Exception, rare: when a venue delivers trades LATE (seconds to minutes, e.g. during a burst), a closed row built from trades (trade candles, candle volumes, CVD, buy/sell ratio, trades per second) is corrected afterwards to include them, usually within minutes and at most one hour later; the correction only adds the late trades.
net_volumebase asset quantity (BTC for BTCUSDT)buy_volume - sell_volume over the row, base asset units. Positive = net buying.
avg_trade_sizebase asset quantity (BTC for BTCUSDT)Average trade size, base asset units (NOT dollars: multiply by the price for a notional).
trade_ratetrades per secondAverage number of trades per second over the bucket. `null` when `trade_count` is.
is_volume_estimated`true` when some base-asset quantities of this row were ESTIMATED from USD amounts (history where a source reported amounts but not quantities): a buy or sell amount is converted at that source's own average price when its total quantity is known, otherwise at the candle's typical price (high + low + close) / 3. Every quantity a source measured is kept as is. `false` = all measured. `null` when the volume itself is `null` (not available).

每秒一行,所有交易所合计。因此 limit 参数计的是秒数,而不是成交笔数。

字段类型说明
timestring对应的秒。
volumefloat总成交量,各交易所合计。
trade_countinteger成交笔数,各交易所合计。
buy_volumefloat市价买入量。
sell_volumefloat市价卖出量。

永续合约按分钟或按 bucket 的同一买卖拆分,即 /v1/cvd/futures/history 的 buy_volume / sell_volume。

#逐笔成交与大额订单

GET/v1/trades/spotdata_type · trades_spot完整参考
此接口的全部 6 个字段(取自接口契约)
timeISO 8601 UTC, milliseconds (2026-09-28T14:00:00.000Z)Execution instant of the trade, as stated by the venue (milliseconds).
idOpaque, stable identifier of the trade (16 hex characters): the same trade always has the same `id`, so it can be used to deduplicate or resume. It reveals nothing about the venue.
sideTrades: `buy` or `sell` (aggressor side). Liquidations: `long` or `short` (the position liquidated).
pricequote currency (USDT for BTCUSDT)Price.
quantitybase asset quantity (BTC for BTCUSDT)Quantity traded or liquidated, in base asset units.
value_usdUSDNotional value: price × quantity, in the pair's quote currency (USDT for BTCUSDT), taken as USD.
GET/v1/trades/futuresdata_type · trades_futures完整参考
此接口的全部 6 个字段(取自接口契约)
timeISO 8601 UTC, milliseconds (2026-09-28T14:00:00.000Z)Execution instant of the trade, as stated by the venue (milliseconds).
idOpaque, stable identifier of the trade (16 hex characters): the same trade always has the same `id`, so it can be used to deduplicate or resume. It reveals nothing about the venue.
sideTrades: `buy` or `sell` (aggressor side). Liquidations: `long` or `short` (the position liquidated).
pricequote currency (USDT for BTCUSDT)Price.
quantitybase asset quantity (BTC for BTCUSDT)Quantity traded or liquidated, in base asset units.
value_usdUSDNotional value: price × quantity, in the pair's quote currency (USDT for BTCUSDT), taken as USD.

逐笔成交(每笔执行),每行一笔,所有交易所合并,且不标注来源——与 WebSocket 频道 trades.spot 和 trades.futures 中的成交相同,id 也相同。limit 取值 1 到 10000。不带其他参数时返回最新的成交。如需读取某个时间区间,请加上 since_ms、until_ms 和/或 order(asc 或 desc):每页最多覆盖 15 分钟,响应中带有 next,即下一页的 URL,可直接调用(区间读完时为 null)。按 next 逐页读取,每笔成交恰好返回一次且按顺序。/v1/trades/large 同样适用,/v1/trades-kline/futures/seconds 则按 limit 秒分页。

字段类型说明
timestring成交时间戳。
sidestringbuy 或 sell:流动性吃单方的方向。
pricefloat成交价。
quantityfloat数量,以基础资产为单位。
value_usdfloat美元价值(价格 × 数量)。
GET/v1/trades/largedata_type · trades_large完整参考
此接口的全部 6 个字段(取自接口契约)
timeISO 8601 UTC, milliseconds (2026-09-28T14:00:00.000Z)Execution instant of the trade, as stated by the venue (milliseconds).
idOpaque, stable identifier of the trade (16 hex characters): the same trade always has the same `id`, so it can be used to deduplicate or resume. It reveals nothing about the venue.
sideTrades: `buy` or `sell` (aggressor side). Liquidations: `long` or `short` (the position liquidated).
pricequote currency (USDT for BTCUSDT)Price.
quantitybase asset quantity (BTC for BTCUSDT)Quantity traded or liquidated, in base asset units.
value_usdUSDNotional value: price × quantity, in the pair's quote currency (USDT for BTCUSDT), taken as USD.

同一期货数据流,按规模筛选:读盘,找出真正重要的订单。

参数类型默认值说明
symbolstring必填资产。
min_usdfloat100000最低金额(美元)。下限为 1000。
limitinteger100事件数量,1 到 10 000。
curl
# The last fifty orders above $250,000
curl -H "X-API-KEY: $BYTNODE_API_KEY" \
  "https://api.bytnode.com/v1/trades/large?symbol=BTCUSDT&min_usd=250000&limit=50"

#成交 K 线(trades kline)

GET/v1/trades-klinedata_type · trades_kline完整参考
此接口的全部 11 个字段(取自接口契约)
timeISO 8601 UTC, milliseconds (2026-09-28T14:00:00.000Z)Start of the bucket the row covers: a 1h bucket at 14:00 covers 14:00:00 to 14:59:59.999.
trade_countcountNumber of trades. `null` when the number is not known: history imported from an outside source carries the buy and sell volumes, not the trade count.
avg_trade_sizebase asset quantity (BTC for BTCUSDT)Average trade size, base asset units (NOT dollars: multiply by the price for a notional).
volumebase asset quantity (BTC for BTCUSDT)Traded volume over the row, base asset units (BTC for BTCUSDT, NOT dollars), aggregated across venues, over the market(s) the route covers: spot + perpetual futures on `/v1/klines` and `/v1/trades-kline`, the path's market alone on a `/spot` or `/futures` route (a name without a market suffix covers every market of its route; `volume_spot` / `volume_futures` restrict). `null` when a market is not available (never a partial sum).
buy_volumebase asset quantity (BTC for BTCUSDT)Aggressive (taker) buy volume, base asset units, aggregated across venues.
sell_volumebase asset quantity (BTC for BTCUSDT)Aggressive (taker) sell volume, base asset units, aggregated across venues.
net_volumebase asset quantity (BTC for BTCUSDT)buy_volume - sell_volume over the row, base asset units. Positive = net buying.
buy_sell_coverage_ratiofraction (0.585 = 58.5 %)Share of the volume (in USD) whose buy/sell split is known. 1 = every trade is split. Below 1 on part of the history, where some sources did not report the aggressor side: `buy_volume` and `sell_volume` then cover that share only, so `buy_volume + sell_volume` < `volume`; `buy_ratio` and the CVD describe the covered share. `null` when the bucket has no volume.
trade_ratetrades per secondAverage number of trades per second over the bucket. `null` when `trade_count` is.
is_volume_estimated`true` when some base-asset quantities of this row were ESTIMATED from USD amounts (history where a source reported amounts but not quantities): a buy or sell amount is converted at that source's own average price when its total quantity is known, otherwise at the candle's typical price (high + low + close) / 3. Every quantity a source measured is kept as is. `false` = all measured. `null` when the volume itself is `null` (not available).
is_closed`true` = the row is final; `false` = provisional: the latest bucket while it still settles (a few seconds after its end, e.g. a candle whose volumes are not final yet), or the period in progress with `?live=1` on the routes that take it. Exception, rare: when a venue delivers trades LATE (seconds to minutes, e.g. during a burst), a closed row built from trades (trade candles, candle volumes, CVD, buy/sell ratio, trades per second) is corrected afterwards to include them, usually within minutes and at most one hour later; the correction only adds the late trades.
GET/v1/trades-kline/spotdata_type · trades_kline_spot完整参考
GET/v1/trades-kline/futuresdata_type · trades_kline_futures完整参考
GET/v1/trades-kline/historydata_type · trades_kline_history完整参考
此接口的全部 11 个字段(取自接口契约)
timeISO 8601 UTC, milliseconds (2026-09-28T14:00:00.000Z)Start of the bucket the row covers: a 1h bucket at 14:00 covers 14:00:00 to 14:59:59.999.
trade_countcountNumber of trades. `null` when the number is not known: history imported from an outside source carries the buy and sell volumes, not the trade count.
avg_trade_sizebase asset quantity (BTC for BTCUSDT)Average trade size, base asset units (NOT dollars: multiply by the price for a notional).
volumebase asset quantity (BTC for BTCUSDT)Traded volume over the row, base asset units (BTC for BTCUSDT, NOT dollars), aggregated across venues, over the market(s) the route covers: spot + perpetual futures on `/v1/klines` and `/v1/trades-kline`, the path's market alone on a `/spot` or `/futures` route (a name without a market suffix covers every market of its route; `volume_spot` / `volume_futures` restrict). `null` when a market is not available (never a partial sum).
buy_volumebase asset quantity (BTC for BTCUSDT)Aggressive (taker) buy volume, base asset units, aggregated across venues.
sell_volumebase asset quantity (BTC for BTCUSDT)Aggressive (taker) sell volume, base asset units, aggregated across venues.
net_volumebase asset quantity (BTC for BTCUSDT)buy_volume - sell_volume over the row, base asset units. Positive = net buying.
buy_sell_coverage_ratiofraction (0.585 = 58.5 %)Share of the volume (in USD) whose buy/sell split is known. 1 = every trade is split. Below 1 on part of the history, where some sources did not report the aggressor side: `buy_volume` and `sell_volume` then cover that share only, so `buy_volume + sell_volume` < `volume`; `buy_ratio` and the CVD describe the covered share. `null` when the bucket has no volume.
trade_ratetrades per secondAverage number of trades per second over the bucket. `null` when `trade_count` is.
is_volume_estimated`true` when some base-asset quantities of this row were ESTIMATED from USD amounts (history where a source reported amounts but not quantities): a buy or sell amount is converted at that source's own average price when its total quantity is known, otherwise at the candle's typical price (high + low + close) / 3. Every quantity a source measured is kept as is. `false` = all measured. `null` when the volume itself is `null` (not available).
is_closed`true` = the row is final; `false` = provisional: the latest bucket while it still settles (a few seconds after its end, e.g. a candle whose volumes are not final yet), or the period in progress with `?live=1` on the routes that take it. Exception, rare: when a venue delivers trades LATE (seconds to minutes, e.g. during a burst), a closed row built from trades (trade candles, candle volumes, CVD, buy/sell ratio, trades per second) is corrected afterwards to include them, usually within minutes and at most one hour later; the correction only adds the late trades.
GET/v1/trades-kline/spot/historydata_type · trades_kline_spot_history完整参考
GET/v1/trades-kline/futures/historydata_type · trades_kline_futures_history完整参考

基于成交而非价格构建的 K 线(“trades kline”):有多少订单成交、方向如何、金额多少,始终在所有交易所间聚合。逐笔成交本身见 /v1/trades/spot 和 /v1/trades/futures。

每个接口都有对应的历史:/v1/trades-kline/history、/v1/trades-kline/spot/history、/v1/trades-kline/futures/history。

参数类型默认值说明
symbolstring必填资产。
timeframestring必填1m、5m、15m、30m、1h、4h、1d。缺失或无效:422。
livebooleanfalse仅用于最新值接口:返回正在形成的 K 线。
limitinteger100用于 /history 接口,1 到 1000。这些接口只提供已收盘的 K 线。
since_ms / until_msinteger—用于 /history 接口:带日期的时间窗口,以毫秒为单位,在 limit 之前生效。
curl
# The 5-minute trade candle in progress
curl -H "X-API-KEY: $BYTNODE_API_KEY" \
  "https://api.bytnode.com/v1/trades-kline?symbol=BTCUSDT&timeframe=5m&live=1"
字段类型说明
timestring该行的时间点(取代原来的键,例如 bucket):通用客户端只需读取一个键。
trade_countinteger窗口内的成交笔数。
avg_trade_sizefloat | null平均成交规模,以基础资产为单位(BTCUSDT 为 BTC),而非美元:乘以价格即得名义价值。
volumefloat总成交量,以基础资产为单位(BTCUSDT 为 BTC)——而非美元。
buy_volume / sell_volumefloat买入与卖出成交量,以基础资产为单位。
net_volumefloat买入量减卖出量,以基础资产为单位。正值 = 净买入。
trade_ratefloat每秒成交笔数:笔数除以周期时长,正在形成的 K 线也如此计算,以保持定义一致。
is_volume_estimatedboolean当该 K 线的聚合成交量经过重建(较早的历史)时为 true,实测时为 false。
is_closedboolean仅在正在形成的 K 线上为假。

关于稳定币

/v1/trades-kline 和 /v1/trades-kline/spot 仍有数据,因为稳定币有现货市场。/v1/trades-kline/futures 返回 data: null 并带有 unavailable: "not_applicable":稳定币没有期货市场。