Yahoo! Finance API DOW [closed] - web-services

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
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?

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:
These services are not reliable.
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.

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.
You need to make 30 requests instead of one.
You will have to adjust the divisor if there is a stock-split.
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.

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

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/

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.

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

Related

Dividend history from Yahoo finance

Is there a convenient way to obtain dividend history for a specified company from the Yahoo finance API? For example, the historic data can be obtained by the following link, with some variable conditions
https://query1.finance.yahoo.com/v7/finance/download/code_name?period1=from&period2=to&interval=1d&events=history
Which, with those conditions filled, would look like:
https://query1.finance.yahoo.com/v7/finance/download/CBA.AX?period1=0&period2=1625841418&interval=1d&events=history
Which gives the data as Date Open High Low Close AdjClose Volume. What I would like to obtain is this, but for dividends. I.e. Date Amount in a specified period.
You can get the past dividends for, say Apple, using this query
https://finance.yahoo.com/quote/AAPL/history?period1=from&period2=to&interval=div%7Csplit&filter=div&frequency=1d&includeAdjustedClose=true
To get the csv file, use this for Apple
https://query1.finance.yahoo.com/v7/finance/download/AAPL?period1=From&period2=To&interval=1d&events=div&includeAdjustedClose=true
Try this for the dividends during last year again using Apple as an example
https://query1.finance.yahoo.com/v7/finance/download/AAPL?period1=1594598400&period2=1626134400&interval=1d&events=div&includeAdjustedClose=true
You can use R to get dividend information quite easily.
If you want the information from Yahoo then use quantmod library. The function to use is getDividends("CBA.AX")
library(quantmod)
getDividends("CBA.AX")

MaxMind's GeoIPCity for a single country only?

Recently I have stumbled upon a problem - MaxMind's GeoIPCity file is way too big for our needs and contains A LOT of data we don't need and won't need.
The question is: is there a way to limit the City database to a single country? let's say, Canadian cities only?
You cannot just conveniently download the database for Canadian cities only, but you can certainly prune the database once you have downloaded and loaded it. This is true whether you use the MaxMind DB or download the CSV format, just trim out the lines that do not represent Canada's country code or geoname_id (depending on v1 or v2 of the dataset).
If you identify your specific coding environment and language, I'm certain someone can help you write a few lines of code that chops out all the fat.

Mapbox Geocoding API V5- Get all neighborhoods in a city

Is there a way to get all neighborhoods per city by lat and lng from mapbox API V5.
For example, if I search using the lat and lng of Long Beach.
-118.1937, 33.7701
I expect to get back all the neighborhoods, instead, I only get back one result of
"place_name: "Downtown, Long Beach, California 90802, United States""
I have changed the response limit and bound box, with no results.
Here is the mapbox playground.
https://www.mapbox.com/api-playground/#/forward-geocoding
Thanks!
Mapbox doesn't really do neighborhoods, they require some sort of search data to pull either addresses or places.
However, there are services where you can get neighborhood data. I found this Stack Overflow question to have several links (sadly, most of them outdated....), with the reference to Zillow having a lot of promise.
I'd also suggest the Census Bureau data as it may have what you are looking for, but it is what I would call 'less than user friendly' to find anything - unless you are comfortable reading government spec sort of things... :)

Getting stocks by industry via Yahoo Finance

