How to Download Stock Prices into Google Spreadsheets - Finance Train: Using Yahoo Finance
You can also download the stock prices from Yahoo Finance. To do so, google spreadsheets come with a nifty function called IMPORTDATA that can be used to import data from a url in .csv/.tsv format.
To retrieve the price of Apple stock from Yahoo finance, type the following function in Google Spreadsheet:
=importdata(“http://download.finance.yahoo.com/d/quotes.csv?s=AAPL&f=sl1d1t1c1ohgv&e=.csv”)
This will download all the information about the stock in the spreadsheet, including ticker name, last trade price, volume, etc.
If you wanted historical prices, you can format your URL as below:
http://real-chart.finance.yahoo.com/table.csv?s=AAPL&d=2&e=4&f=2015&g=d&a=11&b=12&c=2000&ignore=.csv
Below is a description of the parameters:
s=AAPL is the symbol, in this case AAPL.
a=11 is the start month (0 for Jan, 1 for Feb, 2 for Mar, etc.). In our example it is December.
b=12 is the start day of the month. In our example, it is 12th.
c=2000 specifies the start year. In our case it is 2000.
So, for the historical data, the start date is 12th December, 2000.
d=2 specifies the end month. In our case it is March.
e=4 specifies the end day of the month In our example it is 4th.
f=2014 specifies the end year. For us it is 2014.
g=w represents the frequency of the data returned. (d for daily, m for monthly, w for weekly). For us, it is daily.
I hope this information will help you manage your finances better.
Friday, January 13, 2017
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment