Yahoo! Finance CSV file will not return Dow Jones (^DJI)
Asked Answered
B

8

41

I am trying to retrieve market data from Yahoo! finance and the script has worked fine for years, but recently, it stopped showing The Dow Jones data. Here is the URL:

http://download.finance.yahoo.com/d/quotes.csv?s=^DJI,^IXIC,^GSPC,^TNX&f=snl1d1t1c1ohg

The URL should return data on:

  • Dow Jones
  • NASDAQ
  • S&P
  • 10 Year Bonds

It actually doesn't get returned into the CSV for me, I have tried everything I can think of, but to no avail, and I haven't seen anyone having the same problem online.

Any ideas and is anyone having the same issues?

Thanks.

Borderline answered 9/9, 2010 at 19:25 Comment(1)
Yahoo! Help says "If you cannot download data for the Dow Jones Industrial Average, it is because Yahoo! is no longer licensed to provide data downloads for the Dow Jones Index. At this time, Dow Jones Industrial Average [^DJI] data can only be viewed on the screen. It can no longer be downloaded."Quadrillion
F
32

Replace ^DJI with INDU (that's one of the tickers for the Dow) - that will work.

No idea why ^DJI stopped working last weekend - someone has made a 'negative enhancement'.

Cheerio

GT

Frigidaire answered 9/9, 2010 at 21:56 Comment(3)
@GT, nice! I've been searching for an answer this since late August.Teratoid
You should also look at YQL, which is the new way to access this data. You can find an example here: jarloo.com/tutorials/get-yahoo-finance-api-data-via-yqlIliac
No Option is working tried all options mentioned on this pageJaella
F
26

According to Yahoo at:

http://developer.yahoo.net/forum/index.php?showtopic=6943

Thank you for writing to Yahoo! Finance. I understand you're reporting that you cannot download CSV data for ^DJI. I can certainly give you more information about this. The limitation you are encountering is due to restrictions by the Dow Jones Index. Yahoo! is no longer able to provide Dow Jones Index data in this manner. I apologize for any inconvenience caused. Please let me know if I can be of further assistance. Thank you again for contacting Yahoo! Finance. Regards, Brett Yahoo! Finance Customer Care

The other post that suggests using INDU does seem to work!... Wonder if Yahoo (or Dow Jones) just missed this one and it will eventually go away...

Felecia answered 10/9, 2010 at 2:53 Comment(0)
I
8

I know this question has been answered some time ago but I've recently run into this ^DJI and Yahoo! quotes issue again due to another change at Yahoo! and have come up with a solution that might help the OP and anyone else who reaches this page as a result of a search.

As a bit of background please note that there's several URL's that may conceivably be used to download historical quote data from Yahoo. They are:

1) http://download.finance.yahoo.com/d/quotes.csv

2) http://ichart.finance.yahoo.com/table.csv

3) http://finance.yahoo.com/q/hp

1) is the one the OP listed, 2) is effectively the "download" link that you get below the web page display of quotes and 3) is the normal historical price quote webpage URL.

It turns out that while 1) has been blocked for ^DJI and some others since Aug 2011 as metioned by Mario Fernandez, 2) was actually still working until just the other day. I know this because I've been using it and it stopped working (as it turned out) about a week ago. As an aside, 2) had the benefit that it would in fact allow you to retrieve more data than was apparently available via either 1) or 3), for example, you could retrieve data all the way back to 1928 using method 2), but I digress. Anyway, as I say, 2) also stopped working recently which left me with the frustration of not being able to keep my datasets/models updated automatically.

Given that I actually use the ^DJI data for some of my models etc, I eventually spent an hour or 2 today writing a page scraper for the normal quotes page (e.g. no. 3) which will now directly fetch quotes from the HTML quotes web page. This is in the context of an open source command line downloader application written in Python that I've done some minor work on over the last couple of months. It is what I currently use to refresh my datasets on a routine basis. With the latest patch, the OP and anyone else that want to download ^DJI has another possible solution to download ^DJI as required.

