Historical.metadata.get_dataset_range
Get the available range for the dataset 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 and batch.submit_job 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.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
dataset | Dataset or str | required | The dataset code (string identifier). Must be one of the values from list_datasets. |
Returns
dict[str, 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. |
end | str | The exclusive end of the available range as an ISO 8601 timestamp. |
schema | dict[str, str] | A mapping of schema names to per-schema start and end timestamps. |
API method
1 2 3
Historical.metadata.get_dataset_range(
dataset: Dataset | str,
) -> dict[str, str | dict[str, str]] Example usage
1 2 3 4 5 6 7
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
{
"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"
}
}
}