Historical.metadata.get_record_count

Get the record count of the time series data query.

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

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
1
2
3
4
5
6
7
8
9
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