Sc2 api get mmr

Hello. I want to get with SC2 API a player’s MMR in a ladder. I found the LADDER API under Profile API and i find it in the object ranksAndPools[0]. Horever sometimes the MMR is missing. Why? Is it the correct method to get the MMR of a player?
Thank you very much