Skip to main content

A Python client for accessing the RBXStats API.

Project description

RBXStats API Client

PyPI version

A Python client for the RBXStats API, providing easy access to various Roblox-related data like offsets, exploits, game information, and more. This package allows developers to integrate with the RBXStats API effortlessly, now with advanced error handling and customization options.

Features

  • Retrieve Roblox offsets, exploits, game information, and version data.
  • Enhanced error handling for network issues, JSON decoding, and HTTP errors.
  • Customizable headers and request timeouts for flexible integration.

Installation

Install the package via pip:

pip install rbxstats

Usage

Import the client, initialize it with your API key, and use its methods to interact with different RBXStats API endpoints.

Quick Start

from rbxstats import RbxStatsClient

# Initialize the client
client = RbxStatsClient(api_key="YOUR_API_KEY")

# Get all offsets
all_offsets = client.offsets().all()
print(all_offsets)

# Get a specific offset by name
specific_offset = client.offsets().by_name("RenderToEngine")
print(specific_offset)

# Get undetected exploits
undetected_exploits = client.exploits().undetected()
print(undetected_exploits)

Customization Options

You can add custom headers or adjust the request timeout to suit your application’s needs.

  • Custom Headers: Use the set_headers method to add or update headers dynamically.
  • Request Timeout: Use the set_timeout method to set a custom timeout (in seconds) for requests.

Example:

# Initialize the client
client = RbxStatsClient(api_key="YOUR_API_KEY")

# Customize headers and timeout
client.set_headers({"X-Custom-Header": "MyHeaderValue"})
client.set_timeout(10)  # Set a custom timeout (in seconds)

API Reference

Each endpoint is encapsulated in its own class within the RbxStatsClient. Here’s an overview of the available classes and methods.

Offsets

Methods to access Roblox offsets.

  • Get all offsets

    client.offsets().all()
    
  • Get a specific offset by name

    client.offsets().by_name("RenderToEngine")
    
  • Get offsets by prefix

    client.offsets().by_prefix("Camera")
    
  • Get camera-related offsets

    client.offsets().camera()
    

Exploits

Methods to get current Roblox exploit data.

  • Get all exploits

    client.exploits().all()
    
  • Get undetected exploits

    client.exploits().undetected()
    
  • Get free exploits

    client.exploits().free()
    

Versions

Methods to get the latest and future versions of Roblox.

  • Get the latest Roblox version

    client.versions().latest()
    
  • Get the future Roblox version

    client.versions().future()
    

Game

Retrieve game-specific information based on game ID.

  • Get game details by ID
    client.game().by_id(12345)
    

Error Handling

This client includes robust error handling for common issues:

  • HTTP Errors: Handles client and server errors (e.g., 404 Not Found, 500 Internal Server Error).
  • Timeouts: Prevents requests from hanging indefinitely.
  • JSON Decoding Errors: Manages cases where the response isn’t a valid JSON.

Error responses are returned as structured JSON with details about the issue:

try:
    offsets = client.offsets().all()
except Exception as e:
    print(f"An error occurred: {e}")

Dependencies

This package requires requests to handle HTTP requests. It will be automatically installed as a dependency.

Development

If you’d like to contribute, clone the repository and install the dependencies:

git clone https://github.com/Jermy-tech/rbxstats_api
cd rbxstats_api
pip install -e .

Running Tests

You can add tests in the tests/ directory (not included in this setup). Run tests using pytest:

pytest

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

rbxstats-0.2.5.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

rbxstats-0.2.5-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file rbxstats-0.2.5.tar.gz.

File metadata

  • Download URL: rbxstats-0.2.5.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for rbxstats-0.2.5.tar.gz
Algorithm Hash digest
SHA256 bf3d54f54c64b8d7650c42897e765a0866dc8c2639dc8f58123887ef0dd6bf2d
MD5 744ce5860d1ae8cc662c247036937495
BLAKE2b-256 39e8a2d2cb27d4bc18cb5d6595e8d8c92d12282d7294141096d008fd747958bc

See more details on using hashes here.

File details

Details for the file rbxstats-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: rbxstats-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for rbxstats-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 058efff6d98de1702006b009af4d9c29e75f44d39732d873a2fa6a8ed46a70cc
MD5 80a8d8f7c742e5ffdd7a18a4c8f8266a
BLAKE2b-256 7d63f2f0f9bdeec7a568b1a8633aa9495a9c7b29d2523cb187236b6509cc81c9

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