Python library for interacting with the official Rocket League API.
pip install python-rocket-league
The library was written using Python 3.5, but should work with Python 2.7 too, see the test suite for confirmation.
from rlapi.client import RocketLeagueAPI
rl = RocketLeagueAPI('xxxxx') # Replace xxxxx with your user token.
regions = rl.get_regions()
Must be one of the following values:
- steam
- ps4
- xboxone
- switch
These are also available as the following constants (from rlapi.constants
):
PLATFORM_STEAM
PLATFORM_PLAYSTATION
PLATFORM_XBOX
PLATFORM_SWITCH
Must be one of the following numerical values:
- 10 (Ranked Duels)
- 11 (Ranked Doubles)
- 12 (Ranked Solo Standard)
- 13 (Ranked Standard)
These are also available as the following constants (from rlapi.constants
):
PLAYLIST_RANKED_DUELS
PLAYLIST_RANKED_DOUBLES
PLAYLIST_RANKED_SOLO_STANDARD
PLAYLIST_RANKED_STANDARD
Must be one of the following values:
- assists
- goals
- mvps
- saves
- shots
- wins
These are also available as the following constants (from rlapi.constants
):
STAT_ASSISTS
STAT_GOALS
STAT_MVPS
STAT_SAVES
STAT_SHOTS
STAT_WINS
For single values pass the value as a string or integer.
player_id = 76561198022035654
For multiple values pass the values as strings or integers within a list. You may request data for a maximum of 100 players per call.
player_id = [76561198022035654, 76561198008869772]
Values for Xbox One and PS4 are strings, values for Steam are integers (though strings may work).
Returns the population data for each platform.
[
“Steam”: [
{
“PlaylistID”: 8,
“NumPlayers”: 3
},
...
],
...
]
Returns the list of regions available in the game.
[
{
"region": "EU",
"platforms": "Steam,PS4,XboxOne,Switch"
},
{
"region": "USW",
"platforms": "Steam,PS4,XboxOne,Switch"
},
...
]
Returns the top 100 entries of the skill leaderboard. Includes the player's username and tier.
[
{
“user_name”: “iOghma”,
“skill”: 1202,
“tier”: 12,
},
...
]
Returns the top 100 entries of the stats leaderboard, optionally filtered to a specific stat type. If you do not wish to filter the leaderboard, simply pass platform
by itself.
[
{
“stat_type”: “assists”,
“stats”: [
{
“assists”: 2950,
“username”: “Normal Times”,
},
{
“assists”: 2575,
“username”: “Lyn Pepper”,
},
...
]
},
{
“stat_type”: “goals”,
“stats”: [
{
“goals”: 17789,
“username”: “MadMassacre510”,
},
...
]
},
...
]
Return skill values for one or more players.
[
{
“user_name”: “Rocket_League1”,
“player_skills”: [
{
“playlist”: 10,
“skill”: 217,
“matches_played”: 2,
“tier”: 0,
“tier_max”: 0,
“division”: 0,
}
]
}
]
Returns a list of titles available for a player. You cannot request data for multiple players with this method.
[
{
“title”: “Season2GrandChampion”,
},
...
]
Returns stat values for one or more players for a specific stat type.
[
{
“stat_type”: “assists”,
“stats”: [
{
“assists”: 2950,
“username”: “Normal Times”,
},
{
“assists”: 2575,
“username”: “Lyn Pepper”,
},
...
]
}
]
Returns all stat values for one or more players. This is a utility method to allow you to get all of the stats for one or more players without calling get_stats_value_for_user()
6 times per player. Each of the players will have their own key in the response, the key will be the player ID for Steam users and the player name for all other platforms.
{
76561198024807207: {
'saves': 14099,
'wins': 7803,
'mvps': 3757,
'shots': 42193,
'goals': 18017,
'assists': 9284
}
}
pip install .[testing]
pytest --cov-report=html --cov=rlapi -v -x -n auto
If you are having a problem with the client library, then you can open an issue. If you are having a problem with the data that is being returned, then you can post on the API support forum.