tybug / ossapi

The definitive python wrapper for the osu! api.
https://tybug.github.io/ossapi/
GNU Affero General Public License v3.0
80 stars 17 forks source link

help | Getting a user's recent score #81

Closed br0k3V closed 4 months ago

br0k3V commented 4 months ago

So I'm continuing from that other issue, How do I get a user's recent score? image Something like this, I can't seem to find anything on the documentation.

Stedoss commented 4 months ago

You can get a user's recent scores by using this endpoint function with the "recent" ScoreType: https://tybug.github.io/ossapi/users.html#ossapi.ossapiv2.Ossapi.user_scores

from ossapi import Ossapi, ScoreType

api = Ossapi(client_id, client_secret)
api.user_scores(7562902, ScoreType.RECENT)
# api.user_scores(7562902, "recent") also works

The latest score should be in the first element of the returned list:

api.user_scores(7562902, "recent")[0]
br0k3V commented 4 months ago

You can get a user's recent scores by using this endpoint function with the "recent" ScoreType: https://tybug.github.io/ossapi/users.html#ossapi.ossapiv2.Ossapi.user_scores

from ossapi import Ossapi, ScoreType

api = Ossapi(client_id, client_secret)
api.user_scores(7562902, ScoreType.RECENT)
# api.user_scores(7562902, "recent") also works

The latest score should be in the first element of the returned list:

api.user_scores(7562902, "recent")[0]

Thanks, I'll try this.

br0k3V commented 4 months ago

Thanks for your help