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
  1. REST API
  2. Market Data

Get Volume Analytics

GET https://api.sfox.com/v1/analytics/volume

Retrieve historical exchange volume analytics by currency.

Data is not forward-filled and, therefore, may be incomplete. e.g. no data will be returned for an interval during which 0 trades were recorded.

Responses are limited to 500 results. If the requested start_time , end_time , and interval will result in more than 500 results, your request will be rejected. To retrieve data over a larger time range, you will need to make multiple requests with new start_time / end_time ranges. Results may precede your specified start_time value.

Query Parameters

Name
Type
Description

start_time required

timestamp

Unix timestamp (ms) of the first datapoint to return

end_time

timestamp

Unix timestamp (ms) of the last datapoint to return

interval required

int

Duration of each datapoint in seconds (i.e. interval = 86400 = daily volume data)

(60 | 3600 | 86400)

currency required

string

The currency to retrieve data for (i.e. eth)

net

boolean

Retrieve "net volume" (net buy/sell volume) or "gross volume" (total traded volume)

(true | false)

default = false

by_exchange

boolean

Retrieve total market volume or volume by exchange

(true | false) default = false

Response Body

Key
Description

timstamp

The Unix timestamp (ms) of the beginning of the interval

exchange

The exchange associated with the volume data (only returned if by_exchange = true in the request)

volume

The quantity of the specified currency traded during this interval

usd_notional

The USD value of the quantity of the specified currency traded during this interval

Responses

200: Gross Volume
//interval=86400&net=false&by_exchange=false
{
    "data": [
        {
            "timestamp": 1689206400000,
            "volume": 324557.08579094,
            "usd_notional": 633266040.1379151
        },
        {
            "timestamp": 1689292800000,
            "volume": 244525.03601467,
            "usd_notional": 482590637.1359154
        },
        {
            "timestamp": 1689379200000,
            "volume": 54552.86708131,
            "usd_notional": 105565737.85291174
        },
        {
            "timestamp": 1689465600000,
            "volume": 59350.88216805,
            "usd_notional": 114595675.74899396
        },
        {
            "timestamp": 1689552000000,
            "volume": 174930.26792864,
            "usd_notional": 333229267.7529286
        }
    ]
}
200: Net Volume
//interval=86400&net=true&by_exchange=false
{
    "data": [
        {
            "timestamp": 1689206400000,
            "volume": 23385.45910848,
            "usd_notional": 45629005.60418967
        },
        {
            "timestamp": 1689292800000,
            "volume": 487.77127065,
            "usd_notional": 962657.4526522362
        },
        {
            "timestamp": 1689379200000,
            "volume": 541.72807017,
            "usd_notional": 1048302.8024520231
        }
    ]
}
200: Gross Volume by Exchange
//interval=86400&net=false&by_exchange=true
{
    "data": [
        {
            "timestamp": 1689206400000,
            "volumes": [
                {
                    "exchange": "bitfinex",
                    "volume": 22064.11327313,
                    "usd_notional": 43050835.2870461
                },
                {
                    "exchange": "bitflyer",
                    "volume": 675.3754941,
                    "usd_notional": 1317772.3842097484
                },
                {
                    "exchange": "bitstamp",
                    "volume": 20403.74974212,
                    "usd_notional": 39811183.82200494
                },
                {
                    "exchange": "coinbase",
                    "volume": 256084.73824809,
                    "usd_notional": 499664851.6698304
                },
                {
                    "exchange": "gemini",
                    "volume": 2893.597955,
                    "usd_notional": 5645901.442109791
                },
                {
                    "exchange": "kraken",
                    "volume": 22435.5110785,
                    "usd_notional": 43775495.53271416
                }
            ]
        },
        {
            "timestamp": 1689292800000,
            "volumes": [
                {
                    "exchange": "bitfinex",
                    "volume": 16438.39032122,
                    "usd_notional": 32442539.986500576
                },
                {
                    "exchange": "bitflyer",
                    "volume": 282.4740891,
                    "usd_notional": 557486.2715692556
                },
                {
                    "exchange": "bitstamp",
                    "volume": 11499.07793533,
                    "usd_notional": 22694393.333832387
                },
                {
                    "exchange": "coinbase",
                    "volume": 194042.96600292,
                    "usd_notional": 382960044.1791732
                },
                {
                    "exchange": "gemini",
                    "volume": 1941.224533,
                    "usd_notional": 3831169.1901688813
                },
                {
                    "exchange": "kraken",
                    "volume": 20320.9031331,
                    "usd_notional": 40105004.17467113
                }
            ]
        }
    ]
}
200: Net Volume by Exchange
//interval=86400&net=true&by_exchange=true
{
    "data": [
        {
            "timestamp": 1689206400000,
            "volumes": [
                {
                    "exchange": "bitfinex",
                    "volume": -6825.69751025,
                    "usd_notional": -13318096.02295827
                },
                {
                    "exchange": "bitflyer",
                    "volume": 405.5878231,
                    "usd_notional": 791370.7816200266
                },
                {
                    "exchange": "bitstamp",
                    "volume": 2621.19358698,
                    "usd_notional": 5114394.218867672
                },
                {
                    "exchange": "coinbase",
                    "volume": 25602.95423207,
                    "usd_notional": 49955715.503370605
                },
                {
                    "exchange": "gemini",
                    "volume": 278.054287,
                    "usd_notional": 542531.1755026139
                },
                {
                    "exchange": "kraken",
                    "volume": 1303.36668958,
                    "usd_notional": 2543089.9477870227
                }
            ]
        },
        {
            "timestamp": 1689292800000,
            "volumes": [
                {
                    "exchange": "bitfinex",
                    "volume": -3128.46017994,
                    "usd_notional": -6174278.168395847
                },
                {
                    "exchange": "bitflyer",
                    "volume": 81.1377265,
                    "usd_notional": 160132.098396033
                },
                {
                    "exchange": "bitstamp",
                    "volume": 211.54172883,
                    "usd_notional": 417495.3181104044
                },
                {
                    "exchange": "coinbase",
                    "volume": 4753.17507186,
                    "usd_notional": 9380789.074742645
                },
                {
                    "exchange": "gemini",
                    "volume": -341.430339,
                    "usd_notional": -673841.3682337883
                },
                {
                    "exchange": "kraken",
                    "volume": -1088.1927376,
                    "usd_notional": -2147639.5019672103
                }
            ]
        }
    ]
}
401: Unauthorized
{
    "error": "invalid token. check authorization header."
}
422: Unprocessable Entity
{
    "error": "currency must be a non-blank string"
}

Example Request

curl -H 'Authorization: Bearer <API_TOKEN>'
'https://api.sfox.com/v1/analytics/volume?currency=btc&interval=86400&start_time=1689279127000&end_time=1689624727000&net=true'
const axios = require('axios');

axios({
  method: 'get',
  url: 'https://api.sfox.com/v1/analytics/volume?currency=btc&interval=86400&start_time=1689279127000&end_time=1689624727000&net=true',
  headers: {
    'Authorization': 'Bearer <API_KEY>'
  }
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
import requests

data = requests.get(
  "https://api.sfox.com/v1/analytics/volume?currency=btc&interval=86400&start_time=1689279127000&end_time=1689624727000&net=true",
  headers={
    "Authorization": "Bearer <API_KEY>",
  }
)
print(data)
PreviousGet CandlesticksNextGet Order Estimate

Last updated 1 year ago