Sample Bot API
Docs menu

Sample Bot API

The ER:LC tools an app needs again and again, as JSON.

This is for developers. The API is for people building their own bots, websites or apps. If you do not write code, you do not need it: every tool here also works in your browser, for free, at samplebot.app/tools.

Base URL

https://api.samplebot.app/v1

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

LimitPer key
Per minute60 requests
Per day10,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." } }
StatusMeans
400Something in your request is missing or wrong. The message says what.
401No key, or a key that does not exist or was deleted.
404Not found: an unknown endpoint, postal or user.
405Wrong method: that endpoint takes a POST.
429Over the rate limit. Wait for Retry-After seconds.
503Something we depend on (Roblox, PRC) is limiting us. Try again shortly.

Endpoints

EndpointWhat it does
GET /v1/postalFind any Liberty County postal and the road it is on.
GET /v1/routeTurn-by-turn directions by road between two postals, the same way AI dispatch gives them.
GET /v1/erlc-statusChecks PRC's ER:LC API right now and says whether it is answering.
GET /v1/roblox-userA Roblox username to its user ID and back, with display name and join date.
GET /v1/timestampTurns a date and time into Discord timestamps that show in everyone's own time zone.
GET /v1/snowflakeWhen any Discord ID (user, server, message, channel) was created.
GET /v1/platesRandom licence plates in your server's format, and a check for whether a plate fits it.