MarginPad Order book API

Live consolidated order book and trade tape, reconstructed by MarginPad from exchange websockets: resting depth at bp distances, a measured slippage curve, and the trade tape with the aggressor side. A book whose sequence we cannot prove is not served at all.

GitHub OpenAPI

Operations 3

GET /api/v1/book Live order book depth and slippage #
GET /api/v1/bookmap The order book over time, with walls and what ended them #
GET /api/v1/tape Live trade tape with aggressor side #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/marginpad-io:marginpad-io-order-book-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

marginpad-io-order-book-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: MarginPad Free Crypto Order book API
  version: 2.9.1
  description: Free, keyless, CORS-enabled crypto market-data API. Live prices, OHLC candles, a scored futures screener, funding rates, open interest, long/short ratios, liquidations, an economic calendar, the Fear & Greed index, top coins, global market stats, DeFi TVL, trading calculators, and a free paper-trading REST API for testing bots. No API key. No sign-up. about 60 requests/minute per client. Every response uses the envelope { ok, data, error, ts }, except the four liquidation-collector passthroughs (feed, liquidations/live, liquidations/recent, clusters), which return the raw collector object and are marked as such.
  contact:
    name: MarginPad
    url: https://marginpad.io/free-crypto-api/
  license:
    name: Free for public use
servers:
- url: https://marginpad.io
  description: Production
tags:
- name: Order book
  description: 'Live consolidated order book and trade tape, reconstructed by MarginPad from exchange websockets: resting depth at bp distances, a measured slippage curve, and the trade tape with the aggressor side. A book whose sequence we cannot prove is not served at all.'
paths:
  /api/v1/book:
    get:
      tags:
      - Order book
      summary: Live order book depth and slippage
      description: 'The resting order book for one coin, reconstructed in real time from the websockets of Bybit, OKX, Bitget and Hyperliquid (snapshot plus incremental updates, every update checked against the venue''s own sequence number). Per venue: best bid/ask, spread in bps, how many levels we hold and how far from mid they reach, depthUsd = resting dollars within 1/2/5/10/25 bps of mid, and slipBps = the measured cost of a market order of $10k/$50k/$250k walking that book. Plus consolidatedDepthUsd across all venues. Freshness (ageMs) is measured from OUR receive time, never the venue clock. Depth is quoted at bp DISTANCES, not as "liquidity within 2%" - a major-coin book only reaches about 0.03-0.24% from mid, so a wider band would be mostly empty. A venue whose book cannot be proven correct is omitted, and a symbol with no provable book returns 404 rather than a plausible wrong number. Passthrough from the collector: raw object, NOT the { ok, data, ts } envelope.'
      parameters:
      - name: symbol
        in: query
        required: true
        description: 'Coin ticker: BTC, ETH or SOL.'
        schema:
          type: string
        example: BTC
      - name: levels
        in: query
        required: false
        description: 'Add the raw per-venue ladder: every price level with its size, which is what an order-book display or a depth-aware bot needs. Up to 40 a side for everyone, keyless included - enough to draw a full ladder. API Max and Business read up to 60. The response always states both limits in its `depth` object. HISTORICAL depth is not offered on any plan and no archive exists: everything here is live state read from the exchanges seconds ago.'
        schema:
          type: string
        example: '40'
      responses:
        '200':
          description: Raw collector object (no envelope)
        '404':
          description: No provable book for that symbol
      operationId: getApiV1Book
      x-operation-id-source: derived
  /api/v1/bookmap:
    get:
      tags:
      - Order book
      summary: The order book over time, with walls and what ended them
      description: 'The consolidated book sampled every five seconds and kept for twenty minutes, bucketed by ABSOLUTE price against the shared mid - what a single snapshot cannot give you. Returns cols (each a frame: ts, mid, step, and resting dollars per price bucket per side, with how many venues quote each bucket), wallsStanding and wallsFinished. A WALL is a price carrying at least 2.5x the median of its sixteen neighbouring prices and never under $250,000 - measured against its own book, because five books bucketed together have no long tail. Each wall carries how long it has stood, which venues hold it, and for a finished one whether the tape TRADED THROUGH it (eaten) or it was simply WITHDRAWN (pulled) - knowable only because the same feed holds the book and the tape. Free and keyless. There is NO archive: twenty minutes is the whole history. Passthrough from the collector: raw object, NOT the { ok, data, ts } envelope.'
      parameters:
      - name: symbol
        in: query
        required: true
        description: 'Coin ticker: BTC, ETH, SOL, XRP, DOGE or BNB.'
        schema:
          type: string
        example: BTC
      - name: venue
        in: query
        required: false
        description: 'One book alone: binance, bybit, okx, bitget or hyperliquid. Omit for all five together.'
        schema:
          type: string
        example: binance
      - name: mins
        in: query
        required: false
        description: Window in minutes, 1-20.
        schema:
          type: string
        example: '10'
      - name: only
        in: query
        required: false
        description: Set to 'walls' to get the walls without the frames.
        schema:
          type: string
        example: walls
      responses:
        '200':
          description: Raw collector object (no envelope)
        '404':
          description: No film for this coin yet
      operationId: getApiV1Bookmap
      x-operation-id-source: derived
  /api/v1/tape:
    get:
      tags:
      - Order book
      summary: Live trade tape with aggressor side
      description: 'The most recent executed trades for one coin from Bybit, OKX, Bitget, Hyperliquid and Binance, newest last. Each row carries the venue, price, quantity, USD value, the exchange timestamp, our receive time, and side = THE AGGRESSOR, i.e. the taker that crossed the spread (not the order book side). That is what a candle cannot tell you: volume says how much traded, the aggressor says who was in a hurry. Also returns deltaThisMinute (buyUsd, sellUsd, deltaUsd) and deltaByVenue - cumulative volume delta, the signed difference between aggressive buying and aggressive selling. Passthrough from the collector: raw object, NOT the { ok, data, ts } envelope.'
      parameters:
      - name: symbol
        in: query
        required: true
        description: 'Coin ticker: BTC, ETH or SOL.'
        schema:
          type: string
        example: BTC
      - name: limit
        in: query
        required: false
        description: Max trades returned, up to 500.
        schema:
          type: string
        example: '100'
      responses:
        '200':
          description: Raw collector object (no envelope)
      operationId: getApiV1Tape
      x-operation-id-source: derived
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Required for paper-trading endpoints; OPTIONAL on /api/v1/* data endpoints, where sending it moves the call from the 60/minute per-IP limit to the key’s own budget (120/minute on Free, 600 on API Pro, 2000 on Max, 5000 on Business). Mint a key at POST /api/bot/key while signed in, or on https://marginpad.io/trading-api/.
externalDocs:
  description: Full manual with curl / JS / Python examples
  url: https://marginpad.io/free-crypto-api/