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.5.tar.gz (17.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.5-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rlstatsapi-0.1.5.tar.gz
  • Upload date:
  • Size: 17.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.5.tar.gz
Algorithm Hash digest
SHA256 19b58f1f390012eef39075fa70d070bcb261eb7562bce56d7108f6778408add4
MD5 a3c7ac397552649a89171c4d9155016a
BLAKE2b-256 8fa223dd7198cd046406f7777cf421ce56aeb750ff3b81586030e65a57118719

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rlstatsapi-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 18.2 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 03c56c481d218d6f842f9755aae0da4da02bb6b1a14126b474b00ae7285cfd6a
MD5 2995ee5966540a9424f490a3b2b3fcb6
BLAKE2b-256 7f8358046e4615ae5463569ade9937dcbc444f9c7c67290d2cd2ffe033a7d995

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