Cache Contents
Show what the cache currently holds, grouped by source and dataset.
The cache stores data per source, per dataset and per entity (a ticker, a country, a series identifier), which makes it possible to remove part of it rather than all of it. This method is the counterpart to clear_cache: it shows what is there so that removing something is an informed decision.
The cache is inspected regardless of whether this Toolkit was created with use_cached_data enabled, so a cache filled by an earlier session can always be reviewed.
Returns: pd.DataFrame: One row per source and dataset combination, with the number of entities, the number of stored entries and when they were written. An empty DataFrame when the cache holds nothing.
Cache Contents in Python
get_cache_contents is part of the Toolkit module of the open-source Finance Toolkit. Install it with:
pip install financetoolkit -U
Then call get_cache_contents as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(["AAPL", "MSFT"], api_key="FINANCIAL_MODELING_PREP_KEY", use_cached_data=True)
toolkit.get_historical_data()
toolkit.get_cache_contents()
Which returns:
| source | dataset | entities | entries | oldest_write | newest_write |
|---|---|---|---|---|---|
| market | historical | 3 | 3 | 2026-08-06 14:02:11 | 2026-08-06 14:02:12 |