Available languages: [Python](https://databento.com/docs/api-historical/metadata/metadata-get-dataset-range.python.md) · [C++](https://databento.com/docs/api-historical/metadata/metadata-get-dataset-range.cpp.md) · [Rust](https://databento.com/docs/api-historical/metadata/metadata-get-dataset-range.rust.md) · [HTTP](https://databento.com/docs/api-historical/metadata/metadata-get-dataset-range.http.md)

Source: https://databento.com/docs/api-historical/metadata/metadata-get-dataset-range



### Historical.metadata.get_dataset_range

Get the available range for the [dataset](https://databento.com/docs/api-historical/basics/datasets.md) given the user's entitlements.

Use this method to discover data availability.
The `start` and `end` values in the response can be used with the [timeseries.get_range](https://databento.com/docs/api-historical/timeseries/timeseries-get-range.md) and [batch.submit_job](https://databento.com/docs/api-historical/batch/batch-submit-job.md) endpoints.

This endpoint will return the `start` and `end` timestamps over the entire dataset as well as the per-schema `start` and `end` timestamps under the `schema` key.
In some cases, a schema's availability is a subset of the entire dataset availability.

#### API method

```python
Historical.metadata.get_dataset_range(
    dataset: Dataset | str,
) -> dict[str, str | dict[str, dict[str, str]]]
```

#### 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). |

#### Returns

`dict[str, str | dict[str, dict[str, str]]]`

The available range for the dataset.

| Field | Type | Description |
| `start` | str | The inclusive start of the available range as an [ISO 8601 timestamp](https://www.iso.org/iso-8601-date-and-time-format.html). |
| `end` | str | The exclusive end of the available range as an [ISO 8601 timestamp](https://www.iso.org/iso-8601-date-and-time-format.html). |
| `schema` | dict[str, dict[str, str]] | A mapping of schema names to per-schema `start` and `end` timestamps. |

#### Example usage

```python
import databento as db

client = db.Historical("$YOUR_API_KEY")

available_range = client.metadata.get_dataset_range(dataset="XNAS.BASIC")

print(available_range)
```
#### Example response

```json
{
    "start":"2018-05-01T00:00:00.000000000Z",
    "end":"2025-01-30T00:00:00.000000000Z",
    "schema": {
        "mbo": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        },
        "mbp-1": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        },
        "mbp-10": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        },
        "bbo-1s": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        },
        "bbo-1m": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        },
        "tbbo": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        },
        "trades": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        },
        "ohlcv-1s": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        },
        "ohlcv-1m": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        },
        "ohlcv-1h": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        },
        "ohlcv-1d": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        },
        "definition": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        },
        "statistics": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        },
        "status": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        },
        "imbalance": {
            "start":"2018-05-01T00:00:00.000000000Z",
            "end":"2025-01-30T00:00:00.000000000Z"
        }
    }
}
```
