Users¶
- search_beatmaps_passed(self, user_id, beatmapset_ids, *, exclude_converts=False, is_legacy=None, no_diff_reduction=True, ruleset_id=None)¶
Searches for the beatmaps a user has passed, by beatmapset.
- Parameters:
user_id (int | UserCompact) – The id of the user.
beatmapset_ids (list[int | BeatmapCompact | BeatmapsetCompact]) – The list of beatmapsets to search.
exclude_converts (bool) – Whether to exclude converts.
is_legacy (bool | None) – Whether to consider legacy scores. Defaults to returning all scores.
no_diff_reduction (bool) – Whether to exclude diff reduction mods. Defaults to
True.ruleset_id (int | None) – The ruleset to seach. Defaults to searching all rulesets.
- Return type:
Notes
Implements the Search Beatmaps Passed endpoint.
- user(self, user, *, mode=None, key=None)¶
Get a user by id or username.
- user
The user id or username of the user to get.
- mode
The mode of the user to get details from. Default mode of the user will be used if not specified.
- key
Whether to query by id or username. Defaults to automatic detection if not passed.
Notes
Implements the Get User endpoint.
- Parameters:
user (int | UserCompact | str)
key (UserLookupKey | str | None)
- Return type:
- user_beatmaps(self, user_id, type, *, limit=None, offset=None)¶
Get beatmaps of a user.
- Parameters:
user_id (int | UserCompact) – The user to get beatmaps of.
type (UserBeatmapType | str) – The type of beatmaps to get.
limit (int | None) – Maximum number of beatmaps to get.
offset (int | None) – Offset for pagination.
- Return type:
Notes
Returns
BeatmapPlaycountforUserBeatmapType.MOST_PLAYED, andBeatmapsetotherwise.Implements Get User Beatmaps endpoint.
- user_kudosu(self, user_id, *, limit=None, offset=None)¶
Get user kudosu history.
- Parameters:
user_id (int | UserCompact) – User to get kudosu history of.
limit (int | None) – Maximum number of history events to return.
offset (int | None) – Offset for pagination.
- Return type:
Notes
Implements the Get User Kudosu endpoint.
- user_recent_activity(self, user_id, *, limit=None, offset=None)¶
Get recent activity of a user.
- Parameters:
user_id (int | UserCompact) – The user to get recent activity of.
limit (int | None) – Maximum number of events to return.
offset (int | None) – Offset for pagination.
- Return type:
Notes
Implements the Get User Recent Activity endpoint.
- user_scores(self, user_id, type, *, include_fails=None, mode=None, limit=None, offset=None, legacy_only=None)¶
Get scores of a user.
- user_id
The user to get scores of.
- type
Type of score to get.
- include_fails
Whether to include failed scores.
- mode
Filter scores by game mode. Defaults to the user’s default mode.
- limit
Maximum number of scores to return.
- offset
Offset for pagination.
- legacy_only
Whether to exclude lazer scores. Defaults to False.
Notes
Implements the Get User Scores endpoint.
- users(self, user_ids)¶
Batch get users by id. If you only want to retrieve a single user, or want to retrieve users by username instead of id, see
user().- Parameters:
- Return type:
Notes
Implements the Get Users endpoint.
- users_lookup(self, users)¶
Batch get users by id or username. If you only want to retrieve a single user, or want to retrieve users by username instead of id, see
user().If you want to batch retrieve users by id (instead of username), use
users(), which returns more data thanusers_lookup().- Parameters:
users (list[int | UserCompact | str]) – The user ids or usernames to get.