{"uid":"cap_46Lz6-XzvKAuLcAg31Lvl","slug":"crypto-order-book-snapshot-0ae7b216","name":"Crypto Order Book Snapshot","description":"L2 order-book snapshot for a spot pair: best bid/ask, mid price, spread (absolute + %), and the top N aggregated price levels per side (default 25, max 100). Pairs use BASE-QUOTE format (BTC-USD, ETH-USD, SOL-USDC). Backed by Coinbase Exchange's public market-data API - keyless; coverage is Coinbase-listed markets.","url":"https://agent402.tools/api/crypto-orderbook","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["pair"],"properties":{"pair":{"type":"string","description":"Spot pair as BASE-QUOTE (e.g. BTC-USD, ETH-USD, SOL-USDC)"},"depth":{"type":"number","description":"Price levels per side to return (1-100, default 25)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"asks":[{"size":0.5,"price":62490.01,"orders":3}],"bids":[{"size":0.81109777,"price":62489.29,"orders":8}],"pair":"BTC-USD","time":"2026-07-14T02:40:51Z","depth":1,"spread":0.72,"bestAsk":62490.01,"bestBid":62489.29,"midPrice":62489.65,"sequence":132601080491,"spreadPct":0.0012,"totalAskLevels":27473,"totalBidLevels":15653}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_lz5BjZbJ2txEbmabwaZgl","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns an L2 order-book snapshot for a spot trading pair, including best bid/ask, mid price, spread, and top N aggregated price levels per side.","exampleAgentPrompt":"What does the BTC-USD order book look like right now? Show me the top 10 price levels on each side, and tell me the best bid, best ask, mid price, and spread.","exampleUseCases":null,"resultDescription":"A structured snapshot of the order book for the requested spot pair, including: best bid price, best ask price, mid price, absolute spread, spread as a percentage, and up to N (default 25, max 100) aggregated price levels for both the bid and ask sides.","failureModes":["Invalid or unsupported pair format (e.g. BTCUSD instead of BTC-USD) returns an error","Depth value outside 1-100 range is rejected","Pair not listed on Coinbase Exchange returns a not-found or empty response","Payment failure (insufficient USDC balance) prevents the call from completing","Network timeout or exchange feed disruption may return stale or unavailable data"],"whenToPreferThis":"Use this endpoint when you need a real-time L2 order book snapshot for a spot cryptocurrency pair traded on Coinbase Exchange — especially when you need both best bid/ask metadata AND aggregated depth levels in a single call. Prefer this over a simple ticker when you need spread analysis or market depth information.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T01:08:58.020Z","isFirstParty":false}