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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With