Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get key statistics for yahoo finance web search api?

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.

like image 973
bunny sunny Avatar asked Jul 25 '16 12:07

bunny sunny


2 Answers

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.

like image 149
Yago Rodriguez Avatar answered Sep 30 '22 15:09

Yago Rodriguez


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.

like image 42
bunny sunny Avatar answered Sep 30 '22 16:09

bunny sunny