You will always need to collect historical data on a company’s stock for any financial analysis. Yahoo Finance allows you to quickly retrieve that information at the frequency and time frame you need. If you want, you can retrieve daily details from today’s date to the time when the company first entered the stock market.
Read the article below to learn how to download historical data from Yahoo Finance.
Yahoo Finance Historical Data Download
Yahoo Finance allows you to download historical data for a company directly from its website. You can quickly recover this data without a Yahoo Finance account on your computer or phone.
From your computer
To download historical data from the Yahoo Finance website to your computer, follow these steps:
- Gonna Yahoo Finance.

- Enter a quote in the search field and then select the quote to view.

- Click “Historical Data.”

- Adjust the “Time period”, “Data to display” and “Frequency” parameters.

- Click “Apply” and then “Download” to save the data.

The file will automatically be saved to your downloads folder and will be ready for use.
From your mobile
- Gonna Yahoo Finance.

- Enter a company name or stock symbol in the “Quote Search” field.

- Tap the quote in the results to view it.

- Slide the menu to the left and select “Historical Data.”

- Change the “Time period”, “Data to display” and “Frequency” parameters.

- Tap “Apply” and “Download” to save the data to your phone.

To download Yahoo Finance historical data to your mobile, follow the steps below:
Once the download is complete, the file will be ready for use. You will need to download a spreadsheet app like Google Sheets to Android either iOS to analyze the results. You can also use Microsoft Excel to Android either iOS.
Downloading historical data from the API
Yahoo Finance allowed users to download historical data through an API. The API was closed in 2017. However, there are still unofficial APIs that do the same job. If you use one of these APIs, please note that they may violate Yahoo’s Terms of Service.
Below is the sample code that you could have used in the Yahoo Finance API and it will still work in the unofficial APIs.
Arguments
Below are the arguments you will use to create the code needed to retrieve historical data from the API:
ticker: ticker of a case-insensitive actionstart_date: date the data starts in mm/dd/yyyy formatend_date: date on which the data ends in mm/dd/yyyy formatindex_as_date: {True, False}. The default value will be True. The dates of the records will be set as an index. If false, the dates are returned in a separate column.Interval: time period to sample data. “1d” = journal; “1wk” = weekly; “1mo” = monthly
How to Download Historical Data from Yahoo Finance API
Once you have established what your arguments will be, you can create your code. Below is sample code to retrieve weekly historical data from Amazon.
from yahoo_fin.stock_info import get_data()
amazon_weekly= get_data("amzn", start_date="12/04/2009", end_date="12/04/2019", index_as_date = True, interval="1wk")
amazon_weekly
You can edit the code to include your preferred arguments and the API will retrieve the necessary historical data. When you’re ready, copy the code to the API and run it.
Please note that because the APIs are unofficial, they may not return all data or may provide inaccurate data. Since the Yahoo Finance API no longer exists, there is no way to improve it.
Download Yahoo Finance historical data for use with Excel
The Yahoo Finance website will allow you to download historical data in a CSV. You can then open this data in Excel and reformat it, including changing the file type.
From your computer
To download Yahoo Finance historical data to Excel on your computer, follow the instructions below:
- Gonna Yahoo Finance.

- Type a quote in the search field and select it from the search results to view.

- Click “Historical Data.”

- Adjust the “Time period”, “Data to display” and “Frequency” parameters.

- Click “Apply” and then “Download” to save the data as CSV.

The data will automatically download to your computer as CSV. You can open the data set and change “Save As” to an Excel spreadsheet.
From your mobile device
To download historical data from Yahoo Finance to Excel on your mobile, follow these steps:
- Gonna Yahoo Finance.

- Find the “Quote Search” field and enter a company name or stock symbol.

- Tap the quote in the search results.

- Slide the menu to the left and select “Historical Data.”

- Adjust the “Time period”, “Data to display” and “Frequency” parameters.

- Tap “Apply” and then “Download” to save the data as a CSV.

The data will automatically download to your phone as CSV. To view or change the CSV file format, you will need the Excel application of the Google Play Store for Android devices or the Apple App Store for iPhone.
Yahoo Finance: Quick Stories
Yahoo Finance makes downloading historical data quick and easy. You can download the data to your computer or phone to ensure you have the data you need when you need it most.
Have you downloaded historical data from Yahoo Finance? What method did you use? Let us know all about it in the comments below!