Endpoint limits from Binance’s API docs; archive files listed and opened on data.binance.vision, November 28, 2026. Binance’s docs remain the authority.
REST snapshot, GET /fapi/v1/depth
Price levels on both sides, up to 1,000
Record the WebSocket yourself
Every change to the book, every 100 ms, plus a snapshot to start from
Binance bookDepth files (data.binance.vision)
Cumulative depth and notional within ±0.2% to ±5% of the price, every ~30 seconds
Binance bookTicker files (data.binance.vision)
Every change to the best bid and ask
Binance historical order book program
Tick-level L2 for whitelisted futures accounts, per Binance’s 2020 announcement
Tardis.dev
The raw depth stream with periodic 1,000-level snapshots, to replay the full L2 book
Aperiodic
Per-bar book metrics: spread and top-of-book depth, depth and imbalance at 5 to 25 levels
Order book
GET /fapi/v1/depthBest bid and ask
GET /fapi/v1/ticker/bookTickerDiff depth stream
<symbol>@depth@100ms (or @250ms, @500ms)Book ticker stream
<symbol>@bookTickerNeither the REST endpoints nor the streams take a start time: what the book looked like yesterday is gone unless someone recorded it. So any backtest that fills orders against depth, or any study of how the book behaved in a sell-off, needs one of the archives below.
Binance also hides some liquidity from these responses: its docs say Retail Price Improvement (RPI) orders are excluded from /fapi/v1/depth and bookTicker, and a separate /fapi/v1/rpiDepth includes them.
import asyncio
import json
import httpx
import websockets
SYMBOL = "btcusdt"
STREAM = f"wss://fstream.binance.com/public/ws/{SYMBOL}@depth@100ms"
SNAPSHOT = "https://fapi.binance.com/fapi/v1/depth"
async def record(path: str) -> None:
async with httpx.AsyncClient() as http:
with open(path, "a") as out:
while True: # reconnect: Binance drops every stream after 24 hours
try:
async with websockets.connect(STREAM) as ws:
await follow(ws, http, out)
except (websockets.ConnectionClosed, OSError):
await asyncio.sleep(1)
async def follow(ws, http: httpx.AsyncClient, out) -> None:
snapshot, prev_u = None, None
async for message in ws:
event = json.loads(message)
if snapshot is None: # (re)start: a snapshot after the stream is open
snapshot = (await http.get(SNAPSHOT, params={"symbol": SYMBOL.upper(), "limit": 1000})).json()
out.write(json.dumps({"snapshot": snapshot}) + "\n")
last_id = snapshot["lastUpdateId"]
if event["u"] < last_id:
continue # older than the snapshot
if prev_u is None and event["U"] > last_id:
snapshot = None # missed the start: take a new snapshot
continue
if prev_u is not None and event["pu"] != prev_u:
snapshot, prev_u = None, None # gap in the stream: resync
continue
out.write(json.dumps({"event": event}) + "\n") # prices stay strings
prev_u = event["u"]
asyncio.run(record("btcusdt-depth.jsonl"))Binance publishes two order book files a day for USD-margined futures at data.binance.vision. bookDepth gives cumulative depth (in coins) and notional (in USDT) within 12 bands, ±0.2%, ±1%, ±2%, ±3%, ±4% and ±5% of the price, about every 30 seconds. The BTCUSDT file for November 27, 2026 has 2,880 snapshots and 34,560 rows. The archive lists 1,423 BTCUSDT days, from January 1, 2023 to November 27, 2026, with February 8 and 9, 2023, April 18, 2024 and October 8, 2026 missing. You see how much sits within 1% of the price, but not at which levels.
bookTicker records every change to the best bid and ask: 7.4 million rows on March 30, 2024 for BTCUSDT, 88 MB zipped. The BTCUSDT daily files run from May 16, 2023 to March 30, 2024. The last monthly file, for April 2024, holds only the first hours of April 1, and nothing comes after it.
Both are licensed CC BY-NC-SA 4.0. Binance’s data terms (last updated August 26, 2026) exclude commercial use and require a separate written enterprise licence for it.
l1_liquidity gives the spread and the dollar depth at the best bid and ask. l2_liquidity gives the total quantity in the top 5, 10, 20 and 25 levels on each side, and l2_imbalance gives how the two sides compare at each depth. Each comes as the bar’s last value and its average, in bars from 1 minute to 1 day (15 and 30 seconds on Institutional), timestamped by the exchange or by when each update reached us. We never recalculate a bar after publishing it.
On Binance’s BTC perp in May 2025, the top 5 levels held a median 8.9 BTC per side and the top 25 levels about 10.9 BTC (10.84 on the ask, 10.87 on the bid), so four-fifths of the visible depth near the price sat in the first five levels. That month is the free preview, so you can check it with no key.
Datasets: l1_liquidity, l2_liquidity, l2_imbalance (pricing).
from datetime import date
from aperiodic import get_metrics
# Binance BTC perp, 5-minute bars, May 2025: the free preview, no key needed
book = get_metrics(
metric="l2_liquidity",
exchange="binance-futures",
symbol="perpetual-BTC-USDT:USDT",
interval="5m",
timestamp="exchange",
start_date=date(2025, 5, 1),
end_date=date(2025, 5, 31),
preview=True,
)Also: Binance open interest history API · OKX funding rate and open interest history API, measured · Aperiodic vs. Binance public data · order book depth, every venue · order book imbalance, every venue