Yahoo Finance Historical Data Scraper
by eraydiler
Easily scrape historical stock prices and volume from Yahoo Finance for multiple tickers and custom date ranges. Perfect for backtesting, financial analysis, and building datasets.
Opens on Apify.com
About Yahoo Finance Historical Data Scraper
Need historical stock data for your analysis or app? I've been using this Yahoo Finance scraper to pull clean price and volume history for years. It saves you the headache of building and maintaining your own scraper against Yahoo's structure, which can be a real pain when they tweak their layout. You just feed it a list of ticker symbols and specify your date range—whether you need a decade of daily closes or just the last quarter. It handles multiple stocks in a single run, returning structured JSON or CSV with open, high, low, close, adjusted close, and volume data. I use it regularly to backtest trading strategies, populate financial models, and create datasets for machine learning projects. It's reliable, gets the job done without fuss, and lets you focus on your actual work instead of data collection. If you're a developer, analyst, or researcher looking for a straightforward way to get market history, this actor is a solid choice.
What does this actor do?
Yahoo Finance Historical Data Scraper is a web scraping and automation tool available on the Apify platform. It's designed to help you extract data and automate tasks efficiently in the cloud.
Key Features
- Cloud-based execution - no local setup required
- Scalable infrastructure for large-scale operations
- API access for integration with your applications
- Built-in proxy rotation and anti-blocking measures
- Scheduled runs and webhooks for automation
How to Use
- Click "Try This Actor" to open it on Apify
- Create a free Apify account if you don't have one
- Configure the input parameters as needed
- Run the actor and download your results
Documentation
Yahoo Finance Historical Data Scraper
This Apify actor scrapes daily historical stock data from Yahoo Finance for one or more ticker symbols over a specified period.
Overview
The actor fetches daily stock metrics—Open, High, Low, Close, Adjusted Close, and Volume—for given ticker symbols. It outputs structured JSON records to an Apify dataset, with each record tagged by its symbol for easy identification. You can run it locally or on the Apify platform.
Key Features
- Fetches historical daily stock data (Open, High, Low, Close, Adjusted Close, Volume).
- Supports multiple ticker symbols in a single run.
- Configurable date range via
yearsOfDatainput (1-50 years). - Outputs clean JSON to the default Apify Dataset.
- Handles common cookie consent pop-ups.
Input
Configure the actor using an INPUT.json file or via the Apify Console/API.
Input fields:
- tickerSymbols (Array of strings, required): Stock ticker symbols (e.g., ["AAPL", "MSFT"]). Default is ["^GSPC"].
- yearsOfData (Integer, required): Number of years of historical data to fetch. Min: 1, Max: 50. Default is 1.
Example INPUT.json:
{
"tickerSymbols": ["MSFT", "GOOG"],
"yearsOfData": 3
}
Output
Results are stored in the Apify dataset. Each item is a JSON object for one day of data.
Example output item:
{
"date": "May 30, 2025",
"open": 170.50,
"high": 172.30,
"low": 170.10,
"close": 171.95,
"adjClose": 171.95,
"volume": 25000000,
"symbol": "AAPL"
}
Output fields: date, open, high, low, close, adjClose, volume, symbol.
How to Use
Running Locally
- Ensure Node.js and npm are installed.
- Clone the project and install dependencies:
npm install. - Optionally, place your
INPUT.jsonfile atapify_storage/key_value_stores/default/INPUT.json. - Run the actor:
apify run(useapify run --purgeto clear previous storage).
Running on Apify Platform
- Push the actor to your Apify account:
apify push. - On the platform, find your actor and click "Run".
- Provide input parameters in the "Input" tab.
- Start the run. Results will be available in the run's "Dataset" tab, downloadable as JSON, CSV, Excel, etc.
Limitations
- Relies on Yahoo Finance's website structure; significant changes may break the actor.
- Fetching long periods (e.g., 30+ years) for multiple tickers can increase run time and resource use.
- Does not handle pagination if Yahoo Finance changes its data loading method.
- Cookie consent handling is based on common selectors; major changes to Yahoo's consent mechanism may require updates.
Support
For issues or suggestions, open an issue on GitHub or contact eray.diler@gmail.com.
Categories
Common Use Cases
Market Research
Gather competitive intelligence and market data
Lead Generation
Extract contact information for sales outreach
Price Monitoring
Track competitor pricing and product changes
Content Aggregation
Collect and organize content from multiple sources
Ready to Get Started?
Try Yahoo Finance Historical Data Scraper now on Apify. Free tier available with no credit card required.
Start Free TrialActor Information
- Developer
- eraydiler
- Pricing
- Paid
- Total Runs
- 175
- Active Users
- 13
Related Actors
Web Scraper
by apify
Cheerio Scraper
by apify
Website Content Crawler
by apify
Legacy PhantomJS Crawler
by apify
Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.
Learn more about ApifyNeed Professional Help?
Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.
Trusted by millions | Money-back guarantee | 24/7 Support