muFunds icon indicating copy to clipboard operation
muFunds copied to clipboard

Error when fetching mutual fund quotes from Morningstar

Open vickychijwani opened this issue 2 years ago • 54 comments

Hello, I encountered the 404 error below when using muFunds to display mutual fund NAV from Morningstar. I believe it only stopped working a few days ago, so it's probably a recent change in Morningstar.

Here's a sample Morningstar id that can be used to replicate this - f00000pdmk. It's an Indian mutual fund, if that matters. Let me know if I can provide any other info to help debug this - thanks!

No se pudo completar la solicitud para el código devuelto 404 de http://quotes.morningstar.<?> Respuesta del servidor truncada: The report is no longer supported (usar la opción muteHttpExceptions para examinar toda la respuesta). (line 123).

vickychijwani avatar Jun 23 '22 08:06 vickychijwani

I'm getting it for Canadian mutual funds too - same error.

muFunds("nav","FID1682")

damonbrodie avatar Jun 23 '22 14:06 damonbrodie

Hi @vickychijwani and @damonbrodie! Thanks for reporting this.

It seems that Morningstar has stopped supporting their generic reports available at quotes.morningstar.com (e.g. this one, where the message "The report is no longer supported" can be read). This means that the Morningstar generic mode, as explained here and which was the default behavior if no source option was given, will not work anymore.

This means that, for making muFunds work again, a user should now explicitly define a Morningstar country-specific source as the third argument of the muFunds function, as explained in the Usage section. This is valid for mutual funds that are commercialised in any of these countries: Australia (au), Austria (at), Belgium (be), Denmark (dk), Finland (fi), France (fr), Germany (de), Iceland (is), Ireland (ie), Italy (it), Norway (no), Netherlands (nl), Portugal (pt), South Africa (za), Spain (es), Switzerland (ch), United Kingdom (uk/gb).

Basically, we should now use muFunds("nav", "(identifier)", "morningstar-**"), where ** is one of the countries above, in which the fund is commercialised.

If we don't find any way to replace these generic Morningstar reports we were using, we should either:

a) Make the source option (third argument of the muFunds function) mandatory, so the user is forced to define the Morningstar country site that should be used to retrieve the data (which basically would be their country), or

b) Within the muFunds function, check all Morningstar countries until we find one in which the data is available for the given fund. This would be more time consuming, but the country could be cached for future calls.

@mattjgalloway, what do you think?

@damonbrodie: As you may see in the previous list, muFunds is currently not compatible with the Canadian version of Morningstar right now, but I'll try to fix that in the next few days.

joseballester avatar Jun 23 '22 19:06 joseballester

It used to work for brazilian funds too. Very neat. Hope you can find a fix.

wroliveira1 avatar Jun 23 '22 19:06 wroliveira1

I also often use it to track Brazilian funds. I hope the problem will be fixed.

alexpatez avatar Jun 23 '22 23:06 alexpatez

@joseballester should we just release an update with the fixes we made a while back? That would make the country based one’s work right?

I agree with your idea of making the source mandatory.

mattjgalloway avatar Jun 24 '22 06:06 mattjgalloway

The proposed solution is working but for the pension plan option. The following example returns an error:

=mufunds("nav", "F00000XL5T", "morningstar-es")

Garate77 avatar Jun 24 '22 07:06 Garate77

Thanks for the quick reply @joseballester! What would it take to support India as a compatible source country? (morningstar.in) I can help if the fix is straightforward :)

vickychijwani avatar Jun 24 '22 08:06 vickychijwani

Thanks @joseballester! It works for me now!

alechima92 avatar Jun 24 '22 08:06 alechima92

Thanks, works. As a note; ISIN no longer works with country specific, need to use morningstar ID

woxxa-Wiz avatar Jun 24 '22 11:06 woxxa-Wiz

This means that, for making muFunds work again, a user should now explicitly define a Morningstar country-specific source as the third argument of the muFunds function, as explained in the Usage section.

Awesome, thx for the fix

