Skip to main content

Rocket League Stats API client

Project description

rlstatsapi-logo

Rocket League Stats API

Code style: black PyPI version Pylint Downloads

rlstatsapi is a small Python client for reading live Rocket League Stats API events over a local TCP socket.

Install

From PyPI:

pip install rlstatsapi

From GitHub:

pip install git+https://github.com/manucabral/RocketLeagueStatsAPI.git

Rocket League setup

Automatic setup from 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

[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

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

All events demo

UI

UI demo

CLI

rlstatsapi status
rlstatsapi enable --port 49123 --rate 30
rlstatsapi listen --event GoalScored

You can also listen to multiple events:

rlstatsapi listen --event GoalScored --event MatchEnded --event MatchCreated

Typing

For the best editor experience, use cast_event_data(...) or msg.as_type(...).

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

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

Contributors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rlstatsapi-0.1.6.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rlstatsapi-0.1.6-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file rlstatsapi-0.1.6.tar.gz.

File metadata

  • Download URL: rlstatsapi-0.1.6.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rlstatsapi-0.1.6.tar.gz
Algorithm Hash digest
SHA256 003d8feda3f7b7a6cd808527e82bd110d6eaab6e1e8fe5cedfffb4c4ff56e52e
MD5 724e8c90c6924c4ba4e6dac5dab7e0c4
BLAKE2b-256 c1b62054a2e72f251da021b8afe03283c0ddffaf2ba441cd4c99b39d205fb7a7

See more details on using hashes here.

File details

Details for the file rlstatsapi-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: rlstatsapi-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rlstatsapi-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5ded3796d51bfbe144af861226417cebf7e4f8a6c437ffbffc9f52c8d700a006
MD5 d7c07bb88e78e89372475612dfc38d84
BLAKE2b-256 92092e59382fe040f0f46dc70d720933223625c354b019bc472670ced4334e7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page