11

The yahoo finance quotes API(http://download.finance.yahoo.com/d/quotes.csv?) provides access to a number of features associated with a company for the current year

(Sector Price   
Dividend Yield  
Price/Earnings  
Earnings/Share  
Book Value  
52 week low 
52 week high    
Market Cap  
EBITDA  
Price/Sales 
Price/Book).

The yahoo finance historicaldata api (http://ichart.finance.yahoo.com/table.csv?) provides only the following information for a company for a period specificed (start YYMMDD, end YYMMDD)

>      "Open": "15.32",
>      "High": "15.35",
>      "Low": "15.13",
>      "Close": "15.24",
>      "Volume": "20126900",
>      "Adj_Close": "15.24"

How can I get historical data for Dividend Yield,Price/Earnings, Earnings/Share associated with a company? (because right now I can only get information related to the current year using the finance.quotes API and I cannot get historical data associated with these features)

mathopt
  • 569
  • 1
  • 6
  • 17
  • try this : https://stackoverflow.com/questions/44379067/new-yahoo-finance-historical-data it is a working fine under perl – negi Jun 05 '17 at 23:33

4 Answers4

10

In order get historical dividends you can add "g=v" to your query as follows

http://ichart.finance.yahoo.com/table.csv?s=MSFT&g=v

This will give you the following fields

Date
Dividends

I would credit where I found this information but I do not remember where I got it. Even as I search other sites I cannot find details on this API at all.

John G
  • 101
  • 1
  • 3
3

It's going to be difficult to find the data you require for free. This is why people who provide financial data, like Michael Bloomberg, are billionaires.

One option you could try is Quandl. I successfully used their Wiki Stock db as a backup for the Yahoo historical data api, as well as the primary source for some hard-to-find indices. You might be able to calculate some of the data you require from their free databases.

wooters
  • 829
  • 6
  • 24
3

You can look at

https://developer.yahoo.com/yql/console/?q=show%20tables&env=store://datatables.org/alltableswithkeys#h=select+*+from+yahoo.finance.historicaldata+where+symbol+%3D+%22YHOO%22+and+startDate+%3D+%222009-09-11%22+and+endDate+%3D+%222010-03-10%22

ymerdrengene
  • 1,421
  • 2
  • 17
  • 20
  • 1
    This is a different interface to the same data mentioned in part 2 of the OP's question. It does not provide company financial metrics. – mgoldwasser May 21 '16 at 13:03
0

For anyone who's interested: heres how to download data from eodhistoricaldata.com:

https://eodhistoricaldata.com/api/eod/AAPL.US?from=2017-01-05&to=2017-02-10&api_token=OeAFFmMliFG5orCUuwAKQ8l4WWFQ67YX&period=d

Call the url with the following parameters: *eod: 'end of day' this Is only one of many possibilities for download. check their site for the complete list *AAPL.US: the stock in question * from and to: the from and to date *api_token: a token for your account

The result is a csv file, which can be handeled in for instance c# using this example: download csv

real_yggdrasil
  • 1,213
  • 4
  • 14
  • 27