> ## Documentation Index
> Fetch the complete documentation index at: https://docs.futuur.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Order book

> Retrieve aggregated order book data for a market, including bids and asks at each price level.

Get the aggregated order book for a market. The response contains `bid` and `ask` arrays with cumulative depth data at each price level, allowing you to assess market liquidity and your position within it.

## Endpoint

```
GET https://api.futuur.com/markets/{id}/book/
```

## Authentication

No authentication is required for this endpoint.

## Parameters

<ParamField path="id" type="integer" required>
  The unique identifier of the market.
</ParamField>

<ParamField query="currency_mode" type="string" required>
  The currency mode to query. Accepted values: `play_money`, `real_money`.
</ParamField>

<ParamField query="position" type="string" default="long">
  The position side to query. Accepted values: `long`, `short`.
</ParamField>

## Response

<ResponseField name="bid" type="object[]" required>
  Aggregated bid levels, sorted from highest to lowest price.

  <Expandable title="properties">
    <ResponseField name="price" type="number">
      Price per share at this level (0–1).
    </ResponseField>

    <ResponseField name="total_shares" type="number">
      Total number of shares available at this price level.
    </ResponseField>

    <ResponseField name="total_amount" type="number">
      Total currency amount represented at this price level.
    </ResponseField>

    <ResponseField name="total_fees" type="number">
      Total fees attributable to the shares offered at this price level.
    </ResponseField>

    <ResponseField name="cumulative_shares" type="number">
      Cumulative shares from the best bid down to and including this level.
    </ResponseField>

    <ResponseField name="cumulative_amount" type="number">
      Cumulative currency amount from the best bid down to and including this level.
    </ResponseField>

    <ResponseField name="cumulative_fees" type="number">
      Cumulative fees from the best bid down to and including this level.
    </ResponseField>

    <ResponseField name="total_user_shares" type="number">
      Number of shares at this level belonging to you. Present when authenticated.
    </ResponseField>

    <ResponseField name="total_user_shares_requested" type="number">
      Number of shares at this level you have requested but that have not yet been filled. Present when authenticated.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="ask" type="object[]" required>
  Aggregated ask levels, sorted from lowest to highest price.

  <Expandable title="properties">
    <ResponseField name="price" type="number">
      Price per share at this level (0–1).
    </ResponseField>

    <ResponseField name="total_shares" type="number">
      Total number of shares offered at this price level.
    </ResponseField>

    <ResponseField name="total_amount" type="number">
      Total currency amount represented at this price level.
    </ResponseField>

    <ResponseField name="total_fees" type="number">
      Total fees attributable to the shares offered at this price level.
    </ResponseField>

    <ResponseField name="cumulative_shares" type="number">
      Cumulative shares from the best ask up to and including this level.
    </ResponseField>

    <ResponseField name="cumulative_amount" type="number">
      Cumulative currency amount from the best ask up to and including this level.
    </ResponseField>

    <ResponseField name="cumulative_fees" type="number">
      Cumulative fees from the best ask up to and including this level.
    </ResponseField>

    <ResponseField name="total_user_shares" type="number">
      Number of shares at this level belonging to you. Present when authenticated.
    </ResponseField>

    <ResponseField name="total_user_shares_requested" type="number">
      Number of shares at this level you have requested but that have not yet been filled. Present when authenticated.
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

```bash cURL theme={null}
curl --request GET \
  --url "https://api.futuur.com/markets/501/book/?currency_mode=play_money&position=long"
```

```json Sample response theme={null}
{
  "bid": [
    {
      "price": 0.62,
      "total_shares": 120.0,
      "total_amount": 74.4,
      "total_fees": 0.12,
      "cumulative_shares": 120.0,
      "cumulative_amount": 74.4,
      "cumulative_fees": 0.12,
      "total_user_shares": 50.0,
      "total_user_shares_requested": 0.0
    },
    {
      "price": 0.60,
      "total_shares": 80.0,
      "total_amount": 48.0,
      "total_fees": 0.08,
      "cumulative_shares": 200.0,
      "cumulative_amount": 122.4,
      "cumulative_fees": 0.20,
      "total_user_shares": 0.0,
      "total_user_shares_requested": 0.0
    }
  ],
  "ask": [
    {
      "price": 0.64,
      "total_shares": 95.0,
      "total_amount": 60.8,
      "total_fees": 0.10,
      "cumulative_shares": 95.0,
      "cumulative_amount": 60.8,
      "cumulative_fees": 0.10,
      "total_user_shares": 0.0,
      "total_user_shares_requested": 10.0
    },
    {
      "price": 0.66,
      "total_shares": 60.0,
      "total_amount": 39.6,
      "total_fees": 0.06,
      "cumulative_shares": 155.0,
      "cumulative_amount": 100.4,
      "cumulative_fees": 0.16,
      "total_user_shares": 0.0,
      "total_user_shares_requested": 0.0
    }
  ]
}
```
