On this page

# Get orderbook

This endpoint allows users to retrieve the current orderbook (bid/ask levels) for a specified trading symbol.

    /api/v1/book

####
Query Parameters

Field
Type
Need
Description
Example

`"symbol"`

string

required

Trading pair symbol

`BTC`

`"agg_level"`

integer

no

Aggregation level for price grouping. Defaults to `1`

`1`

    api/v1/book?symbol=BTC

####
Response

- Status 200: Successfully retrieved book data

    {
      "success": true,
      "data": {
        "s": "BTC",
        "l": [
          [
            {
              "p": "106504",
              "a": "0.26203",
              "n": 1
            },
            {
              "p": "106498",
              "a": "0.29281",
              "n": 1
            }
          ],
          [
            {
              "p": "106559",
              "a": "0.26802",
              "n": 1
            },
            {
              "p": "106564",
              "a": "0.3002",
              "n": 1
            },
          ]
        ],
        "t": 1751370536325
      },
      "error": null,
      "code": null
    }

Field
Type
Description

`'s'`

string

Symbol

`'l'`

array

Two-dimensional array containing bids (index 0) and asks (index 1). Each index contains up to 10 levels.

`'t'`

string

Response timestamp in milliseconds

`'p'`

decimal string

Price level

`'a'`

decimal string

Total amount at price level

`'n'`

integer

Number of orders at level

- Status 400: Invalid request parameters

- Status 401: Unauthorized access

- Status 500: Internal server error

####
Code Example (Python)

    import requests

    response = requests.get(
        "api.pacifica.fi/api/v1/book?symbol=BTC",
        headers={"Accept": "*/*"},
    )

    data = response.json()

Previous Get kline (candle) data
Next Get recent trades

Last updated 2 months ago