Order Book

get
Order Book

https://api.cryptowat.ch/markets/:exchange/:pair/orderbook
Gets the order book for a given market. An order book consists of two arrays, bids and asks. Each order is a 2-element array [Price, Amount].
Request
Response
Path Parameters
exchange
required
string
Exchange symbol
pair
required
string
Pair symbol
Query Parameters
depth
optional
number
Only return orders cumulating up to this size
span
optional
number
Only return orders within this percentage of the midpoint. Example: 0.5 (meaning 0.5%)
limit
optional
integer
Limits the number of orders on each side of the book
200: OK
https://api.cryptowat.ch/markets/kraken/btceur/orderbook
{
"result": {
"asks": [
[
6501.6,
3
],
[
6502.6,
0.63
],
// ...
],
"bids": [
[
6501.5,
2.58
],
[
6501.3,
3
],
// ...
],
"seqNum": 1272241
}
}

Each response includes a seqNum which is intended for use with the WebSocket API; you can use this to resynchronize your order book and replay deltas received over the live feed which have a higher seqNum.

Examples

Fetching the entire order book:

curl
python
curl "https://api.cryptowat.ch/markets/kraken/btcusd/orderbook"
import requests
def main():
resp = requests.get("https://api.cryptowat.ch/markets/kraken/btcusd/orderbook")
orderbook = resp.json()['result']
print orderbook
if __name__ == '__main__':
main()

Fetching only the spread (best bid and best ask):

curl "https://api.cryptowat.ch/markets/binance/btcusdt/orderbook?limit=1"

Fetching only the orders within 0.5% of the top of the book:

curl "https://api.cryptowat.ch/markets/binance/btcusdt/orderbook?span=0.5"

Fetching only enough orders to add up to 100 BTC on each side:

curl "https://api.cryptowat.ch/markets/binance/btcusdt/orderbook?depth=100"

get
Order Book Liquidity

https://api.cryptowat.ch/markets/:exchange/:pair/orderbook/liquidity
Provides liquidity sums at several basis point levels in the order book.
Request
Response
Path Parameters
exchange
required
string
pair
required
string
200: OK
{
"result": {
"bid": {
"base": {
"25": "42.68575532",
"50": "150.20769818",
"75": "206.84959818",
"100": "218.10759818",
"150": "258.62059818",
"200": "327.27659818",
"250": "348.34154648",
"300": "383.75054648",
"400": "502.67164085",
"500": "610.49064085"
},
"quote": {
"25": "313163.975021932",
"50": "1099872.240007476",
"75": "1513525.370107476",
"100": "1595484.645307476",
"150": "1889520.529007476",
"200": "2384944.812607476",
"250": "2536268.321074276",
"300": "2789505.394674276",
"400": "3632933.77625822",
"500": "4389383.45085822"
}
},
"ask": {
"base": {
"25": "60.52080426",
"50": "135.43265573",
"75": "230.67417345",
"100": "259.99744375",
"150": "326.09844375",
"200": "356.33344375",
"250": "405.9344691",
"300": "498.1004691",
"400": "592.0564691",
"500": "753.84801061"
},
"quote": {
"25": "445126.396201249",
"50": "997608.022688696",
"75": "1701256.8072791",
"100": "1918691.19773703",
"150": "2410404.10213703",
"200": "2636434.97803703",
"250": "3009225.13053995",
"300": "3704686.84893995",
"400": "4417540.34713995",
"500": "5659924.243671635"
}
}
},
"allowance": {
"cost": 12465796,
"remaining": 3949710408,
"remainingPaid": 0,
"upgrade": "Upgrade for a higher allowance, starting at $15/month for 16 seconds/hour. https://cryptowat.ch/pricing"
}
}