Parameters
Ticker symbol (e.g., ‘AAPL’, ‘MSFT’). Must be a valid stock symbol.
Time period to retrieve. Valid values include:
1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max
start and end parameters.Data interval/granularity. Valid values include:
1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo
1d (daily).Start date for the historical data (format: YYYY-MM-DD). Use with
end instead of period.End date for the historical data (format: YYYY-MM-DD). Use with
start instead of period.Automatically adjust OHLC (Open, High, Low, Close) data for splits and dividends. Default is
true.Include dividend and split events in the data. Default is
false.Include pre-market and post-market trading data. Default is
false. Only available for intraday intervals.Repair bad data (missing values, outliers) using yfinance’s repair logic. Default is
false.Keep rows with NaN values instead of dropping them. Default is
false.Format of the response:
json(default): Return structured JSON datamarkdown: Return formatted markdown table
Number of rows to include in markdown preview. Must be between 1 and 200. Default is 25.
Save the result to a file:
format: Eithercsvorjsonfilename(optional): Custom filename (defaults toyf_ticker_history-{timestamp}.{format})
Example Usage
Get 1 year of daily data
Get historical data with custom date range
Get intraday data with pre/post market
Get data with dividend and split actions
Get all-time data and save to CSV
Get data with repair and keep NaN values
Response Format
JSON Response (default)
The response contains adata field with the historical data and an optional saved_path:
With Actions
Whenactions is true, the response includes additional columns:
Markdown Response
Whenresponse_format is set to markdown:
Notes
- Use
periodfor relative time ranges orstart/endfor absolute dates, but not both - Intraday intervals (1m, 5m, etc.) have limited historical availability (typically 1-60 days)
- The
prepostparameter only works with intraday intervals - The
auto_adjustparameter is recommended for price continuity across corporate actions - The
repairoption can fix common data quality issues like missing values or outliers - When
keepnaisfalse, rows with missing data are automatically removed