ppy / osu-api

Public API for accessing osu! related data.
320 stars 16 forks source link

Would like an easy way to tell if a user is a ranked mapper. #262

Closed Kyuunex closed 5 years ago

Kyuunex commented 5 years ago

Would be nice if we had /api/get_beatmaps?approved=1 that returned only ranked maps.

Or even better, /api/get_user had returned "ranked_amount" that specifies how many mapset has a user ranked (and I guess +qualified since it's like that in the site). 0 for no ranked sets.

would make my code A LOT less complicated.

christopher-dG commented 5 years ago

IMO the distinction is not very hard to make as-is:

url = "https://osu.ppy.sh/api/get_beatmaps?u=peppy&k=" + my_api_key
allowed = [1, 2, 3]  # Ranked, approved, and qualified
is_ranked_mapper = any(int(b["approved"]) in allowed for b in requests.get(url).json())