I have a Mastodon URL that looks like https://mastodon_domain/web/accounts/123. I was able to retrieve JSON from that URL, parsed it in Python using plain JSON
https://mastodon_domain/web/accounts/123