Import fund data from Morningstar

There’s a local fund that’s available in Morningstar (updated), in Yahoo Finance (updated but shows no data in their website, so something’s wrong) and in ft.markets (updated with a delay of several days).

All the other available sources in the software don’t have this particular fund I’m trying to add. I guess I could use ft.markets and hope it eventually gets updated more frequently, but anyway, is there any way to import the historical/value data from Morningstar instead?

Thanks in advance :slight_smile:

There may well be a better way, but this is how I’ve done it.

First go to the Chart page for the fund (or trust or EFT) on the Morningstar website. I will use the Baillie Gifford Positive Change Fund B Accumulation fund ISIN GB00BYVGKV59 as an example. Remove any other benchmarks etc the are charted (this is not necessary, but makes things easier). Open your browser’s “developer tools” which is F12 in Firefox and probably other browsers as well. Go to the “Network” tab and press the clear button which looks like a bin; again, not necessary but makes things easier. Now press the “chart settings” button just above the chart, click “display options”, and then click the “percentage” button - this switches the chart to show the actual fund price, rather than a percentage change, and handily for our purposes causes the Morningstar website to request a link that we can use in Portfolio Performance with a bit of modification. That link should display in the “network” screen of the browser’s developer tools, so now right click on the entry that comes from the “tools.morningstar.co.uk” domain and is of type “json” and select the Copy->Copy URL option. The link should be

https://tools.morningstar.co.uk/api/rest.svc/timeseries_price/t92wz0sj7c?currencyId=GBP&idtype=Morningstar&frequency=daily&startDate=2011-02-01&priceType=&outputType=COMPACTJSON&id=F00000ZB0M]2]0]FOGBR$$ALL&applyTrackRecordExtension=true

You now need to change some of the options in the link and slightly simplify it as well so it becomes:

https://tools.morningstar.co.uk/api/rest.svc/timeseries_price/t92wz0sj7c?currencyId=GBP&idtype=Morningstar&frequency=daily&outputType=JSON&startDate=2020-12-31&id=F00000ZB0M]2]0]FOGBR$$ALL

You can go to this link in your browser if you want to see the data. There are 4 options worth highlighting: frequency which will give you daily prices, outputType gives you a style of JSON that Portfolio Performance can parse, startDate lets you choose how far back to go, and id is the Morningstar reference for the security - so change that value for any other ones you want to use. The order of the options doesn’t matter but I find it easier to put the id at the end for when I’m setting up multiple securities.

Now in Portfolio Performance select JSON as the provider in the “Historical Quotes” tab of the security, and use the following values:

Feed URL = the link just created
Path to Date = $.TimeSeries.Security[*].HistoryDetail[*].EndDate
Path to Close = $.TimeSeries.Security[*].HistoryDetail[*].Value

Always worth double checking the displayed values against the Morningstar chart.

8 Likes

This is amazing, thank you so much! :slight_smile:

Hi, this is great info SimonFitz thanks
I am trying to get other data from mornigstar.co.uk using pytihon. Data such as style (for example Large Growth or large value) industry etc for both stocks and funds/etfs. I am not sure how to get the url to parse as there is no security id on it. Is there a way to get the url for each instrument? Is there maybe a smarter easier way to do this?
I am using python

Hello SimonFitz,
I have even able to apply your nice way to get quote from Morningstar. I tried to apply the same on Bloomberg with the following URL fee:

https://www.bloomberg.com/markets2/api/history/WASRIRD%3ALX/PX_LAST?timeframe=5_YEAR&period=weekly&volumePeriod=weekly

to get historical date of the fund: WASRIRD:LX (Waterloo SICAV-SIF - Global Socially Responsible Investment).

I am stuck with the Json though and can not retrieve the date in PP.

Could you help ?

If you click on the “show server response” button and scroll down, you can see that Bloomberg isn’t sending the JSON to PP that you get through a browser but instead is returning a captcha test. Although Portfolio Performance is wonderful and does many things, I don’t think it has the ability to handle captchas!

