Users¶
- 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
BeatmapPlaycount
forUserBeatmapType.MOST_PLAYED
, andBeatmapset
otherwise.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.