erlc-api.py Documentation¶
erlc-api.py v3 is a lightweight sync and async wrapper for the ER:LC PRC API.
It uses flat clients, simple aliases, typed dataclasses by default, raw JSON
escape hatches, dashboard bundle helpers, flexible commands, default-on
process-local rate limiting, command policy guardrails, and explicit lazy
utility modules.
I Want To...¶
| I want to... | Go to |
|---|---|
| Install the package | Installation and Extras |
| Understand how the library works | How It Works |
| Make my first API call | Getting Started |
| Choose sync vs async | How It Works — Sync vs Async |
| See every API method | Endpoint Reference |
| Look up a model's fields | Models Reference |
| Send a moderation command | Commands Reference |
| Understand rate limits | Rate Limits, Retries, and Reliability |
| Handle an error | Errors and Troubleshooting |
| Set up webhook verification | Webhooks Reference |
| Build a Discord bot | Quickstart: Discord.py |
| Build a web dashboard | Quickstart: Web Backend |
| Migrate from v2 | Migration to v3 |
| Browse all utilities | Utilities Reference |
| Test without hitting the API | Testing and Mocking |
Recommended Reading Path¶
- Installation and Extras
- How It Works
- Clients and Authentication
- Endpoint Reference
- Models Reference
- Commands Reference
- Utilities Reference
- Getting Started
- Quickstart: Web Backend
- Quickstart: Discord.py
- Migration to v3
Start¶
- Installation and Extras: install commands, extras, supported Python versions, and package/import naming.
- How It Works: request flow, server keys, typed responses, sync vs async, rate limits, and utility loading.
- Getting Started: first sync and async calls, commands, multi-server overrides, and common mistakes.
- FAQ: quick answers for package naming, raw JSON, utilities, and removed v1 behavior.
API Reference¶
- Clients and Authentication: constructors,
lifecycle, headers,
server_key=,global_key=, validation, and raw requests. - Endpoint Reference: every flat endpoint method, PRC path, return type, options, examples, and common mistakes.
- Endpoint Usage Cookbook: task-oriented endpoint recipes for dashboards, logs, queue views, commands, and raw JSON.
- Models Reference: dataclass fields, helpers,
.raw,.extra,.to_dict(), and player identifier parsing. - Typed vs Raw Responses: when to use typed dataclasses and when to inspect exact PRC JSON.
- Commands Reference: plain strings,
cmd, dry-run, normalization, validation, and command error behavior. - Function List: compact import and method inventory.
- Permission Levels: ordered enum helpers while preserving raw permission strings.
Utilities And Operations¶
- Utilities Reference: find, filter, sort, group, diff, time, schema, and lazy loading.
- Ops Utilities Reference: snapshots, audit, idempotency, polling plans, and custom commands.
- Workflow Utilities Reference: location, bundle presets, rules, multi-server reads, Discord payloads, diagnostics, caching, status, and command flows.
- Vehicle Tools: catalog-aware model parsing, owner joins, plates, textures, and summaries.
- Emergency Calls: polling/webhook call helpers, summaries, and nearest-call patterns.
- Wanted Stars: filters, finders, sorters, and watcher
events for
WantedStars. - Formatting, Analytics, and Export: output helpers for Discord, console, dashboards, CSV, Markdown, HTML, and XLSX.
- Moderation Helpers: safe command composition, dry-run previews, and audit messages.
- Waiters and Watchers: polling helpers and event streams built from snapshot diffs.
- Webhooks Reference: signature verification, event decoding, and low-level routing.
- Event Webhooks and Custom Commands: secure webhook endpoint walkthrough.
- Custom Commands Reference: alias,
predicate, middleware, and unknown-handler routing for
;commands.
Reliability, Security, And Testing¶
- Security and Secrets: safe key storage, logging redaction, and webhook verification rules.
- Rate Limits, Retries, and Reliability: 429 behavior, retry boundaries, and polling guidance.
- Scaling Your App: global keys, caching, limiter state, and multi-process boundaries.
- Errors and Troubleshooting: exception hierarchy, error-code mapping, rate-limit metadata, practical handling patterns, and diagnostics.
- Testing and Mocking: fake clients, raw fixtures, dry-runs, webhook tests, and watcher tests.
Migration¶
- Migration to v3: v3 simplification guide and before/after examples.
- Migration to v2: v2 breaking changes and migration checklist.
- Comparison and Why erlc-api.py: design goals and why the wrapper stays lightweight.