Roleplay
Plate generator
Random licence plates in your server's format, and a check for whether a plate fits it.
GEThttps://api.samplebot.app/v1/plates
Prefer a button to click? This tool also works in your browser at samplebot.app/tools/plates.
Parameters
| Name | Description | Default |
|---|---|---|
format | Format (X letter, 9 digit). | XXX-999 |
count | How many plates. | 10 |
check | A plate to check against the format. |
Send them as query parameters.
Example request
curl
curl "https://api.samplebot.app/v1/plates?format=XXX-999&count=3&check=ABC-123" \
-H "Authorization: Bearer $SAMPLE_API_KEY"
JavaScript (Node 18+)
const res = await fetch("https://api.samplebot.app/v1/plates?format=XXX-999&count=3&check=ABC-123", {
headers: { Authorization: `Bearer ${process.env.SAMPLE_API_KEY}` },
});
const { ok, data, text, error } = await res.json();
if (!ok) throw new Error(error.message);
console.log(data);
Python
import os, requests
res = requests.get(
"https://api.samplebot.app/v1/plates",
params={"format":"XXX-999","count":3,"check":"ABC-123"},
headers={"Authorization": f"Bearer {os.environ['SAMPLE_API_KEY']}"},
)
print(res.json()["data"])
Example reply
This is the real reply to the example request. Long lists are shortened here.
{
"ok": true,
"tool": "plates",
"data": {
"format": "XXX-999",
"plates": [
"EPP-309",
"JSG-560",
"JCN-832"
],
"check": {
"plate": "ABC-123",
"fits": true
}
},
"text": "EPP-309\nJSG-560\nJCN-832\n\nABC-123 fits XXX-999."
}
Using it in your app
Read data for the values, or post text as it is: it is already formatted for Discord. Check ok first: when it is false, error.message says what went wrong in words you can show your users. Keep your key on your server, never in a web page or a Roblox game.