9

I am working on retrieving yahoo finance companies data and I was succeeded in getting the companies stock data. Apart from the basic data I am also trying to retrieve key statistics data for the same company. Below image is the key statistics fields which I require.

enter image description here

I am using yahoo web service api to get the stock data. But when I am trying to add the parameters like f=nab and f=snbaopl1 , I am getting 406 error response code. The below is the finance api which I am using.

http://finance.yahoo.com/webservice/v1/symbols/SPARC.BO/quote?format=json&view=detail&f=nab

If that is the way to give then how should I get the stocks key statistics for companies.

bunny sunny
  • 301
  • 6
  • 15
  • Can anyone help me out ? I am trying very hardly and researching in many ways but I didn't found any alternate options. The one which I found were deprecated. Why no one is responding to the yahoo questions – bunny sunny Jul 28 '16 at 05:27

2 Answers2

17

You can try access this link:

https://query2.finance.yahoo.com/v10/finance/quoteSummary/YOUR_COMPANY_SYMBOL?modules=ANY_PERMITTED_MODULE_SEPPARATED_BY_COMMAS

i found some modules that i think are interesting:

assetProfile
financialData
defaultKeyStatistics
calendarEvents
incomeStatementHistory
cashflowStatementHistory
balanceSheetHistory

this link will response with a json file.

Yago Rodriguez
  • 354
  • 1
  • 10
2

I have succeeded in getting yahoo finance key_statistics data by using the following quotes api http://finance.yahoo.com/d/quotes.csv?s=MSFT&f=snd1l1ydrbj1mt8opjk

By default the api will display the output in csv format if we want we can also convert the CSV output to JSON format.The quotes api is working perfectly fine to my requirement in getting the above mentioned statistics which are given as f=snd1l1ydrbj1mt8opjk and also getting the JOSN format by converting the csv output to JSON.

bunny sunny
  • 301
  • 6
  • 15
  • Still works as of the 20th of March, 2017. Also, great catch! – Tom Granot Mar 20 '17 at 10:53
  • What is meant by `f=snd1l1ydrbj1mt8opjk` ? Can you explain what this fields indicate? Thanks. – Shuwn Yuan Tee Aug 15 '17 at 04:21
  • 1
    s = symbol (i.e., Ticker symbol) n = company full name d1 = Last Trade Date l1 = Last Trade (Price Only) y = Dividend Yield d = Dividend / Share r = P/E Ratio b = Bid j1 = Market Capitalization m = Day’s Range t8 = 1yr Target Price o = Open p = Previous Close j = 52-Week Low k = 52-Week High – bunny sunny Aug 18 '17 at 11:41
  • 1
    No longer works, now it's saying "It has come to our attention that this service is being used in violation of the Yahoo Terms of Service. As such, the service is being discontinued. For all future markets and equities data research, please refer to finance.yahoo.com." – wordsforthewise Nov 08 '17 at 01:45