Yahoo! Finance API DOW

14,335

Solution 1

This index is not available under any other name.

However, this problem was just a temporary glitch, now resolved by Yahoo. Unfortunately, their financial data availability is very flaky lately. E.g. data available on the web page, but CSV downloads give "N/A" for all fields, etc. There were similar incidents in recent months, with stock prices for random stocks given wrong values, and more.

So, if you're building a new service around these Yahoo services, be aware that:

  1. These services are not reliable.
  2. You're breaking Yahoo ToS, so there's nothing you can do if they are broken / not working, you cannot even complain to Yahoo in good faith. According to Yahoo (post by Yahoo Developer Network Community Manager Robyn Tippins on Yahoo developer forums):

    The reason for the lack of documentation is that we don't have a Finance API. It appears some have reverse engineered an API that they use to pull Finance data, but they are breaking our Terms of Service (no redistribution of Finance data) in doing this so I would encourage you to avoid using these webservices.

Solution 2

The formula for the DJIA isn't very complicated. If you are still able to pull quotes from individual stocks, you could use your code to pull the prices of the existing 30 components of the DJIA, add them up and divide by the current divisor. Of course, this has several disadvantages.

  1. You need to make 30 requests instead of one.
  2. You will have to adjust the divisor if there is a stock-split.
  3. You will have to change the the queries when the components change.

The components of the DJIA are

AA AXP BA BAC CAT CSCO CVX DD DIS GE HD
HPQ IBM INTC JNJ JPM KFT KO MCD MMM MRK 
MSFT PFE PG T TRV UTX VZ WMT XOM

The current divisor is 0.132129493. The divisor changes whenever there is a stock split in on of the components. The components of the DOW changed 48 times from 1896-2009.

Solution 3

It seems like Yahoo Finance does not support the web service to query ^DJI or INDU.

Check out this discussion:

http://developer.yahoo.com/forum/General-Discussion-at-YDN/Dow-Jones-Industrial-Average-Quote-Error/1317052217631-f9173931-04fd-4519-b1b3-efb65d7ff8fa/1317065435082

Solution 4

Assuming that your application does not need to be real time market data (to the second), you can use the RAW data that is provided to build the interactive graph on yahoo. This data is comma separated and updates about once every minute. The downside: it will include all the data from the trading day. The time given is in Unix time so a conversion would be needed. I tried this out for the ticker symbols you listed and the only one I was able to get data with was ^dji. Hopefully this is what you are looking for!

You can mess with the link and see what happens to the data. For example you can change the amount of days.

http://chartapi.finance.yahoo.com/instrument/1.0/%5Edji/chartdata;type=quote;range=1d/csv/

Solution 5

I think Yahoo Finance All Currencies quote API Documentation will help you.

I found a Yahoo forum answer that says we cannot download CSV data for ^DJI.

Check also YQL console. This console will fetch values in JSON format.

Share:
14,335
Peter Kazazes
Author by

Peter Kazazes

I'm a full stack platform developer, public speaker, and strategist. Beginning with iOS development as teenager in my bedroom (and much help from SO), I built the first social-media-sourced polling platform, Twelect, which I transformed into Sibyl Vision, a predict-anything public opinion analysis firm. I regularly speak about Sibyl's research at universities and on national television. These days, I build real-time data abstraction platforms which spotlight actionable business intelligence. I've built software for some of the country's largest institutions, and am obsessed with evolving digital policy and information security.

Updated on June 04, 2022

Comments

  • Peter Kazazes
    Peter Kazazes about 2 years

    Until now, I've been using the INDU ticker to follow the DOW with the Yahoo! API. For whatever reason you were unable to directly follow ^dji ^djia or any other reasonable combination. Up until yesterday, INDU was working fine. However now I receive no data when requesting indu.

    What other ticker can I use with the Yahoo! finance API that will return the DJIA?

  • Peter Kazazes
    Peter Kazazes over 12 years
    I've read that thread, looking for alternatives.
  • dapumptu
    dapumptu over 12 years
    It seems like INDU works again? You can try that.
  • Peter Kazazes
    Peter Kazazes over 12 years
    No dice. What made you think it was working?
  • dapumptu
    dapumptu over 12 years
    Use YQL with INDU seems OK now: select * from yahoo.finance.quotes where symbol in ("INDU")
  • haimg
    haimg over 12 years
    I edited my answer and added a reference. You cannot use the CSV files except for your personal use.
  • haimg
    haimg over 12 years
    But they are not the same! Check finance.yahoo.com/q?s=DIA and finance.yahoo.com/q?s=indu, you'll see that the numbers are a bit different.
  • Meryovi
    Meryovi almost 11 years
    INDU no longer works.