Historical.metadata.get_cost
Get the cost in US dollars for a historical streaming or batch download request. This cost respects any discounts provided by flat rate plans.
This method may not be accurate for time ranges that are not discrete multiples of 10 minutes, potentially over-reporting the cost 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 for more details.
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
float
The cost in US dollars.
API method
1 2 3 4 5 6 7 8 9
Historical.metadata.get_cost(
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,
) -> float Example usage
1 2 3 4 5 6 7 8 9 10 11 12
import databento as db
client = db.Historical("$YOUR_API_KEY")
cost = client.metadata.get_cost(
dataset="GLBX.MDP3",
symbols=["ESM2"],
schema="trades",
start="2022-06-06T00:00:00",
end="2022-06-10T12:10:00",
)
print(cost) Example response
1
2.587353944778