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

# Volume

> Query bucketed trade volume with client.volume()

Use `client.volume()` when you need bucketed trade volume data for volume profiling and participation analysis. This method aggregates traded volume over fixed time intervals.

## Method signature

```python theme={null}
volume(source, market, from_, to, interval, limit=1000)
```

## Parameters

| Parameter | Type                  | Required | Notes                                                                  |
| --------- | --------------------- | -------- | ---------------------------------------------------------------------- |
| source    | str                   | Yes      | Source ID                                                              |
| market    | str                   | Yes      | Normalized market or instrument ID                                     |
| from\_    | str/datetime/date/int | Yes      | Inclusive start time (ISO 8601, datetime, date, or epoch microseconds) |
| to        | str/datetime/date/int | Yes      | Exclusive end time (same formats as from\_)                            |
| interval  | str                   | Yes      | Duration token such as `1m`, `5m`, `1h`                                |
| limit     | int                   | No       | Page size (default: 1000)                                              |

**Note:** API key required for historical ranges. Set `POLARIS_API_KEY` environment variable or pass `api_key` to `PolarisClient()`.

## Return value

List of bucketed volume series rows.

## Example response

```python theme={null}
[
    {
        'timestamp': 1704067200000000,
        'venue': 'binance',
        'symbol': 'BTC-USDT',
        'volume': 125.5,
        'interval': '1m'
    }
]
```

## Fields

Volume records include:

* `timestamp`: bucket start time in UTC microseconds since the Unix epoch
* `venue`: exchange identifier
* `symbol`: normalized instrument symbol
* `volume`: total traded base volume for the interval
* `interval`: duration token such as `1m`, `5m`, or `1h`

## Example

```python theme={null}
from datetime import datetime, timedelta, timezone
from polaris_data import PolarisClient

end = datetime.now(timezone.utc)
start = end - timedelta(hours=6)

with PolarisClient() as client:
    vol_data = client.volume(
        source="hyperliquid",
        market="SPX",
        from_=start,
        to=end,
        interval="5m",
    )

print(vol_data[:2])
```

## How it works

`client.volume()` aggregates volume from standardized trade data using snapshot-first replay. The SDK queries the `/snapshots` endpoint for historical data, reads from local cached files when available, and derives bucketed volumes from the underlying trade events.

For more details on snapshot-based queries, see [Snapshots](/reference/snapshots).

## Related documentation

* [OHLCV](/sdks/ohlcv) if you need volume alongside OHLC price data
* [Trades](/sdks/trades) if you need execution-level data instead of buckets
* [Authentication](/guides/authentication)