i want to list all available industries ( like: http://biz.yahoo.com/p/ ) and show all corresponding stocks.
Until now I'm using YAHOO.Finance.SymbolSuggest.ssCallback for the symbol suggestion and http://finance.yahoo.com/d/quotes.csv?s=... for getting the stock's data.
Does anyone have any idea how to get all industries and corresponding stocks?
Is there another hidden Yahoo API?
Lists of all available industries are called GICS Sectors for Standard and Poor's (S&P500 will use that) and ICB for Dow Jones and FTSE. Hence it used by Nasdaq, Nyse and others markets.
It seems like Yahoo uses a third industry classification by Morning Star, but since I'm not quite sure I will give both ways of retrieving data.
Morning Star
I don't know if Yahoo really sticks to this classification, but some names were really close so let's see it:
You need to go to their Index Data and in each sector, click on it and then at the bottom View complete index holdings.
It's not as precise as in Yahoo industry list, but it's all you can do with Morning Star. Not very convincing, I know...
GICS Sectors
GICS Sectors are now a trademark of Standard and Poor's and then data have to be sought for in S&P's website.
Short answer: take a look at this page, you will need to be registered (it's free and easy) and you can download spreadsheets (xls) with stocks and corresponding sectors. Nevertheless, things aren't always easy, and you will have to do a bit of a search to retrieve all stocks with their corresponding industries. For example, the file INDICATED_RATE_CHANGE.xls will give you some companies and their sectors in each month of 2012. Using that and SP500_DividendAristocrats_2012.xls you should be able to retrieve at least a large part of S&P 500 companies.
ICB
ICB is used by NYSE, NASDAQ etc... Then it's a lot simpler than S&P and MorningStar. Here is your answer. BOOM! Direct link!
Link is dead :(
Finally
I strongly advise you to use the simpler and most-used industry classification index: the ICB. It will always be available and publicly displayed since millions of investors relay everyday on it, without having to use S&P financial services or MorningStar brokerage services...
EDIT
You can look at nasdaq.com to retrieve all companies and their corresponding sector: here for Nasdaq and here for Nyse
Get all industry-IDs from here:
http://biz.yahoo.com/ic/ind_index.html
(look at the links)
Then use YQL ( https://developer.yahoo.com/yql/console/ )
with a query like this:
select * from yahoo.finance.industry where id=912

Programmatic access to detailed historical financial data [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I know that Yahoo has a great API for accessing detailed financial metrics about a company documented at http://www.gummy-stuff.org/Yahoo-data.htm. Yahoo also provides historical pricing data, documented at http://code.google.com/p/yahoo-finance-managed/wiki/csvHistQuotesDownload.
However, I'm trying to find a place where I can programmatically access detailed historical data, like what was a company's earnings 10 years ago, and not just the price of the stock. Does anyone know of such a site? I'm willing to pay, and I think http://www.mergent.com/servius, but they seem very, very expensive. A single standardized financial report from a company costs 50 units, which is $2.50 under their pay-as-you-go plan.
Google seems to have pretty good historical financial data that appears to go back 5 years. I may try scraping them, but I'd like to go back much, much further. Any ideas?
Quandl provides a huge amount of different databases with all sorts of data, not only EOD but e.g. earnings per share and a lot of other stuff like US employment data.
API is easy to use and well documented. It also provides an Excel plug-in, a Matlab plug-in, a Python package, an R package, and a number of languages has a support through community maintained libraries.
Not all the data are free though. For more advanced data bases there is a subscription fee. I think the price is different depending on the database and the number of potential users.
Check out this page: ADVFN Financial Data Scraper. You can download a spreadsheet with built-in macro that scrapes up 22 years of financial earnings data for any publically traded company that ADVFN posts historic data for. Just keep in mind that it's not an quick process, for the 3000 odd companies pre-listed in the spreadsheet, the macro will need to run for a couple of days (obviously you can download less if you like though). But, you'll end up with over 8 million data values and you'll have them saved locally in a spreadsheet for quick and easy analysis.
ADVFN posts up to 307 rows of data per company per year and this spreadsheet can capture them all, yielding a very comprehensive data base of historical financial data.
Wolfram Alpha has the data you desire
Examples:
http://www.wolframalpha.com/input/?i=msft+earnings
http://www.wolframalpha.com/input/?i=aapl+earnings+2001
http://www.wolframalpha.com/input/?i=ko+price+1983
I have not used it, but I see they provide a free API with an option to upgrade if you exceed their monthly limits.
Intrinio provides income statements, balance sheets, and statement of cashflows going back 10 years, in addition to stock prices and valuation ratios, via API. You can programmatically query the API to pull the data into your app.
Some examples:
https://api.intrinio.com/financials/standardized?identifier=YUM&statement=income_statement&fiscal_period=Q2&fiscal_year=2015
This grabs YUM's income statement from Q2, 2015.
https://api.intrinio.com/companies?latest_filing_date=2017-03-06
That shows all companies with a new filing date on or after 2017-03-06, which is useful for determining which fundamentals need to be updated.
https://api.intrinio.com/data_point?ticker=AAPL,MSFT&item=pricetoearnings
That pulls the current price to earnings ratio for Apple and Microsoft. You could swap out last_price to get the current stock price.
https://api.intrinio.com/data_point?ticker=$FEDFUNDS&item=level
This call returns the current federal funds interest rate from the federal reserve.
https://api.intrinio.com/prices?ticker=AAPL
That returns the price history for AAPL.
Intrinio gives away 500 daily API calls to any developer.
Depends what you want. Lets say, if you looking for FX historical data you can take a look on Dukascopy historical data feed(http://www.dukascopy.com/swiss/english/data_feed/historical/)
It is possible to write some scripts to download data into your app.
You can get what you want from financialmodelingprep they have quarterly income statement, balance sheet and cash flow. I include a sample code so you can see how I took the data in jquery.
They also offer historical quote according to their documentation.
Fiddle: https://jsfiddle.net/7g238qrp/
$(document).ready(function() {
var url = "https://financialmodelingprep.com/api/financials/income-statement/AAPL?period=quarter";
$.ajax({
url: url,
type: "GET",
crossDomain: true,
success: function (response) {
let resp = response;
resp = resp.substring(5);
resp = resp.substring(0, resp.length - 5);
// if you want to convert to JSON
//resp = JSON.parse(resp)
//console.log(resp);
$('#JonContent').text(resp);
},
error: function (xhr, status) {
alert("error");
}
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<pre>
<div id="JonContent"></div>
</pre>