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

后端 未结 8 1988
Happy的楠姐
Happy的楠姐 2020-11-30 00:37

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:

相关标签:
8条回答
  • 2020-11-30 00:57

    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.

    0 讨论(0)
  • 2020-11-30 01:03

    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...

    0 讨论(0)
  • 2020-11-30 01:10

    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.

    0 讨论(0)
  • 2020-11-30 01:11

    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.

    0 讨论(0)
  • 2020-11-30 01:16

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

    0 讨论(0)
  • 2020-11-30 01:17

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

    0 讨论(0)
提交回复
热议问题