Source: https://databento.com/docs/api-historical/metadata/metadata-get-billable-size



### Historical.metadata.get\_billable\_size

Get the billable uncompressed raw binary size for historical streaming or batched files.

This method may not be accurate for time ranges that are not discrete multiples of 10 minutes, potentially over-reporting the size in such cases. The definition schema is only accurate for discrete multiples of 24 hours.

> **Info**
>
> The amount billed will be based on the actual amount of bytes sent; see our [pricing documentation](https://databento.com/docs/faqs/usage-pricing-and-data-credits.md) for more details.

#### API method

```python
Historical.metadata.get_billable_size(
    dataset: Dataset | str,
    start: pd.Timestamp | datetime | date | str | int,
    end: pd.Timestamp | datetime | date | str | int | None = None,
    symbols: Iterable[str | int] | str | int | None = None,
    schema: Schema | str = "trades",
    stype_in: Stype | str = "raw_symbol",
    limit: int | None = None,
) -> int
```

#### Parameters

| Parameter | Type | Required | Description |
| `dataset` | Dataset or str | required | The [dataset](https://databento.com/docs/api-historical/basics/datasets.md) code (string identifier). Must be one of the values from [list\_datasets](https://databento.com/docs/api-historical/metadata/metadata-list-datasets.md). |
| `start` | pd.Timestamp, datetime, date, str, or int | required | The inclusive start of the request range. Takes [pd.Timestamp](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Timestamp.html), [Python datetime](https://docs.python.org/3/library/datetime.html#datetime-objects), [Python date](https://docs.python.org/3/library/datetime.html#date-objects), [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) string, or [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) in nanoseconds. Assumes UTC as timezone unless otherwise specified. |
| `end` | pd.Timestamp, datetime, date, str, or int | optional | The exclusive end of the request range. Takes [pd.Timestamp](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Timestamp.html), [Python datetime](https://docs.python.org/3/library/datetime.html#datetime-objects), [Python date](https://docs.python.org/3/library/datetime.html#date-objects), [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) string, or [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) in nanoseconds. Assumes UTC as timezone unless otherwise specified. Defaults to the [forward filled](https://databento.com/docs/conventions/common-fields-enums-types.md#forward-filling-end-parameters) value of `start` based on the resolution provided. |
| `symbols` | Iterable[str \ | int] or str or int | optional | The product symbols to filter for. Takes up to 2,000 symbols per request. If `'ALL_SYMBOLS'` or `None` then will select **all** symbols. |
| `schema` | Schema or str, default 'trades' | optional | The data record [schema](https://databento.com/docs/schemas/whats-a-schema.md). Must be one of the values from [list\_schemas](https://databento.com/docs/api-historical/metadata/metadata-list-schemas.md). |
| `stype_in` | SType or str, default 'raw_symbol' | optional | The [symbology type](https://databento.com/docs/api-historical/basics/symbology.md) of input `symbols`. Must be one of 'raw_symbol', 'instrument_id', 'parent', or 'continuous'. |
| `limit` | int | optional | The maximum number of records to return. If `None` then no limit. |

#### Returns

`int`

The size in number of bytes used for billing.

#### Example usage

```python
import databento as db

client = db.Historical("$YOUR_API_KEY")

size = client.metadata.get_billable_size(
    dataset="GLBX.MDP3",
    symbols=["ESM2"],
    schema="trades",
    start="2022-06-06T00:00:00",
    end="2022-06-10T12:10:00",
)
print(size)
```
#### Example response

```plaintext
99219648
```
