Skip to main content

Rocket League Stats API client

Project description

RL Stats API

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

Install

From PyPI:

pip install rlstatsapi

From GitHub (latest main):

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

Rocket League setup

Before launching Rocket League, edit:

<Install Dir>\TAGame\Config\DefaultStatsAPI.ini

Use at least:

  • PacketSendRate=30 (any value > 0 enables the exporter)
  • Port=49123

Restart the game after changing the file.

Quick start

import asyncio
import logging
from rlstatsapi import StatsClient

logging.basicConfig(level=logging.INFO)


async def main() -> None:
    client = StatsClient(log_enabled=True)
    client.on_any(lambda msg: print(msg.event, msg.data))

    await client.connect()
    try:
        await asyncio.Event().wait()
    finally:
        await client.disconnect()


asyncio.run(main())

Public API

  • StatsClient(host="127.0.0.1", port=49123, reconnect=True, reconnect_delay=0.5, include_raw=False, queue_size=2048, connect_timeout=5.0, log_enabled=False)
  • connect() / disconnect()
  • on(event_name, handler)
  • on_any(handler)
  • events()

Notes

  • Works for regular matches. Some fields like MatchGuid are only present in online/LAN contexts.
  • In current builds this endpoint may behave as plain TCP JSON stream instead of websocket upgrade. This library handles the TCP stream format.

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.1.tar.gz (5.3 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.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rlstatsapi-0.1.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for rlstatsapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a6a8b6a34ae5534cfd30cd2961c990fdbf196106b0b4368d26486eaecbe146be
MD5 70280205e439fb8628cc3a9f7758918e
BLAKE2b-256 dc2050a374c7d4ea6fdcd7473f73a17af9a0bc884ed17334677d1d52748304b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rlstatsapi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for rlstatsapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 70e3b278e249b872c1d9845d2f5f6a118b7008d97caec8546bd45197c17b11c9
MD5 1bb655af6791b1f2629c6904b74f54db
BLAKE2b-256 f73a9418ae211a655fcbec43b859d9390a95bce9185637d2f747dd66f0aa6c91

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