Downloading multiple stocks at once from Yahoo Finance

Updated as of 2021-01-19 At this time, the implementation in the OP works without issue, to download multiple stocks. Version: 0.9.0 Date: July 10, 2020 GitHub: pydata / pandas-datareader tickers = [‘msft’, ‘aapl’, ‘intc’, ‘tsm’, ‘goog’, ‘amzn’, ‘fb’, ‘nvda’] df = pdr.DataReader(tickers, data_source=”yahoo”, start=”2017-01-01″, end=’2020-09-28′) Original Answer If you read through Pandas DataReader’s documentation, they … Read more

Yahoo Finance API changes (2017)

First, the old Yahoo finance iChart download is gone for good. In one of the forum posts, a Yahoo employee has confirmed that the free EOD data has been terminated, and will not be reintroduced. Check out this thread and look for reply from Nixon. Yahoo is recently acquired by Verizon, and it must be … Read more

Download history stock prices automatically from yahoo finance in python

When you’re going to work with such time series in Python, pandas is indispensable. And here’s the good news: it comes with a historical data downloader for Yahoo: pandas.io.data.DataReader. from pandas.io.data import DataReader from datetime import datetime ibm = DataReader(‘IBM’, ‘yahoo’, datetime(2000, 1, 1), datetime(2012, 1, 1)) print(ibm[‘Adj Close’]) Here’s an example from the pandas … Read more

Yahoo Finance Historical data downloader url is not working

I recently wrote a simple python script to download the history of a single stock. Here an example how to invoke it: python get_quote_history.py –symbol=IBM –from=2017-01-01 –to=2017-05-25 -o IBM.csv This will download IBM historical prices from 2017-01-01 to 2017-05-25 and save them in IBM.csv file. import re import urllib2 import calendar import datetime import getopt … Read more

“TypeError: string indices must be integers” when getting data of a stock from Yahoo Finance using Pandas Datareader

None of the solutions reported here so far worked for me. As per the discussion here Yahoo made changes to their API that broke compatibility with previous pandas datareader versions. In the same Github thread a fix is reported, implemented in a pull request from Github user raphi6. I confirmed the pull request works fine. … Read more

Can’t download data from Yahoo Finance using Quantmod in R

The price history csv URL’s appear to have changed Old https://chart.finance.yahoo.com/table.csv?s=AAPL&a=2&b=17&c=2017&d=3&e=17&f=2017&g=d&ignore=.csv New: https://query1.finance.yahoo.com/v7/finance/download/AAPL?period1=1492438581&period2=1495030581&interval=1d&events=history&crumb=XXXXXXX The new version appends a “crumb” field which appears to reflect cookie information in the user’s browser. It seems they are intentionally blocking automated downloads of price histories and forcing queries to provide information to validate cookies in a web browser

Has Yahoo finance web service disappeared? API changed? Down temporarily?

I was facing a similar issue from last 2-3 days. The url works on the smartphone, where on the desktop it gives “Not a valid parameter” error and HTTP Code 406. This can be resolved by adding user agent as “Mozilla/5.0 (Linux; Android 6.0.1; MotoG3 Build/MPI24.107-55) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Mobile Safari/537.36” while invoking … Read more

Yahoo Finance URL not working

Yahoo has gone to a Reactjs front end which means if you analyze the request headers from the client to the backend you can get the actual JSON they use to populate the client side stores. Hosts: query1.finance.yahoo.com HTTP/1.0 query2.finance.yahoo.com HTTP/1.1 (difference between HTTP/1.0 & HTTP/1.1) If you plan to use a proxy or persistent … Read more