sFOX API
Sign InOpen Account
sFOX API
sFOX API
  • Introduction
    • Welcome
    • Getting Started
    • Systems & Operations
    • Rate Limits
  • REST API
    • REST Endpoints
    • Authentication
    • Rate Limits
    • Account Management
      • Get All Balances
      • Get All Currencies
      • Get All Currency Pairs
      • Get All Transactions
      • Get Fees
    • Orders
      • Order Types
      • Create Order
      • Cancel Order
      • Cancel Multiple Orders
      • Cancel All Orders
      • Amend Order
      • Get Single Order
      • Get All Open Orders
      • Get All Done Orders
      • Get All Trades
    • Request for Quote (RFQ)
    • Post-Trade Settlement (PTS)
      • Get Account Risk Metrics
      • Get All Positions
      • Get All Funding Transactions
      • Get All Funding Rates
      • Get All Risk Modes
      • Create Transfer
    • Shorting
      • Get Account Risk Metrics
      • Get All Positions
    • Transfers
      • Get All Deposit Addresses
      • Get Single Deposit Address
      • Create Deposit Address
      • Deposit From Bank Account
      • Withdraw From Account
      • Get Single Withdrawal Fee
      • Create Transfer
    • Custody (sFOX SAFE)
      • Get Whitelisted Addresses
      • Add Whitelisted Address
      • Delete Whitelisted Address
      • Get Approval Rules
      • Create Approval Rule
      • Edit Approval Rule
      • Get Approval Requests
      • Respond to Approval Request
    • Staking
      • Get Staking Currencies
      • Get All Staking Transactions
      • Create Stake
      • Cancel Stake
      • Unstake
    • Market Data
      • Get Candlesticks
      • Get Volume Analytics
      • Get Order Estimate
      • Get Order Book
    • Reporting
      • Get Orders Report
      • Get Monthly Summary
      • Get Portfolio Valuation
      • Get All Transactions
  • WebSocket API
    • Introduction
    • Connecting
    • Rate Limits
    • Authentication
    • Subscribing & Unsubscribing
    • Message Format
    • Market Data
      • Order Book
      • Trades
      • Ticker
    • Orders & Account Data
      • Orders
      • Trades
      • Balances
      • Post-Trade Settlement
  • FIX API
    • FIX Order Entry
    • FIX Market Data
    • QuickFIX Guide
  • Errors
    • Error Codes
Powered by GitBook
On this page
  • Orderbook
  • Response Body
  • Example Request
  1. REST API
  2. Market Data

Get Order Book

Order book snapshot for a currency pair.

Orderbook

GET https://api.sfox.com/v1/markets/orderbook/:pair

Get the blended L2 orderbook data of our connected exchanges, including the top bids and asks and the location of those bids and asks

Path Parameters

Name
Type
Description

pair

string

The pair or product to trade in the format: (i.e. "btcusd", "ethbtc", "usdteth") Default: "btcusd"

{
  "bids": [
    [
      9458.12,
      1e-08,
      "gemini"
    ],
    [
      9456,
      1,
      "itbit"
    ],
    [
      9453,
      0.73553115,
      "itbit"
    ],
    // truncated
  "asks": [
    [
      9455.55,
      2.03782954,
      "market1"
    ],
    [
      9455.56,
      0.9908,
      "market1"
    ],
    [
      9455.59,
      0.60321264,
      "market1"
    ],
    // truncated
  "market_making": {
    "bids": [
      [
        9447.34,
        2,
        "bitstamp"
      ],
      [
        9452.01,
        0.60321264,
        "market1"
      ],
      [
        9452.31,
        0.47488688,
        "bittrex"
      ],
      [
        9456,
        1,
        "itbit"
      ],
      [
        9458.12,
        1e-08,
        "gemini"
      ]
    ],
    "asks": [
      [
        9458.13,
        2.07196048,
        "gemini"
      ],
      [
        9457.75,
        0.14748797,
        "itbit"
      ],
      [
        9456,
        0.1686167,
        "bittrex"
      ],
      [
        9455.68,
        0.742406,
        "bitstamp"
      ],
      [
        9455.55,
        2.03782954,
        "market1"
      ]
    ]
  },
  "timestamps": {
    "gemini": [
      1572903458537,
      1572903458538
    ],
    "bitstamp": [
      1572903458199,
      1572903458199
    ],
    "itbit": [
      1572903458414,
      1572903458416
    ],
    "bittrex": [
      1572903458517,
      1572903458517
    ],
    "market1": [
      1572903458071,
      1572903458071
    ]
  },
  "lastupdated": 1572903458756,
  "pair": "btcusd",
  "currency": "usd",
  "lastpublished": 1572903458798\}

Response Body

Key
Description

pair

The trading pair

currency

The quote currency

asks

List of asks, size, and exchange

bids

List of the bids, size, and exchange

market_making

List of the best bid and ask on each exchange

timestamp

A list of exchanges and the latest timestamps of the orderbook

lastupdated

Last update of the blended orderbook

lastpublished

Last time an orderbook update was published

Example Request

curl 'https://api.sfox.com/v1/markets/orderbook/btcusd'
const axios = require('axios');

axios({
  method: 'get',
  url: 'https://api.sfox.com/v1/markets/orderbook/btcusd',
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
import requests

data = requests.get(
  "https://api.sfox.com/v1/markets/orderbook/btcusd",
  headers={
    "Authorization": "Bearer <API_KEY>",
  }
)
print(data)
PreviousGet Order EstimateNextReporting

Last updated 1 year ago