Sample Bot API
The ER:LC tools an app needs again and again, as JSON.
Base URL
GET https://api.samplebot.app/v1 lists every endpoint, without a key.
Your API key
Register an application on Your applications to get a key. It starts with sb_ and is shown once, so store it somewhere safe. Send it with every request:
Authorization: Bearer sb_your_key_here
(X-API-Key: sb_your_key_here works too.) Keep the key on your server: anyone who has it can use your limits. If it leaks, delete the application and make a new one.
Requests and replies
Every endpoint is a GET with query parameters. Every reply looks like this:
{
"ok": true,
"tool": "snowflake",
"data": { ... },
"text": "A ready-to-post version, where there is one"
}
Rate limits
| Limit | Per key |
|---|---|
| Per minute | 60 requests |
| Per day | 10,000 requests |
Every reply carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the window resets). Over the limit, you get 429 with a Retry-After header: wait that many seconds. Cache what does not change (postals) instead of asking every time.
Errors
{ "ok": false, "error": { "status": 404, "message": "There is no postal 999 in Liberty County." } }
| Status | Means |
|---|---|
400 | Something in your request is missing or wrong. The message says what. |
401 | No key, or a key that does not exist or was deleted. |
404 | Not found: an unknown endpoint, postal or user. |
405 | Wrong method: that endpoint takes a POST. |
429 | Over the rate limit. Wait for Retry-After seconds. |
503 | Something we depend on (Roblox, PRC) is limiting us. Try again shortly. |
Endpoints
| Endpoint | What it does |
|---|---|
GET /v1/postal | Find any Liberty County postal and the road it is on. |
GET /v1/route | Turn-by-turn directions by road between two postals, the same way AI dispatch gives them. |
GET /v1/erlc-status | Checks PRC's ER:LC API right now and says whether it is answering. |
GET /v1/roblox-user | A Roblox username to its user ID and back, with display name and join date. |
GET /v1/timestamp | Turns a date and time into Discord timestamps that show in everyone's own time zone. |
GET /v1/snowflake | When any Discord ID (user, server, message, channel) was created. |
GET /v1/plates | Random licence plates in your server's format, and a check for whether a plate fits it. |