Yahoo! Finance API DOW [closed]
Asked Answered
A

6

11

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?

Ait answered 26/9, 2011 at 0:41 Comment(0)
A
9

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.

Aulos answered 30/9, 2011 at 4:1 Comment(1)
I edited my answer and added a reference. You cannot use the CSV files except for your personal use.Aulos
K
4

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.

Karlsruhe answered 4/10, 2011 at 21:37 Comment(0)
B
2

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

Bob answered 28/9, 2011 at 3:49 Comment(5)
I've read that thread, looking for alternatives.Ait
It seems like INDU works again? You can try that.Bob
No dice. What made you think it was working?Ait
Use YQL with INDU seems OK now: select * from yahoo.finance.quotes where symbol in ("INDU")Bob
INDU no longer works.Serrated
A
2

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/

Areopagus answered 4/10, 2011 at 16:18 Comment(0)
G
1

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.

Greenback answered 29/9, 2011 at 18:13 Comment(0)
E
-1

The DIA ticker (SPDR Dow Jones Industrial Average) closely imitates the Dow.

Epistemology answered 5/10, 2011 at 0:22 Comment(1)
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.Aulos

© 2022 - 2024 — McMap. All rights reserved.