cancel
Showing results for 
Search instead for 
Did you mean: 
Cancel

Help Community

Announcements
Yahoo Help Community is also available in Spanish and Chinese.

Importing stock prices to EXCEL

'Hoo Recruit

Re: Importing stock prices to EXCEL


qupola wrote:

I'd like to point out that the columns that appear and their order are controlled by the list of parameters following the f= in the text query, between the ampersands.  Google on "canbike csv" for a good description of what keycodes you can use after the f= to pull in different columns of data.  That CANbike webpage features a list of keycodes for grabbing other kinds of financial data via the Yahoo comma delimeted file API as well. I've not found them as well documented elsewhere.

 

Also note that it's actually possible to pare things down to just retrieve the ticker symbol and last price with a

&f=sl1&e=.csv

 

after your list of stock tickers at the end of your query.  You can change the order of the columns retrieved, using 

&f=l1s&e=.csv

instead.

 

My link was just using &f=sl1d1t1c1ohgv&e=.csv for a default list of financial info, but you can add, drop, or reorder the columns retrieved as needed (as long as you have an associated keycode for that data).

 

I also found that one can use https instead of http, like so, using stock tickers and the f= parameters from my earlier post as an example:

 

https://download.finance.yahoo.com/d/quotes.csv?s=AAPL,GOOG,YHOO&f=sl1d1t1c1ohgv&e=.csv

 

Hope this helps!


I have been using a java program for years to download multple symbol multiple date ranges and suddenly it stopped working.  As mentioned above simply changing from http to https made it work again.  Try it you'll like it.

'Hoo Recruit

Re: Importing stock prices to EXCEL

Just when I thought it would work Yahoo has completely changed their historical quotes URL format to look something like this.

 

"h**ps://query1.finance.yahoo.com/v7/finance/download/GLD?period1=1........5&period2=2........6&interval=1d&events=history&crumb=cOk9QwFZpRj"

 

I wish someone from Yahoo would respond to this to tell us how to get this data programmatically.

Pro 'Hoo

Re: Importing stock prices to EXCEL

Same issue. Data export only exports preset columns


drbrake wrote:

Same problem

also the export data function only exports one view no matter what view you have selected.

thought I could have a work around until the query thing is fixed??


 

'Hoo Recruit

Re: Importing stock prices to EXCEL

My Stock spreadsheet worked great for a long time now it doesn't import from Yahoo anymore either.  Not good.

Pro 'Hoo

Re: Importing stock prices to EXCEL

Could you tell me where I can download the java program from?

Pro 'Hoo

Re: Importing stock prices to EXCEL


TheWizEd wrote:

qupola wrote:

I'd like to point out that the columns that appear and their order are controlled by the list of parameters following the f= in the text query, between the ampersands.  Google on "canbike csv" for a good description of what keycodes you can use after the f= to pull in different columns of data.  That CANbike webpage features a list of keycodes for grabbing other kinds of financial data via the Yahoo comma delimeted file API as well. I've not found them as well documented elsewhere.

 

Also note that it's actually possible to pare things down to just retrieve the ticker symbol and last price with a

&f=sl1&e=.csv

 

after your list of stock tickers at the end of your query.  You can change the order of the columns retrieved, using 

&f=l1s&e=.csv

instead.

 

My link was just using &f=sl1d1t1c1ohgv&e=.csv for a default list of financial info, but you can add, drop, or reorder the columns retrieved as needed (as long as you have an associated keycode for that data).

 

I also found that one can use https instead of http, like so, using stock tickers and the f= parameters from my earlier post as an example:

 

https://download.finance.yahoo.com/d/quotes.csv?s=AAPL,GOOG,YHOO&f=sl1d1t1c1ohgv&e=.csv

 

Hope this helps!


I have been using a java program for years to download multple symbol multiple date ranges and suddenly it stopped working.  As mentioned above simply changing from http to https made it work again.  Try it you'll like it.


Could you tell me where to download the Java program from?

'Hoo Recruit

Re: Importing stock prices to EXCEL

Its something I made using NetBeans IDE.  It uses:

 

in = new BufferedReader(new InputStreamReader(url.openStream()));

url was a link to the yahoo ichart.finance.yahoo.com

in used to contain a date range of stock data.  Now its empty.

New 'Hoo

Re: Importing stock prices to EXCEL

This may be a case of OBE, but I had the same issue when Yahoo agreed to their purchase by Verizon. I was able to convert my visual basic script I use in Excel to Google finance stock data download. I have more confidence in Google anyway and have found I don't have to wait as long in the evening before that day's data is available. Anyway here is the revised line of code:

qurl = "*Link Removed - See the community guidelines for more information.*" & stockTicker
qurl = qurl & "&startdate=" & MonthName(Month(StartDate), True) & _
"+" & Day(StartDate) & "+" & Year(StartDate) & _
"&enddate=" & MonthName(Month(EndDate), True) & _
"+" & Day(EndDate) & "+" & Year(EndDate) & "&output=csv"

 

I have an excel spreadsheet that can download data for any number of stocks for any time period desired. If anyone would like a copy I'll be happy to send it out.

New 'Hoo

Re: Importing stock prices to EXCEL


jabcsmith wrote:

This may be a case of OBE, but I had the same issue when Yahoo agreed to their purchase by Verizon. I was able to convert my visual basic script I use in Excel to Google finance stock data download. I have more confidence in Google anyway and have found I don't have to wait as long in the evening before that day's data is available. Anyway here is the revised line of code:

qurl = "*Link Removed - See the community guidelines for more information.*" & stockTicker
qurl = qurl & "&startdate=" & MonthName(Month(StartDate), True) & _
"+" & Day(StartDate) & "+" & Year(StartDate) & _
"&enddate=" & MonthName(Month(EndDate), True) & _
"+" & Day(EndDate) & "+" & Year(EndDate) & "&output=csv"

 

I have an excel spreadsheet that can download data for any number of stocks for any time period desired. If anyone would like a copy I'll be happy to send it out.


Hi, I had a program that was working and now doesnt. I would be grateful to take you up on that offer if you dont mind sharing. JasonJFournier at yahoo. Cheers

 
 
 
New 'Hoo

Re: Importing stock prices to EXCEL

Hi jabcsmith,

Came across your response and thought it would potentially helpful regarding this issue. However, yahoo blocked the url link info you provided. Can you send me that url link  so I may test if it will work for what I'm trying to do?

 

Thank you,

Rey del