If you'd like to try this out then you'll need to download and install Python first (on Windows. Linux and Mac has Python built in.) I suggest ActiveState's Python distribution, available here:

http://www.activestate.com/activepython/downloads

Note they ask for registration details but it's not obligatory. You can just ignore the registration page you get after clicking on one of the download links.

Then you need the pyQ program source. You can get this from the project page here:

http://bazaar.launchpad.net/~wprins/python-pyq/trunk/view/head:/pyq.py

Edit 2016-10-20: Code is now available on github and will run under Python 3 as well: https://github.com/ByteJuggler/pyq

Click the "download" link, and save the script somewhere suitable. Then open up a command prompt, "cd" to the folder you've downloaded the script to, and try to run the script with "pyq". Assuming Python has been installed, you should be presented with a summary of usage. In it's simplest form, a command like:

pyq IBM

will fetch a live quote line for IBM.

Something like:

pyq 20120601 20120701 IBM

... will fetch quotes for IBM from 20120601 to 20120701 date. Etc. Output is effectively CSV. If you want to save the output to a file, then redirect the output as per normal:

pyq 20120601 20120701 IBM >ibm.csv

Anyway, hope that helps someone. (I stumbled over this page earlier today while trying to figure out why my ^DJI dataset was out of date since about a week ago and decided to post back here if/when I came up with a solution.)

Edit: Please note for ^DJI you should quote the ticker, for example:

pyq 20120601 20120701 "^DJI" >"^DJI.csv"

Imre answered 6/7, 2012 at 19:27 Comment(0)
U
5

I think that you are better off contacting Yahoo! Finance. As they know their system and will most likely be able to help.

Unparliamentary answered 9/9, 2010 at 19:32 Comment(1)
Silent down voters ftw! It just does not make sense why you would NOT contact the one place that would know what is going on.Unparliamentary
F
4

now that yahoo blocked INDU you can use an ETF that tracks the index instead. I don't think they would block that.

Fume answered 27/9, 2011 at 15:50 Comment(0)
P
2

I'm using Google Finance to get the data since Y! Finance has stopped working. Albeit Google might change their policy as well in the future. Until this will happen I access

http://finance.google.com/finance/info?lient=ig&q=INDEXDJX:.DJI&callback=?

which will return a JSONP document.

Punish answered 22/3, 2016 at 17:29 Comment(0)
S
1

I saw this last week...

http://webdesignsnow.com/forums/about125.html which describes a change as well as the message seen in the csv file.

Sugared answered 13/9, 2010 at 13:1 Comment(0)
S
1

The following link: http://finance.yahoo.com/q/hp?s=^DJI will give you some of the information that you are interested in (like Open, DaysHigh, and DaysLow).

Furthermore, the following non-functioning code:

wget -qO ^DJI.csv "http://ichart.finance.yahoo.com/table.csv?s=^DJI"

can be replaced with the following hack:

(echo "Date,Open,High,Low,Close,Volume,Adj Close"
for y in {0..7603..66}; do # increase 7603 if necessary
  wget -qO- "http://finance.yahoo.com/q/hp?s=^DJI&y=$y" |
    sed 's/<\/\(td\|a\)>/\n/g' |
    grep yfnc_tabledata1 |
    sed -e 's/<.*>//g' -e 's/\([0-9]\),\([0-9]\)/\1\2/g' |
    grep -v ^$ |
    awk 'BEGIN {m["Jan"]=1; m["Feb"]=2; m["Mar"]=3;
    m["Apr"]=4; m["May"]=5; m["Jun"]=6;
    m["Jul"]=7; m["Aug"]=8; m["Sep"]=9;
    m["Oct"]=10; m["Nov"]=11; m["Dec"]=12}
    NR%7==1 {printf "%d-%02d-%02d,",$3,m[$1],$2}
    NR%7>1 {printf "%s,",$0} NR%7==0'
done) > ^DJI.csv

which will generate a table with daily historical data for the ^DJI starting from January 29, 1985.

Sow answered 6/4, 2015 at 22:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.