Crypto Order Book L2 Data

Crypto Order Book L2 Data

Access historical and current cryptocurrency order books through REST, stream real-time order book updates with WebSocket, integrate with AI applications through the CoinAPI MCP Server, or consume market data through FIX.

CoinAPI provides normalized Level 2 order book data for monitoring market liquidity, analyzing market depth, building trading systems, and powering AI-driven financial applications.

What Is Crypto Order Book Data?

An order book represents the current buy and sell interest for a trading market.

Unlike trades, which record completed transactions, or quotes, which show only the best bid and ask, an order book contains multiple price levels on both sides of the market. Each level represents the amount of liquidity available at a specific price.

This makes order book data essential for applications that analyze market depth, estimate execution costs, monitor liquidity, or study how supply and demand evolve before trades occur.

Order book data helps reveal where liquidity is concentrated and how easily the market may absorb larger buy or sell orders. By looking beyond the top bid and ask, developers can estimate slippage, detect thin markets, identify support and resistance zones, and compare depth across exchanges. This is especially useful for trading systems that need to understand not just the current price, but the amount of volume available around that price.

Depending on the use case, developers may work with different levels of order book detail. Shallow snapshots are useful for dashboards and quick liquidity checks, while deeper order book data supports more advanced analysis such as order book imbalance, depth-weighted pricing, and market impact estimation.

What's Included in CoinAPI Order Book Data?

Each CoinAPI order book snapshot contains aggregated bid and ask levels together with timestamps and symbol information.

FieldWhat it means
symbol_idCoinAPI normalized symbol identifier
time_exchangeTimestamp reported by the exchange
time_coinapiTimestamp when CoinAPI received the order book
asksAsk price levels ordered from best to worst price
bidsBid price levels ordered from best to worst price
pricePrice of the order book level
sizeAvailable volume resting at the price level

The Current Order Book Depth endpoint additionally returns:

  • ask_levels
  • bid_levels
  • ask_depth
  • bid_depth

WebSocket order book messages additionally include:

  • sequence
  • is_snapshot

Together, these fields provide the information needed to analyze market liquidity, estimate slippage, monitor available depth, build execution algorithms, and visualize market depth beyond the best bid and ask.

Available REST Endpoints

CoinAPI provides REST endpoints for retrieving current order books, current market depth, and historical order book snapshots. For applications requiring continuously updated market depth, order books are also available through the CoinAPI WebSocket API.

Current Order Book

Returns the current aggregated order book for a specific CoinAPI symbol.

Response includes
  • exchange and CoinAPI timestamps
  • aggregated ask levels
  • aggregated bid levels
  • price and size for each level

limit_levels controls the maximum number of levels returned. API key authentication is required.

Current Order Book Depth

Returns summary information about the current order book depth for a specific symbol.

Response includes
  • ask and bid level counts
  • aggregated ask depth
  • aggregated bid depth
  • timestamps
  • symbol identifier

Returns summarized depth information rather than individual price levels. API key authentication is required.

Historical Order Books

Returns historical order book snapshots for a specific CoinAPI symbol. Historical data is returned in ascending chronological order.

Response includes
  • exchange and CoinAPI timestamps
  • bid levels
  • ask levels
  • price and size for each level

The limit parameter controls the maximum number of snapshots returned. Historical REST order books are intended for historical analysis and support limited depth, with APITP hourly retrieval falling back to daily data for older records. For complete reconstruction and maximum available depth, use CoinAPI Flat Files.

Live Order Book Streaming with WebSocket

For applications requiring continuously updated market depth, CoinAPI provides real-time order book streaming through the WebSocket API.

Unlike REST endpoints, which retrieve stored snapshots, WebSocket streams order book updates for subscribed symbols on supported exchanges. CoinAPI supports several order book message types depending on the amount of depth required.

  • Book (Full) — streams complete Level 2 snapshots followed by incremental updates. Snapshot messages contain all bid and ask levels, while subsequent updates include only the levels that changed.
  • Book5 — provides the best five bid and five ask levels.
  • Book20 — provides the best twenty bid and twenty ask levels.
  • Book50 — provides the best fifty bid and fifty ask levels.

Book20 and Book50 provide throttled Level 2 depth feeds. Update frequency depends on the selected message type and subscription configuration. Developers can also adjust snapshot frequency using the subscribe_update_limit_ms_book_snapshot parameter.

Each WebSocket message includes timestamps, sequence number, symbol identifier, and bid and ask levels ordered from the best available price to the worst available price. If the reported bid or ask size is 0, the exchange has not provided the resting volume for that side of the market.

WebSocket order book data is commonly used for trading platforms, live pricing dashboards, spread monitoring, execution algorithms, and market surveillance systems.

CoinAPI Order Book Dataset Characteristics

  • Available through REST API, WebSocket API, FIX market data integration, and the CoinAPI Market Data MCP Server
  • Current order books and order book depth available through REST
  • Historical order book snapshots returned in ascending chronological order
  • Historical REST order books are intended for historical analysis and provide normalized Level 2 snapshots
  • WebSocket supports Book, Book5, Book20, and Book50 message types
  • Full Book messages provide complete snapshots followed by incremental updates
  • Book20 and Book50 provide throttled depth feeds depending on the selected stream configuration
  • ISO 8601 UTC timestamps
  • Normalized CoinAPI symbol identifiers
  • Historical retrieval supports configurable request limits
  • Order book data can be integrated into AI workflows through the CoinAPI Market Data MCP Server
  • FIX supports order book market data subscriptions

Why Developers Use Order Books Instead of Quotes

Quotes provide only the best available bid and ask prices. Order books extend that view by exposing multiple price levels on both sides of the market.

If you're monitoring market depth, estimating slippage, or building execution algorithms, order book data is usually the better choice. When you only need the current best bid and ask prices, quotes provide a simpler and lighter dataset.

If you need…Use
Best bid and ask pricesQuotes
Bid-ask spread monitoringQuotes
Multiple price levelsOrder Books
Market depth analysisOrder Books
Liquidity visualizationOrder Books
Slippage estimationOrder Books
Execution algorithmsOrder Books

Many production systems combine both datasets. Developers often use quotes for lightweight price monitoring while using order books to understand the liquidity available behind those prices.

Common Crypto Order Book Use Cases

  • Build market depth visualizations
  • Estimate order slippage
  • Develop execution algorithms
  • Monitor market liquidity
  • Power AI trading applications
  • Research market microstructure

Who Uses Crypto Order Book Data?

  • Trading platforms
  • Quantitative funds
  • Algorithmic trading systems
  • Fintech applications
  • AI and machine learning teams
  • Researchers and universities
Crypto Order Book L2 Data

Ready to Build with CoinAPI Order Book Data?

Explore the Order Book documentation to retrieve historical order book snapshots, current market depth, current order books, and real-time Level 2 market data using standardized CoinAPI symbols.

For applications requiring complete historical order book reconstruction and maximum available depth, CoinAPI Flat Files provide the recommended historical dataset.

As your application evolves, combine Order Books with Quotes, Trades, OHLCV, Metadata, WebSocket streams, FIX, MCP, Exchange Rates, and Flat Files to build a complete cryptocurrency market data platform on top of the CoinAPI ecosystem.