Returns intraday historical data for the specified tickers. This contains the following columns:

  • Open: The opening price for the period.
  • High: The highest price for the period.
  • Low: The lowest price for the period.
  • Close: The closing price for the period.
  • Volume: The volume for the period.
  • Return: The return for the period.
  • Cumulative Return: The cumulative return for the period.

Volatility is not included here. This is available as a dedicated calculation in the Risk module instead (e.g. toolkit.risk.get_volatility).

Keep in mind that this data is available for a shorter period. This means that the start date is ignored if the difference between the start and end date is bigger than the maximum period.

If a benchmark ticker is selected, it also calculates the benchmark ticker together with the results. By default this is set to “SPY” (S&P 500 Index) but can be any ticker. This is relevant for calculations for models such as CAPM, Alpha and Beta.

Please note that this functionality is only available through Financial Modeling Prep. Therefore, an api_key is required to use this functionality.

Also known as: tick data, minute data, intraday price history.

Intraday Data in Python

get_intraday_data is part of the Toolkit module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_intraday_data as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit("MSFT", api_key="FINANCIAL_MODELING_PREP_KEY")

toolkit.get_intraday_data(period="1min")

Which returns:

date Open High Low Close Volume Return Cumulative Return
2024-01-19 15:45 397.64 397.88 397.63 397.88 49202 0.0006 1.0266
2024-01-19 15:46 397.86 397.93 397.788 397.82 68913 -0.0002 1.0264
2024-01-19 15:47 397.81 397.97 397.76 397.78 62605 -0.0001 1.0263
2024-01-19 15:48 397.78 397.85 397.675 397.845 62146 0.0002 1.0265
2024-01-19 15:49 397.85 397.97 397.8 397.94 72700 0.0002 1.0267
2024-01-19 15:50 397.92 398.27 397.9 398.04 140754 0.0003 1.027
2024-01-19 15:51 398.04 398.15 397.96 398 122208 -0.0001 1.0269
2024-01-19 15:52 397.99 398.26 397.98 398.05 83546 0.0001 1.027
2024-01-19 15:53 398.04 398.12 397.98 398.09 85098 0.0001 1.0271
2024-01-19 15:54 398.1 398.52 398.03 398.45 187358 0.0009 1.028
2024-01-19 15:55 398.45 398.62 398.25 398.335 237902 -0.0003 1.0278
2024-01-19 15:56 398.33 398.44 398.3 398.415 149157 0.0002 1.028
2024-01-19 15:57 398.42 398.5 398.29 398.43 181074 0 1.028
2024-01-19 15:58 398.46 398.47 398.29 398.35 278802 -0.0002 1.0278
2024-01-19 15:59 398.35 398.66 398.22 398.66 586344 0.0008 1.0286

Parameters

get_intraday_data accepts the following parameters:

  • period (str, optional): The intraday interval to fetch (e.g. “1min”, “5min”, “1hour”). Defaults to “1hour”.
  • return_column (str, optional): The column to use for the return calculation. Defaults to “Close”.
  • fill_nan (bool, optional): Defines whether to forward fill NaN values. Defaults to True.
  • rounding (int | None, optional): Defines the number of decimal places to round the data to. Defaults to None.
  • show_columns (list[str] | None): A list of column names to keep in the result. Invalid names are reported and ignored. Defaults to None, which keeps every column.
Share