Historical.metadata.get_record_count
Get the record count of the time series data query.
The record count may be overstated unless the start and end are aligned to 10-minute boundaries (e.g., 12:10, not 12:15). For the definition and status schemas, the record count may be overstated unless aligned to UTC midnight.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
dataset | Dataset or str | required | The dataset code (string identifier). Must be one of the values from list_datasets. |
start | pd.Timestamp, datetime, date, str, or int | required | The inclusive start of the request range. Takes pd.Timestamp, Python datetime, Python date, ISO 8601 string, or UNIX timestamp 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, Python datetime, Python date, ISO 8601 string, or UNIX timestamp in nanoseconds. Assumes UTC as timezone unless otherwise specified. Defaults to the forward filled 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. Must be one of the values from list_schemas. |
stype_in | SType or str, default 'raw_symbol' | optional | The symbology type 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 record count.
API method
Historical.metadata.get_record_count(
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 Example usage
1 2 3 4 5 6 7 8 9 10 11
import databento as db
client = db.Historical("$YOUR_API_KEY")
count = client.metadata.get_record_count(
dataset="GLBX.MDP3",
symbols=["ESM2"],
schema="mbo",
start="2022-01-06",
)
print(count) Example response
1
1329107