ppy / osu-web

the browser-facing portion of osu!
https://osu.ppy.sh
GNU Affero General Public License v3.0
970 stars 381 forks source link

Global rank on the osu! api V2 #8607

Open minisbett opened 2 years ago

minisbett commented 2 years ago

I've been messing around with the osu! api v2 for the last hours and stumbled across something confusing.

The osu! api always returns "0" for the ranks of a score when receiving them using the /users/{user}/scores/best endpoint. Why is that? Has that field not been implemented yet as V2 is still WIP? Or is that information not available on that endpoint?

image

Thanks in advance for any replies.

minisbett commented 2 years ago

EDIT: I found the issue, the documentation is incorrect. The field is called "global_rank" but the documentation says "rank_global". image image

minisbett commented 2 years ago

EDIT 2: I looked up the wrong api request. In the response I got from the scores endpoint I didn't receive a field specifying the global rank, that's why it defaults to 0. Now my question is why is it not specified? Is that information not available on that endpoint for some internal reason?

peppy commented 2 years ago

As I said in email, it's very likely too expensive to return in that listing.

minisbett commented 2 years ago

Where is the information global_rank available then?

peppy commented 2 years ago

In leaderboards.

minisbett commented 2 years ago

what I mean is how could I receive the information of what rank on the leaderboard a certain score is? Would I have to check the beatmaps leaderboard?

tsunyoku commented 2 years ago

what I mean is how could I receive the information of what rank on the leaderboard a certain score is? Would I have to check the beatmaps leaderboard?

Get the score ID. There is an endpoint to get score info with a given ID, rank will be available there