- Get key ratio, return csv format file
http://financials.morningstar.com/ajax/exportKR2CSV.html?t=<market>:<stock>
Market
- XHKG: Hong Kong Stock Exchange
- XASE: American Stock Exchange
- XNAS: Nasdaq Stock Exchange
- XNYS: New York Stock Exchange
- XSHE: ShenZhen Stock Exchange
- XSHG: Shanghai Stock Exchange
Example, get Tencent Holdings Ltd from HongKong market. http://financials.morningstar.com/ajax/exportKR2CSV.html?t=XHKG:000700
- Get financial statment, return csv format file
http://financials.morningstar.com/ajax/ReportProcess4CSV.html?t=<market>:<stock>&reportType=<is|cf|bs>&period=<12|3>&dataType=<A|R>&order=<asc|desc>&denominatorView=<raw|percentage|decimal>&columnYear=5&number=3
- reportType: is = Income Statement, cf = Cash Flow, bs = Balance Sheet
- period: 12 for annual reporting, 3 for quarterly reporting
- dataType: this doesn't seem to change and is always A
- order: asc or desc (ascending or descending)
- columnYear: 5 or 10 are the only two values supported, 10 years report need register
- number: The units of the response data. 1 = None 2 = Thousands 3 = Millions 4 = Billions
- Get price ratio, return html
Get price ratio history
http://financials.morningstar.com/valuate/valuation-history.action?&t=<market>:<stock>&type=price-earnings
Get current price ratio
http://financials.morningstar.com/valuate/current-valuation-list.action?&t=<market>:<stock>
Get forward price ratio
http://financials.morningstar.com/valuate/forward-valuation-list.action?&t=<market>:<stock>
- Get history price, return json format data
http://globalquote.morningstar.com/globalcomponent/RealtimeHistoricalStockData.ashx?ticker=<maarket>:<stock>&showVol=true&dtype=his&f=d&range=<startDate>|<endDate>
- f: m = month, d = day
- startData, endData: YYYY-M-D
Some notes for my future self:
All done in Postman
This works for all stocks, just need to input the ticker and market
http://financials.morningstar.com/ajax/exportKR2CSV.html?t=market:ticker
For instance, if one searches cd projekt red on Morningstar
https://www.morningstar.com/stocks/xwar/cdr/analysis
XWAR is the market, and cdr is the ticker
http://financials.morningstar.com/ajax/exportKR2CSV.html?t=xwar:cdr
This gives you ten years of financial data.
However, we also need to attach the Referer header.
Set the "Referer" header to this, appropriated from an above answer, and you'll get 10 years of financial data.
https://financials.morningstar.com/ratios/r.html?t=AAPL&culture=en&platform=sal
However, the data is all in CSV. So need to do some string manipulation to get what you want.