API Reference¶
Client¶
-
class
r6statsapi.
Client
(token, *, loop = None)[source]¶ -
await
get_generic_stats
(player, platform) → r6statsapi.player.Player[source]¶ Get generic player statistics.
- player: str
- Name of the player to search.
- platform: Platform
- Platform to search.
Returns: Requested player stats Return type: Player
-
await
get_seasonal_stats
(player, platform) → r6statsapi.player.Seasonal[source]¶ Get seasonal player statistics.
- player: str
- Name of the player to search.
- platform: Platform
- Platform to search.
Returns: Requested players seasonal stats Return type: Season
-
await
get_operators_stats
(player, platform) → r6statsapi.player.Operators[source]¶ Get a players operator statistics.
- player: str
- Name of the player to search.
- platform: Platform
- Platform to search.
Returns: Requested players operator statistics Return type: Operators
-
await
get_weapon_stats
(player, platform) → r6statsapi.player.Weapons[source]¶ Get weapon player statistics.
- player: str
- Name of the player to search.
- platform: Platform
- Platform to search.
Returns: Requested players weapon stats Return type: Weapons
-
await
get_weaponcategory_stats
(player, platform) → r6statsapi.player.WeaponCategories[source]¶ Get a players weapin category statistics.
- player: str
- Name of the player to search.
- platform: Platform
- Platform to search.
Returns: Requested a players weapon category stats Return type: WeaponCategories
-
await
get_queue_stats
(player, platform) → r6statsapi.player.Queue[source]¶ Get a players queue statistics.
- player: str
- Name of the player to search.
- platform: Platform
- Platform to search.
Returns: Requested player stats Return type: Queue
-
await
get_gamemode_stats
(player, platform) → r6statsapi.player.Gamemodes[source]¶ Get gamemode player statistics.
- player: str
- Name of the player to search.
- platform: Platform
- Platform to search.
Returns: Requested player stats Return type: Gamemodes
-
await
get_leaderboard
(platform, region = <Regions.all: 'All Regions'>, page = 1) → r6statsapi.player.Leaderboard[source]¶ Get gamemode player statistics.
- platform: Platform
- Platform to search.
- region: Regions
- Region to search.
- page: int
- Page to search, max = 50.
Returns: Requested player stats Return type: Leaderboard
-
await
Enumerations¶
The API provides some enumerations for certain types of string to avoid the API from being stringly typed in case the strings change in the future.
All enumerations are subclasses of enum.Enum
.
Each class has a str() method which will return a friendly version of the enum.
R6Stats API Models¶
Models are classes that are received from R6Stats API.
-
class
r6statsapi.player.
WeaponCategories
(*, platform, data)[source]¶ “WeaponCategories() Represents R6 Player
Exceptions¶
The following exceptions are thrown by the library.
-
exception
r6statsapi.errors.
R6StatsApiException
[source]¶ Bases:
Exception
Base exception class for R6Stats API.
Bases:
r6statsapi.errors.R6StatsApiException
Exception that’s thrown when status code 401 occurs.
Invalid token.
-
exception
r6statsapi.errors.
InternalError
[source]¶ Bases:
r6statsapi.errors.R6StatsApiException
Exception that’s thrown when the service has an Internal Error caused by HTTP Codes 501 or 503.
-
exception
r6statsapi.errors.
PlayerNotFound
[source]¶ Bases:
r6statsapi.errors.R6StatsApiException
Exception that’s thrown when a player is not found or there is no records availabe. Status Code 404.
-
exception
r6statsapi.errors.
HTTPException
(response, data)[source]¶ Bases:
r6statsapi.errors.R6StatsApiException
Exception that’s thrown when an HTTP request fails. .. attribute:: response
The response of the failed HTTP request.
type: aiohttp.ClientResponse