WillemWijnans avatar Jun 24 '22 11:06 WillemWijnans

The problem remains for Brazilian funds... It is impossible to find the morningstar ID for Brazilian funds. :(

alexpatez avatar Jun 24 '22 14:06 alexpatez

Is there any fix for US funds? The US is not in that country code list. Thanks.

Jvhowube avatar Jun 24 '22 15:06 Jvhowube

hi, @joseballester , the solution only works with the listed countries? i tried Luxembourg and still ERROR thanks for the help!

ofaofaofa avatar Jun 24 '22 22:06 ofaofaofa

@joseballester Please help add singapore morningstar. my many of mutual funds are listed in morningstar singapore. Previously working but now stopped Please help

sanksara avatar Jun 25 '22 03:06 sanksara

I can not get Cdn mutual funds to work either, "morningstar-ca" does not work? Is there a country code for Canada?

As a possible mutual fund source, globe and mail might work?

shaneyamkowy avatar Jun 25 '22 04:06 shaneyamkowy

Also would need morningstar singapore. Thanks

Sebsebzen avatar Jun 25 '22 07:06 Sebsebzen

I'm trying to update the addon published in the Google Workspace Marketplace to let users know that the source argument will now be required. I was also planning to update it to make it compatible with some of the countries that have appeared in this discussion.

However, I'm having issues to deploy a new version to the marketplace because of the nature of the Google Cloud Platform project associated to my Google Apps Script project. I'm trying to solve this, but for now it seems that the only solution is creating a new GCP project (user-managed/standard instead of the Apps Script-managed/default one, more here). The bad news is that this would make users uninstall the current muFunds addon and install a new one, but without me having a way to tell them to do so.

@Jvhowube: I believe the Google Finance built-in function works for US mutual funds. You can try with =GOOGLEFINANCE("MUTF:(ticker)"). More info here (search for United States) and here.

@Garate77: It is true that morningstar-es does not work with Spanish pension plans right now, since the page layout is slightly different. You can use the quefondos source instead, but it only returns nav, date, currency and category (change and expenses do not work).

@woxxa-Wiz: Searching by ISIN should still work. When using a ISIN, the Morningstar ID is searched before actually querying the fund data. Could you please let me know the ISIN of the fund you're having trouble with?

@ofaofaofa: Could you please let me know the ISIN of the fund for which morningstar-lu doesn't work? You should choose a country from the list where the fund is available for sale.

@vickychijwani, @damonbrodie, @wroliveira1, @alexpatez, @sanksara, @shaneyamkowy and @Sebsebzen: I am willing to update the addon to make it compatible with Canada, Brazil and Singapore, respectively, but I am having the issue with the Google Marketplace. I will update you soon, thanks for your patience.

joseballester avatar Jun 25 '22 10:06 joseballester

LU1353950568

ofaofaofa avatar Jun 25 '22 12:06 ofaofaofa

@ofaofaofa Sorry, I misunderstood your question before. Yes, the solution only works for the listed countries, which I'll be extending in the future, and Luxembourg is not in that list. Anyway, for the fund with ISIN LU1353950568, even if morningstar-lu is not available, you can try using another country where this fund is available for sale, e.g. Spain (morningstar-es).

Note: If you try it right now, it may fail since it seems Morningstar is not working at the moment (checking this fund in Morningstar Spain returns an error), but hopefully the issue will be solved soon.

joseballester avatar Jun 25 '22 14:06 joseballester

I cannot find a source can retrieve ISIN: HK0000055761 "JPMorgan Pacific Technology"

but it can be retrieved on "morningstar" before

I find that the ISIN code start with HK cannot be retrieved on every provided source, please recommend.

chickyyip avatar Jun 27 '22 04:06 chickyyip

@joseballester Crees que van a solucionar el error? o la solucion final es usar morningstar-xx muchas gracias!

ofaofaofa avatar Jun 27 '22 20:06 ofaofaofa

My Canadian funds are reporting ERROR like those above. I tried adding 3rd "morningstar-ca" field without any change. Is the function fixed yet, and if so do I have to reinstall it to get the fix?

Thank you for this very useful add-on.

wgking avatar Jun 28 '22 01:06 wgking

Hi,

EDIT 28/6 Working again after un/reinstall

Funds stopped working today for Morningstar-UK ones. I use ISIN but also the direct Morningstar codes which i recheck are right by using them on the Morningstar search page. eg F00000SRPM

I uninstalled mufunds but it will not re-install. Get a box up saying ready to install, press continue , then box disappears but still says it is not installed ie "Install" option still available.

Great app I use every day in spreadsheet with Google finance etf funds - whole s/s stops without the related funds.

Hope you can advise workaround or a fix. Best Lawrence

mrbatch5 avatar Jun 28 '22 09:06 mrbatch5

It's not working for me either. I am sure I am doing something wrong, but I cannot figure out what. Example of what I am doing: =muFunds("nav", "(ES0112611001)", "morningstar-es") Edited: the error is the following: "This asset is not compatible with this Morningstar country. Try another country or data source (line 112)," which is strange as this is a Spanish fund.

carlotavaldes avatar Jun 28 '22 13:06 carlotavaldes

I ran across the issue from this thread and have tried supply the 3rd option to fix, but am getting an error.

I am trying: =muFunds("nav", "IE00B76VTN11", "morningstar-gb")

and I get the error: TypeError: No se puede llamar al metodo "toXmlString" de undefined. (line 103).

I tried using uk and gb, both had the issue. I tried "ie" also since I guessed some of my the assets I am tracking would be available there and it seemed to work for around 50% of them. Therefore my guess is there might be some error in the handling of the uk specific codes? Since these methods do seem to work, just not when I use a uk/gb code.

camzz avatar Jun 30 '22 09:06 camzz

@camzz this works morningstar fund code is F00000N9WG put this in cell a1 ( ghet this number by using the isin number you gave to goto fund on morningstar then in https url see the morningstar ref ID ie F00xxxx

in cell a2 put exactly including the =value

=value(muFunds("nav",a1,"morningstar-uk"))

obviously make sure mufunds is installed in your excel or google sheet instance

mrbatch5 avatar Jun 30 '22 10:06 mrbatch5

It's not working for me either. I am sure I am doing something wrong, but I cannot figure out what. Example of what I am doing: =muFunds("nav", "(ES0112611001)", "morningstar-es") Edited: the error is the following: "This asset is not compatible with this Morningstar country. Try another country or data source (line 112)," which is strange as this is a Spanish fund.

Worked for me just by replacing your , for ; and taking off the ()

CarlosVadinia avatar Jul 04 '22 10:07 CarlosVadinia

Hi @joseballester ,

I'm trying use https://tools.morningstar.be/be/snapshotpdf/default.aspx?Site=be&id=F0GBR04IT6&currencyid=EUR (used to work before this issue, using the ISIN).

Tried these variations:

# Using the ISIN
=muFunds("nav"; "BE0026535543"; "morningstar-be")
# Using the code from the morningstar URL above
=muFunds("nav"; "F0GBR04IT6"; "morningstar-be")

Getting the same This asset is not compatible with this Morningstar country as others.

dvx76 avatar Jul 04 '22 13:07 dvx76

just checking in, any idea when Canadian Mutual fund data will work again?

shaneyamkowy avatar Jul 05 '22 03:07 shaneyamkowy

I figured it out, but thanks for your help anyway. I changed it for this, which also works fine: =value(muFunds("nav",B4,"morningstar-es")) B4 being cell ES0112611001

It's not working for me either. I am sure I am doing something wrong, but I cannot figure out what. Example of what I am doing: =muFunds("nav", "(ES0112611001)", "morningstar-es") Edited: the error is the following: "This asset is not compatible with this Morningstar country. Try another country or data source (line 112)," which is strange as this is a Spanish fund.

Worked for me just by replacing your , for ; and taking off the ()

carlotavaldes avatar Jul 05 '22 11:07 carlotavaldes