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

# Get Order Book Stats

> Rolling volume and trade counts over four windows

Returns base volume and trade count for one book over four rolling windows ending now: one hour, 24 hours, 7 days and 30 days. All four are computed from the same 30-day trade set, so the figures are internally consistent.

When the book pools depth with peers, the windows cover the whole eligible set.

Trades whose settlement failed permanently are excluded, since a refused settlement is reversed and moved nothing.

## Path Parameters

<ParamField path="orderBookId" type="string" required>Order book ID.</ParamField>

## Response Fields

<ResponseField name="data" type="object">
  <Expandable>
    <ResponseField name="1h" type="object">
      <Expandable>
        <ResponseField name="volume" type="string">Base volume in order book units.</ResponseField>
        <ResponseField name="trades" type="integer">Trade count.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="24h" type="object">Same shape, over 24 hours.</ResponseField>
    <ResponseField name="7d" type="object">Same shape, over 7 days.</ResponseField>
    <ResponseField name="30d" type="object">Same shape, over 30 days.</ResponseField>
  </Expandable>
</ResponseField>

<Note>
  Volume is base quantity only. For value-weighted history use [Get Daily Stats](/endpoints/external-securities-trading/get-daily-stats), which reports both base and quote volume per day.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.trusset.org/orderbooks/external-securities/api/order-books/clx_ob_extsec_001/stats" \
    -H "X-API-Key: trusset_your_key_here"
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch(
    `https://api.trusset.org/orderbooks/external-securities/api/order-books/${orderBookId}/stats`,
    { headers: { 'X-API-Key': 'trusset_your_key_here' } }
  );
  const { data } = await res.json();
  console.log('24h volume', data['24h'].volume);
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "1h": { "volume": "10000000", "trades": 1 },
      "24h": { "volume": "40000000", "trades": 6 },
      "7d": { "volume": "215000000", "trades": 31 },
      "30d": { "volume": "884000000", "trades": 122 }
    }
  }
  ```
</ResponseExample>

## Error Codes

| Code                   | HTTP  | Cause                                                               |
| ---------------------- | ----- | ------------------------------------------------------------------- |
| `ORDER_BOOK_NOT_FOUND` | `404` | No such external securities book on this instance, and not imported |
| `SERVICE_NOT_ENABLED`  | `403` | The Trading service is not enabled on this instance                 |
