{"uid":"cap_-QL4kuk1W-5CoTsFZiKgM","slug":"agent402-perpetuals-orderbook-1a60a59d","name":"Agent402 Perpetuals Orderbook","description":"The live level-2 order book for one perpetual: best bid and ask, mid, spread in basis points, up to 20 levels a side with cumulative depth and bid/ask imbalance. Use it when an agent is sizing an order, checking liquidity before a trade or measuring book pressure at a point in time.","url":"https://agent402.tools/api/perp-orderbook","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"coin":{"type":"string","description":"Perp ticker, e.g. BTC, ETH, SOL."},"depth":{"type":"number","description":"Levels per side to return (default 10, max 20)."}}},"responseSchema":{"type":"json","example":{"mid":77279.5,"asks":[{"n":4,"px":77280,"sz":1.2}],"bids":[{"n":10,"px":77279,"sz":3.13}],"coin":"BTC","time":"2026-08-22T12:00:00.000Z","source":"hyperliquid","spread":1,"bestAsk":77280,"bestBid":77279,"askDepth":{"size":4.2,"levels":5,"notionalUsd":324000},"bidDepth":{"size":6.1,"levels":5,"notionalUsd":471000},"fetchedAt":"2026-08-22T12:00:00.000Z","imbalance":0.185,"spreadBps":0.129}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_LMaWJKswHCAs7ClGKQn62","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a live CLOB orderbook snapshot for a perpetual futures market, including bid/ask levels, spread, depth, and imbalance metrics.","exampleAgentPrompt":"What does the BTC perpetual futures orderbook look like right now — give me the top 15 levels on each side so I can see the spread and depth.","exampleUseCases":[{"title":"Pre-trade liquidity check for large order","prompt":"Before I put in a 10 BTC perp buy, can you pull the current BTC orderbook and tell me how much ask-side liquidity exists in the top 20 levels and what the spread looks like?"},{"title":"Monitoring ETH perp imbalance for directional signal","prompt":"Check the ETH perpetual orderbook right now and tell me the bid-ask imbalance — I want to know if there's significantly more pressure on one side."},{"title":"Comparing spread across SOL perp market","prompt":"Pull the SOL perp orderbook with 10 levels per side and tell me the current spread in basis points and the mid price."}],"resultDescription":"Returns a JSON object with the mid price, best bid and best ask prices, an array of bid levels and ask levels (each with price, size, and level count), spread in raw and basis-point terms, aggregated bid/ask depth (total size and notional USD across requested levels), an order imbalance score, the source exchange (Hyperliquid), and fetch/event timestamps.","failureModes":["Invalid or unsupported ticker symbol returns an error — only perp markets listed on Hyperliquid are supported","Depth value exceeding 20 may be rejected or clamped","Payment failure or insufficient USDC balance results in a 402 Payment Required response","Temporary unavailability of the underlying Hyperliquid data source may yield a timeout or stale data error"],"whenToPreferThis":"Choose this endpoint when you need a real-time perpetual futures orderbook snapshot with structured depth and imbalance analytics, sourced from Hyperliquid, without requiring API keys or account signup — payment is handled per-call via USDC over x402. Prefer it over exchange-direct APIs when operating in a wallet-native, agent-first context or when you need pre-computed spread and depth metrics rather than raw tick data.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:57:01.275Z","isFirstParty":false}