PyPI Package
Python SDK (noxaeapi-sdk)
Official typed Python client library for the NoxAeApi REST + WebSocket platform. Built entirely on standard library urllib with zero required runtime dependencies.
Zero Dependencies
Built entirely on standard library urllib. Fast, lightweight, and isolated from dependency conflicts.
13 Core Modules
Complete coverage for players, economy, server, worlds, plugins, LuckPerms, NoxAuth, skills, and Velocity.
Automatic Retries
Built-in exponential backoff with configurable RetryOptions for resilient networking.
Type Hints (PEP 561)
Ships with py.typed marker and full dataclass typing for mypy and IDE autocompletion.
Installation
Install the official package from PyPI via pip or your preferred environment manager (poetry, uv, pipenv):
pip install noxaeapi-sdk
# with realtime console/event socket support:
pip install "noxaeapi-sdk[ws]"Basic Usage
Instantiate the NoxAeApiClient with your server base URL and API key:
from noxaeapi_sdk import NoxAeApiClient
client = NoxAeApiClient(base_url="http://localhost:8080", api_key="your-api-key")
# Access any of the 12 core modules
players = client.players.list()
balance = client.economy.get_balance(players[0]["uuid"])
client.server.broadcast("Hello from the Python SDK!")Loading from Environment
Initialize the client automatically from process environment variables without hardcoding secrets:
from noxaeapi_sdk import NoxAeApiClient
# Reads NOXAEAPI_BASE_URL and NOXAEAPI_KEY from os.environ.
# If you keep those in a .env file, load it yourself first (e.g. with
# python-dotenv) — the SDK never reads .env files or os.environ implicitly
# outside this method.
# 1. Standard environment variable loading
client = NoxAeApiClient.from_env()
# 2. Or override individual fields while still falling back to env vars
client = NoxAeApiClient.from_env(timeout=15.0)Environment Convention
Realtime WebSocket Streams
Stream live Minecraft server console logs and game events over WebSocket connections:
from noxaeapi_sdk import NoxAeApiClient
client = NoxAeApiClient.from_env()
# 1. Connect to live console output stream (authenticates via ?key= query parameter)
console_socket = client.connect(route="console")
console_socket.on("open", lambda _: print("Connected to console stream"))
console_socket.on("console", lambda line: print("[Minecraft Console]", line))
console_socket.on("error", lambda err: print("WebSocket error:", err))
console_socket.on("close", lambda _: print("Console connection closed"))
# 2. Connect to live game events (joins, quits, deaths, kicks, bans, chat)
events_socket = client.connect(route="events")
def on_event(evt):
print("Live Event:", evt.get("event"), "Player:", (evt.get("player") or {}).get("name"))
events_socket.on("event", on_event)
# Sockets run on a background thread and include automatic reconnect
# with exponential backoff.WebSocket Extra Required
Error Handling & Exceptions
All non-2xx HTTP responses raise typed exception classes inheriting from NoxAeApiError:
from noxaeapi_sdk import (
NoxAeApiForbiddenError,
NoxAeApiNotFoundError,
NoxAeApiRateLimitError,
)
try:
client.server.restart()
except NoxAeApiForbiddenError:
print("This API key isn't allowed to restart the server.")
except NoxAeApiNotFoundError:
print("The requested resource was not found.")
except NoxAeApiRateLimitError:
print("Rate limit hit, consider lowering request frequency.")NoxAeApiUnauthorizedError401 — API key is missing or rejectedNoxAeApiForbiddenError403 — API key is valid but lacks permissions for this endpointNoxAeApiNotFoundError404 — Target player, world, or resource does not existNoxAeApiRateLimitError429 — Rate limit exceeded (auto-retried when retry is enabled)NoxAeApiServerError5xx — Minecraft server internal error (auto-retried)NoxAeApiNetworkErrorConnection refused, DNS failure, or socket timeoutClient Configuration
Customize timeouts, retry strategies with exponential backoff, and custom request headers:
from noxaeapi_sdk import NoxAeApiClient, RetryOptions
client = NoxAeApiClient(
base_url="https://mc.example.com",
api_key="...",
timeout=10.0, # per-request timeout in seconds, default 10
retry=RetryOptions(
attempts=3, # total attempts including the first, default 3
base_delay_ms=300,
max_delay_ms=5000,
),
# retry=False, # disable retries entirely
headers={"X-Extra": "..."},
)Modules Catalog (13)
Browse all 13 sub-modules available under the NoxAeApiClient instance:
| Method | Return Type | Description | REST Spec |
|---|---|---|---|
list() | List[OnlinePlayer] | Get an array of all currently online players with locations, health, and metadata. | Endpoint |
list_all() | List[OfflinePlayer] | Get every player the server has ever seen (online + offline). | Endpoint |
get(uuid) | OnlinePlayer | OfflinePlayer | Get in-depth attributes and real-time state for a specific player by UUID. | Endpoint |
get_inventory(player_uuid, world_uuid) | List[InventoryItem] | Inspect a player's inventory slots in a specific world. | Endpoint |
kick(uuid, reason=None)ADMIN | None | Disconnect an online player with an optional reason. | Endpoint |
ban(uuid, reason=None, expiry=None)ADMIN | None | Ban a player UUID with optional reason and ISO-8601 expiry. Omit expiry for permanent ban. | Endpoint |
unban(uuid)ADMIN | None | Remove a player ban entry by UUID. | Endpoint |
teleport(uuid, location) | None | Teleport a player to {"x", "y", "z", "world"} coordinates. | Endpoint |
set_gamemode(uuid, gamemode)ADMIN | None | Update the active gamemode ("survival" | "creative" | "adventure" | "spectator"). | Endpoint |
get_stats(uuid) | PlayerStats | Fetch gameplay statistics (kills, deaths, playtime, blocks placed/broken). | Endpoint |
resolve(player) | PlayerProfile | Resolve a player UUID or username to a complete PlayerProfile dataclass. | Endpoint |
get_player_profile(player) | PlayerProfile | Fetch detailed profile attributes for a player by UUID or username. | Endpoint |
get_player_profiles(players) | List[PlayerProfile] | Batch resolve multiple player UUIDs or usernames in a single API call. | Endpoint |
# Teleport player and perform moderation actions
player = client.players.get("069a79f4-44e9-4726-a5be-fca90e38aaf5")
# Teleport to spawn coordinates
client.players.teleport(player["uuid"], {
"x": 100.5,
"y": 64.0,
"z": -250.0,
"world": "world",
})
# Set gamemode or unban player
client.players.set_gamemode(player["uuid"], "survival")
# client.players.unban(player["uuid"])See Also & Integrations
Explore alternative client packages and complete endpoint specifications:
TypeScript / Node.js SDK
Official NPM package (@wumx-labs/noxaeapi-sdk) for TypeScript, Node, Bun, and browser.
Full API Reference
Inspect all 50+ REST endpoints and WebSocket protocols with parameter specifications.
Release Changelog
Track releases and patch notes across the plugin, Python SDK, and TypeScript client.