List Order Book

The method GET /order_book/ enables you to retrieve a list of all open orders in the specified book. The value of the aggregate query parameter determines the response returned:

  • True: The service aggregates the orders by price, and the response includes only the top 50 orders for each side of the book. It is the default behavior.
  • False: The response consists of the whole order book.

HTTP Request

Query Parameters

You can use the following query parameters in your request:

ParameterDescriptionRequiredDefault Value
aggregateSpecifies whether the response should aggregate orders by price.Notrue
bookSpecifies the book to use.Yes

JSON Response Payload

The endpoint returns a JSON object with Asks and Bids. Each of these is a JSON array of open orders, and each open order is represented as a JSON object. The response fields are as follows:

Field NameDescriptionType
asksThe list of open asks.JSON array
bidsThe list of open bids.JSON array
sequenceAn increasing integer value for each order book update.Long
updated_atThe date and time when the service last updated the order.ISO 8601 timestamp

Asks and Bids in the aggregated order books are JSON dictionaries with the following fields:

Field NameDescriptiionTypeUnits
amountThe major amount in the order.StringMajor
bookThe order book symbol.StringMajor_Minor
priceThe price per unit of major.StringMinor

Asks and Bids in the unaggregated (whole) order books are JSON dictionaries with the following fields:

Field NameDescriptiionTypeUnits
amountThe major amount in the order.StringMajor
bookThe order book symbol.StringMajor_Minor
oidThe order's ID.String
priceThe price per unit of major.StringMinor

The following response objects exemplify the JSON objects returned:

curl https://api-stage.bitso.com/api/v3/order_book?book=btc_mxn

{
    "success": true,
    "payload": {
        "asks": [{
            "book": "btc_mxn",
            "price": "5632.24",
            "amount": "1.34491802"
        },{
            "book": "btc_mxn",
            "price": "5633.44",
            "amount": "0.4259"
        },{
            "book": "btc_mxn",
            "price": "5642.14",
            "amount": "1.21642"
        }],
        "bids": [{
            "book": "btc_mxn",
            "price": "6123.55",
            "amount": "1.12560000"
        },{
            "book": "btc_mxn",
            "price": "6121.55",
            "amount": "2.23976"
        }],
        "updated_at": "2016-04-08T17:52:31.000+00:00",
        "sequence": "27214"
    }
}
curl "https://sandbox.bitso.com/api/v3/order_book/?book=btc_mxn&aggregate=false"

{
    "success": true,
    "payload": {
        "asks": [{
            "book": "btc_mxn",
            "price": "5632.24",
            "amount": "1.34491802",
            "oid": "VN5lVpgXf02o6vJ6"
        },{
            "book": "btc_mxn",
            "price": "5633.44",
            "amount": "0.4259",
            "oid": "RP8lVpgXf04o6vJ6"
        },{
            "book": "btc_mxn",
            "price": "5642.14",
            "amount": "1.21642",
            "oid": "46efbiv72drbphig"
        }],
        "bids": [{
            "book": "btc_mxn",
            "price": "6123.55",
            "amount": "1.12560000",
            "oid": "11brtiv72drbphig"
        },{
            "book": "btc_mxn",
            "price": "6121.55",
            "amount": "2.23976",
            "oid": "1ywri0yg8miihs80"
        }],
        "updated_at": "2016-04-08T17:52:31.000+00:00",
        "sequence": "27214"
    }
}