See https://forum.portfolio-performance.info/t/json-provider-for-historical-data/17851/8

Hi Simon, thanks for your help, I was able to add some of my funds thru your method. It worked for Morningstar perfectly but there is a fund (LU0654531267) that is not on Morningstar, but is on FT. Can you help me with a method for FT?

Best regards,
Iain

You could use the Table on web site provider option and give the historical prices page from the FT as the Feed URL - https://markets.ft.com/data/funds/tearsheet/historical?s=LU0654531267:EUR I believe.

Or try the Morningstar website for a country in Europe that does have the fund, such as this https://www.morningstar.be/be/funds/snapshot/snapshot.aspx?id=F00000OV3O and see if the chart there works.

2 Likes

hi Simon, I am a student who is trying to write a code for a professor. I wonder where do you get these api calls? I asked morningstar directly and they said they will charge me $2550.
So, I need helps. We have zero budget.

hi Marctom… may i know where do you get the api data from?

Regards
Thet

@thetmon4
To search the designated JSON feed you have to trace the browser’s communications while calling a website and check the results one by one. You could use the below guide how to capture the browser tracing;

Hi all,

I have some trouble to retrieve the historical quotes for a fund I have in my portfolio: FR0011253624.

I want to select JSON as the provider in the “Historical Quotes” tab of the security.

I do retrieve the information in https://global.morningstar.com/fr/investissements/fonds/0P00017T6E/graphique

…but trying to apply what SimonFitz explains, I do not succeed.

From the chart, I do not find a “percentage” button but by clicking on Détail prix & volumes’, I can see the historical values.

The link in “network” is https://www.us-api.morningstar.com/QS-markets/chartservice/v2/timeseries?query=F00000X3BN:totalReturn,nav&frequency=d&startDate=2020-12-28&endDate=2026-02-26&trackMarketData=3.6.5&instid=DOTCOM

…doesn’t look like the one described above…

Can anyone help?

Thanks

Why don’t you use Built-In or yahoo:

Just to add its still possible to obtain historic quotes from Morningstar, though amendments have been made to its web structure since 2021 and consequently the JSON URL is now slightly different.

In this particular case you’re interested in ‘FR0011253624’ and you’ve established that info about this fund can be obtained from Graphique de performance du fonds R-co Valor C EUR | Morningstar France. The key here is ‘0P00017T6E’. Detailed below is the amended Morningstar historic quote JSON URL for this fund (i.e. its referenced with ‘0P00017T6E’) and with ‘EUR’ used as the currency.

https://lt.morningstar.com/api/rest.svc/timeseries_price/t92wz0sj7c?currencyId=EUR&idtype=Morningstar&frequency=daily&outputType=JSON&startDate=2020-12-28&id=0P00017T6E]2]0]FOEUR$$ALL
Path to Date = $.TimeSeries.Security[*].HistoryDetail[*].EndDate
Path to Close = $.TimeSeries.Security[*].HistoryDetail[*].Value

Hi Rich28,

I tried this, but nothing happens after this input:

I tried to update the quotes, but whenever I say not to keep the old historic values, they are not replaced by the Morningstar ones;

If I keep the historic values I updated previously (from a CSV file), the quote from yesterday (and today) is still not retrieved despite this JSON configuration.

Do I miss something?

Thanks

Hi,

I could have used Yahoo, but as you can see from your screenshot, the quotes are not up-to-date, the quote from yesterday for example is not retrieved in Yahoo

Best regards,

Hi,

Finally, I used another source: Financial Times

Feed URL = R-co Valor C EUR, FR0011253624:EUR historical prices - FT.com

Simpler than JSON (for me at least) :wink:

BR,

Apologises @ZeDav , I wrote that post at speed and it transpires the url I provided had an error, as did the paths to the date and close. I see that you’ve now opted to source the data from the FT, which is good though only provides a limited time series. If you’re up to it, I’ve now amended the details I provided earlier (in my previous post) for sourcing the data, in JSON format, from Morningstar.