Přejít na hlavní obsah

Orderbook tool reference

This page is the tool reference for retrieving orderbook snapshots from the Cryptohopper Market Data MCP. For the conceptual guide, see a practical guide to crypto orderbook data.

Tool name

get_orderbook

Purpose

Returns a point-in-time snapshot of the orderbook for a specified pair on a specified exchange. Contains the current resting bids and asks with price and size per level.

Arguments

ArgumentTypeRequiredDescription
exchangestringYesExchange identifier (lowercase).
pairstringYesPair in BASE/QUOTE format (e.g. BTC/USDT).
depthintegerNoMaximum number of levels to return per side. Default is exchange-dependent. Upper bound is upstream-dependent.

Response schema

{
"exchange": "binance",
"pair": "BTC/USDT",
"timestamp": "2026-04-24T14:03:00Z",
"bids": [
[80934.18, 5.32816],
[80930.05, 1.10000],
[80925.40, 3.40000]
],
"asks": [
[80936.22, 1.20000],
[80940.00, 2.50000],
[80945.75, 0.80000]
]
}

Fields

FieldTypeDescription
exchangestringThe exchange identifier the data came from.
pairstringThe pair, in BASE/QUOTE format.
timestampstring (ISO-8601)Capture time of the snapshot.
bidsarrayArray of [price, size] tuples, sorted by price descending (highest bid first).
asksarrayArray of [price, size] tuples, sorted by price ascending (lowest ask first).

Prices and sizes are returned as JSON numbers. Clients that require exact precision for execution-related calculations should convert them to a decimal type immediately after parsing. See data model for conventions.

Ordering

  • bids are sorted descending by price. The first entry is the best bid (highest price a buyer is offering).
  • asks are sorted ascending by price. The first entry is the best ask (lowest price a seller is offering).

The spread is the difference between asks[0] and bids[0]. The midpoint is their average.

Depth

Orderbook depth varies by exchange. The MCP returns what the upstream exchange exposes via its public API.

Typical depth (levels per side)Exchanges
100Most major exchanges at default
Up to 500 or moreSome exchanges, when depth is requested

Requests for more depth than the upstream supports are clamped to the upstream maximum. The depth argument is best-effort, not guaranteed.

Freshness

Orderbooks are captured at request time. The timestamp field reflects when the snapshot was read from the upstream exchange.

Orderbooks become stale very quickly — typically within seconds on liquid pairs. Clients should not cache orderbook responses for use in execution decisions.

Cost

AspectCost
Per invocation1 call unit on all tiers
Historical variantNot supported — orderbook history is not available through the MCP

Example invocations

Basic snapshot

Prompted in an MCP client:

Show me the current orderbook for BTC/USDT on Binance.

The agent invokes get_orderbook(exchange="binance", pair="BTC/USDT") and returns a snapshot.

Custom depth

Pull the top 50 levels of the ETH/USDT orderbook on Kraken.

The agent invokes get_orderbook(exchange="kraken", pair="ETH/USDT", depth=50).

Derived metrics

The MCP returns raw levels; derived metrics (spread, depth within X%, slippage for a given order size) are computed by the model or by the calling code.

Errors

Error codeCause
UNAUTHORIZEDAPI key invalid or revoked.
EXCHANGE_NOT_SUPPORTEDExchange not available on the active tier.
PAIR_NOT_FOUNDPair does not exist on the specified exchange.
INVALID_PARAMETERArgument failed validation (e.g. malformed pair symbol, negative depth).
EXCHANGE_UNAVAILABLEUpstream exchange not responding.
RATE_LIMIT_EXCEEDEDShort-interval rate limit hit.
QUOTA_EXCEEDEDWeekly quota reached.

Tier access

Orderbook queries are available on all tiers (Pioneer, Explorer, Adventurer, Hero).

The exchange-coverage restriction applies: on Pioneer, orderbook queries are limited to Binance, Coinbase, and Kraken. On Explorer and above, more exchanges are available.

Byl tento článek užitečný?

Začni obchodovat s Cryptohopperem zdarma!

Zdarma k použití – kreditní karta není potřeba

Let's get started
Nové aplikace již brzy!