Yahoo Finance Historical Data Scraper avatar

Yahoo Finance Historical Data Scraper

Pricing

$0.60 / 1,000 results

Go to Apify Store
Yahoo Finance Historical Data Scraper

Yahoo Finance Historical Data Scraper

Get detailed historical price, volume data, company profiles, dividends, splits and events from Yahoo Finance for multiple stocks and custom date ranges.

Pricing

$0.60 / 1,000 results

Rating

0.0

(0)

Developer

Eray Diler

Eray Diler

Maintained by Community

Actor stats

1

Bookmarked

39

Total users

11

Monthly active users

8 days ago

Last modified

Share

This Apify actor scrapes historical stock data from Yahoo Finance for one or more specified ticker symbols and a defined period.

Features

  • Fetches historical daily stock data including Open, High, Low, Close, Adjusted Close, and Volume.
  • Extracts dividend and stock split events from the same Yahoo Finance history table.
  • Extracts company profile data including Sector, Industry, and Business Summary.
  • Retrieves upcoming events (like earnings dates) and recent events (like SEC filings and dividend dates).
  • Supports multiple ticker symbols in a single run.
  • Allows specifying the time period (e.g., 5 days, 1 month, 5 years) of historical data to retrieve.
  • Outputs typed items in a structured JSON format to the Apify dataset.
  • Includes the ticker symbol in each data record for easy identification.

Input

The actor uses an input schema to define the parameters you can set when running it. You can provide these inputs via the Apify Console, API, or a local INPUT.json file.

Input Schema Fields:

  • symbols (Array of strings)

    • Title: Stock Ticker Symbols
    • Description: Enter one or more stock ticker symbols.
    • Example: ["AAPL", "TSLA"]
    • Default Value: ["AAPL"]
    • Required: Yes
  • dateRange (String)

    • Title: Date Range
    • Description: The time period for the historical data. Supports days (d), weeks (w), months (m), years (y), and max for all available data.
    • Example: "5d", "2w", "1m", "1y", "max"
    • Default Value: "1y"
    • Required: Yes
  • includeDividends (Boolean)

    • Description: Include dividend events from the history table.
    • Default Value: true
  • includeSplits (Boolean)

    • Description: Include stock split events from the history table.
    • Default Value: true
  • includeProfile (Boolean)

    • Description: Include company profile data (Sector, Industry, Summary, Recent Events).
    • Default Value: true
  • includeEvents (Boolean)

    • Description: Scrape paginated recent events from the profile page.
    • Default Value: false
  • generateUnifiedOutput (Boolean)

    • Description: If enabled, creates an additional UNIFIED_OUTPUT.json in the Key-Value store grouping all events by symbol.
    • Default Value: true

Example INPUT.json:

{
"symbols": ["MSFT", "GOOG"],
"dateRange": "1m",
"includeDividends": true,
"includeSplits": false,
"includeProfile": true,
"includeEvents": false,
"generateUnifiedOutput": true
}

Output

The actor stores its results in two ways:

  1. Flat Dataset (Default): The default Apify Dataset. Items are typed and may represent either historical OHLCV rows or corporate action events.
  2. Unified Output (Key-Value Store): If generateUnifiedOutput is true (default), a single JSON array is saved as UNIFIED_OUTPUT.json in the Key-Value store, grouping all events by symbol.

1. Flat Dataset Examples

Example History Item (JSON):

{
"type": "history",
"date": "May 30, 2025",
"open": 170.50,
"high": 172.30,
"low": 170.10,
"close": 171.95,
"adjClose": 171.95,
"volume": 25000000,
"symbol": "AAPL"
}

Example Dividend Item (JSON):

{
"type": "dividend",
"date": "May 10, 2025",
"amount": 0.25,
"symbol": "AAPL"
}

Example Split Item (JSON):

{
"type": "split",
"date": "Aug 31, 2020",
"ratio": "4:1",
"symbol": "AAPL"
}

Example Profile Item (JSON):

{
"type": "profile",
"symbol": "AAPL",
"sector": "Technology",
"industry": "Consumer Electronics",
"summary": "Apple Inc. designs, manufactures, and markets smartphones, personal computers, tablets, wearables, and accessories worldwide...",
"upcomingEvents": [
{
"date": "July 30, 2026 at 11:00 PM GMT+3",
"name": "Apple Inc. Earnings Date"
}
],
"recentEvents": [
{
"date": "May 28, 2026 at 3:00 AM GMT+3",
"name": "SD: Specialized Disclosure Report filed pursuant to Section 1502..."
}
]
}

2. Unified Output Example (UNIFIED_OUTPUT.json)

[
{
"symbol": "AAPL",
"profile": {
"sector": "Technology",
"industry": "Consumer Electronics",
"summary": "Apple Inc. designs..."
},
"history": [
{ "date": "May 30, 2025", "open": 170.50, "high": 172.30, "low": 170.10, "close": 171.95, "adjClose": 171.95, "volume": 25000000 }
],
"dividends": [
{ "date": "May 10, 2025", "amount": 0.25 }
],
"splits": [
{ "date": "Aug 31, 2020", "ratio": "4:1" }
]
}
]

Usage

To use this scraper, simply provide your input parameters in the Apify Console and click "Start". You can integrate this actor into your own workflows using the Apify API or Apify Client libraries.

Providing Input

  1. Navigate to the Actor's page on the Apify Store.
  2. Fill in the "Input" tab or switch to the "JSON" view to provide your parameters.
  3. Click "Start" to run the actor.
  4. Once the run is finished, you can find the results in the "Dataset" tab of the run. You can download the data in various formats (JSON, CSV, Excel, etc.).

Limitations

  • The scraper relies on Yahoo Finance's website structure. Significant changes to the Yahoo Finance website may break the actor.
  • Fetching very long periods (e.g., 30+ years) for multiple tickers might lead to long run times and increased resource consumption.
  • The actor does not currently handle pagination for extremely long historical data requests if Yahoo Finance were to implement it differently (currently, it loads all requested data on one page via URL parameters).
  • Cookie consent pop-ups are handled based on common selectors; if Yahoo changes its consent mechanism drastically, it might require an update.

TODO / Roadmap

  • Add earnings data and earnings calendar details.
  • Expand quote output with richer company and market stats.
  • Add company profile data such as sector, industry, and summary.
  • Add financial statements: income statement, balance sheet, and cash flow.
  • Add analyst recommendations and ratings.
  • Add institutional holders and ownership data.
  • Add options chain data with expiration dates.
  • Offer a unified per-symbol output format in addition to typed dataset items.
  • Improve output schema and README examples to document all returned fields.

📦 About

Created by Eray Diler for StrategyLab.