https://github.com/manucabral/rocketleaguestatsapi
Rocket League Stats API Library in Python.
https://github.com/manucabral/rocketleaguestatsapi
rlstats rocketleague rocketleagueastatsapi sockets
Last synced: about 2 months ago
JSON representation
Rocket League Stats API Library in Python.
- Host: GitHub
- URL: https://github.com/manucabral/rocketleaguestatsapi
- Owner: manucabral
- License: mit
- Created: 2026-04-28T17:26:46.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-04-28T19:03:11.000Z (2 months ago)
- Last Synced: 2026-04-28T19:35:00.951Z (2 months ago)
- Topics: rlstats, rocketleague, rocketleagueastatsapi, sockets
- Language: Python
- Homepage: https://pypi.org/project/rlstatsapi
- Size: 11.7 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Rocket League Stats API
[](https://github.com/psf/black) [](https://pypi.org/project/rlstatsapi/) [](https://github.com/manucabral/RocketLeagueStatsAPI/actions/workflows/pylint.yml)

`rlstatsapi` is a small Python client for reading live Rocket League Stats API events over a local TCP socket.
- Full docs: [manucabral.github.io/RocketLeagueStatsAPI](https://manucabral.github.io/RocketLeagueStatsAPI/)
- Release history: [CHANGELOG.md](CHANGELOG.md)
## Install
From [PyPI](https://pypi.org/project/rlstatsapi/):
```bash
pip install rlstatsapi
```
From GitHub:
```bash
pip install git+https://github.com/manucabral/RocketLeagueStatsAPI.git
```
## Rocket League setup
Automatic setup from Python:
```python
from rlstatsapi import configure_stats_api
configure_stats_api(enabled=True, port=49123, packet_send_rate=30)
```
Manual setup:
`Documents\My Games\Rocket League\TAGame\Config\TAStatsAPI.ini`
```ini
[TAGame.MatchStatsExporter_TA]
Port=49123
PacketSendRate=30
```
In both cases, restart Rocket League after changing the config file.
Config discovery is currently Windows-first and targets common user config locations.
## Quick start
```python
import asyncio
from rlstatsapi import StatsClient
async def main() -> None:
async with StatsClient() as client:
client.on_any(lambda msg: print(msg.event, msg.data))
await asyncio.Event().wait()
asyncio.run(main())
```
## Demos
### All events

### UI

## CLI
```bash
rlstatsapi status
rlstatsapi enable --port 49123 --rate 30
rlstatsapi listen --event GoalScored
```
You can also listen to multiple events:
```bash
rlstatsapi listen --event GoalScored --event MatchEnded --event MatchCreated
```
## Typing
For the best editor experience, use `cast_event_data(...)` or `msg.as_type(...)`.
```python
from rlstatsapi.models import EventMessage
from rlstatsapi.types import GoalScoredPayload, cast_event_data
def on_goal(msg: EventMessage) -> None:
data: GoalScoredPayload = cast_event_data("GoalScored", msg.data)
print(data.get("Scorer", {}).get("Name"))
```
## More
- Full docs: [manucabral.github.io/RocketLeagueStatsAPI](https://manucabral.github.io/RocketLeagueStatsAPI/)
- Examples: [examples/](examples)
- Release history: [CHANGELOG.md](CHANGELOG.md)
## Notes
- In current Rocket League builds this endpoint behaves like a TCP JSON stream in practice.
- Some fields, such as `MatchGuid`, are only present in online/LAN contexts.
## Disclaimer
This project is an independent, community-made library and is **not affiliated with, endorsed by, or sponsored by Psyonix or Epic Games**.
Rocket League and related trademarks are the property of their respective owners.
Use this library at your own risk and in compliance with Rocket League’s terms and policies.
## Contributors