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

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.

class r6statsapi.Platform[source]

Platform names.

uplay = 'UPLAY'

UPlay/PC Network

psn = 'PSN'

The Playstation Network

xbox = 'XBL'

Xbox Live

xbl = 'XBL'

Alias of xbox

ps4 = 'PSN'

Alias of psn

pc = 'UPLAY'

Alias of uplay

class r6statsapi.Regions[source]

R6Stats Regions.

all = 'All Regions'

All Regions

ncsa = 'North America'

North America

emea = 'Europe'

Europe

apac = 'Asia'

Asia

eu = 'Europe'

Alias of emea

na = 'North America'

Alias of ncsa

asia = 'Asia'

Alias of asia

R6Stats API Models

Models are classes that are received from R6Stats API.

class r6statsapi.player.Player(*, platform, data)[source]

“Player() Represents R6 Player

platform

Player’s platform.

Type:Platform
username

Player’s username (display name)

Type:str
avatar_url_256

Player’s 256x256 Avatar

Type:str
avatar_url_146

Player’s 146x146 Avatar

Type:str
aliases

List of previous user aliases.

Type:list
level

Player’s level.

Type:int
lootbox_probability

Player’s probability of getting a lootbox.

Type:int
total_xp

Players total XP.

Type:int
class r6statsapi.player.Operators(*, platform, data)[source]

“Operators() Represents R6 Player

platform

Player’s platform.

Type:Platform
username

Player’s username (display name)

Type:str
avatar_url_256

Player’s 256x256 Avatar

Type:str
avatar_url_146

Player’s 146x146 Avatar

Type:str
operators

Player’s operator stats mapped to a dictionary.

Type:dict
class r6statsapi.player.Weapons(*, platform, data)[source]

“Weapons() Represents R6 Player

platform

Player’s platform.

Type:Platform
username

Player’s username (display name)

Type:str
avatar_url_256

Player’s 256x256 Avatar

Type:str
avatar_url_146

Player’s 146x146 Avatar

Type:str
weapons

Player’s weapons stats mapped to a dictionary.

Type:dict
class r6statsapi.player.Seasonal(*, platform, data)[source]

“Seasonal() Represents R6 Player

platform

Player’s platform.

Type:Platform
username

Player’s username (display name)

Type:str
avatar_url_256

Player’s 256x256 Avatar

Type:str
avatar_url_146

Player’s 146x146 Avatar

Type:str
seasons

Player’s seasonal stats mapped to a dictionary.

Type:dict
class r6statsapi.player.WeaponCategories(*, platform, data)[source]

“WeaponCategories() Represents R6 Player

platform

Player’s platform.

Type:Platform
username

Player’s username (display name)

Type:str
avatar_url_256

Player’s 256x256 Avatar

Type:str
avatar_url_146

Player’s 146x146 Avatar

Type:str
weapon_categories

Player’s weapon categort stats mapped to a dictionary.

Type:dict
class r6statsapi.player.Gamemodes(*, platform, data)[source]

“Gamemodes() Represents R6 Player

platform

Player’s platform.

Type:Platform
username

Player’s username (display name)

Type:str
avatar_url_256

Player’s 256x256 Avatar

Type:str
avatar_url_146

Player’s 146x146 Avatar

Type:str
bomb

Player’s bomb stats mapped to a dictionary.

Type:dict
secure_area

Player’s secure area stats mapped to a dictionary.

Type:dict
hostage

Player’s hostage stats mapped to a dictionary.

Type:dict
class r6statsapi.player.Queue(*, platform, data)[source]

“Queue() Represents R6 Player

platform

Player’s platform.

Type:Platform
username

Player’s username (display name)

Type:str
avatar_url_256

Player’s 256x256 Avatar

Type:str
avatar_url_146

Player’s 146x146 Avatar

Type:str
casual

Player’s casual stats mapped to a dictionary.

Type:dict
ranked

Player’s ranked stats mapped to a dictionary.

Type:dict
other

Player’s other stats mapped to a dictionary.

Type:dict
class r6statsapi.player.Leaderboard(*, platform, region, data)[source]

“Leaderboard`() Represents R6 Leaderboard

platform

Leaderboard platform.

Type:Platform
region

Leaderboard region

Type:Regions
leaderboard

Leaderboard mapped to a list of dictionarys.

Type:list

Exceptions

The following exceptions are thrown by the library.

exception r6statsapi.errors.R6StatsApiException[source]

Bases: Exception

Base exception class for R6Stats API.

exception r6statsapi.errors.Unauthorized[source]

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
status

The status code of the HTTP request.

Type:int
message

Details about error.

Type:str