The Jokes API provides access to a growing collection of jokes, including categories, search capabilities and random joke retrieval.
/api/jokes/[action]/[object]
| Endpoint | Description |
|---|---|
/api/jokes |
List jokes. |
/api/jokes/random |
Random joke. |
/api/jokes/id/{id} |
Lookup joke by ID. |
/api/jokes/type/{type} |
List jokes by type. |
/api/jokes/types |
List available joke types. |
/api/jokes/search/{query} |
Search jokes. |
/api/jokes/recent |
Recently added jokes. |
/api/jokes/count |
Database statistics. |
| Parameter | Example | Description |
|---|---|---|
limit |
25 | Maximum results returned. |
type |
dad | Filter by joke type. |
active |
true | Return active jokes only. |
GET /api/jokes
GET /api/jokes?limit=50
GET /api/jokes/random
GET /api/jokes/random?type=programming
GET /api/jokes/id/42
GET /api/jokes/type/dad
GET /api/jokes/type/programming
GET /api/jokes/types
GET /api/jokes/search/chicken
GET /api/jokes/recent?limit=10
GET /api/jokes/count
{
"id": 42,
"type": "programming",
"setup": "Why do programmers prefer dark mode?",
"punchline": "Because light attracts bugs.",
"active": true,
"created_at": "2026-11-04T00:00:00+00:00",
"updated_at": "2026-11-04T00:00:00+00:00"
}
[
{
"type": "dad",
"joke_count": 250
},
{
"type": "programming",
"joke_count": 180
},
{
"type": "knock-knock",
"joke_count": 95
}
]
{
"total": 1250,
"active": 1220,
"inactive": 30,
"types": 12
}
All Jarvis APIs require a valid API token. Tokens are issued through the Jarvis Developer Portal and are associated with an account plan which determines access levels and request limits.
Every request must include a valid API token. Requests made without a token or with an invalid token will be rejected.
Authorization: YOUR_API_TOKEN
X-API-Token: YOUR_API_TOKEN
GET /api/flags/random?token=YOUR_API_TOKEN
curl \
-H "Authorization: YOUR_API_TOKEN" \
https://jarvisbot.uk/api/flags/random
fetch("https://jarvisbot.uk/api/jokes/random", {
headers: {
"Authorization": "YOUR_API_TOKEN"
}
})
.then(r => r.json())
.then(console.log);
$response = file_get_contents(
"https://jarvisbot.uk/api/questions/random",
false,
stream_context_create([
'http' => [
'header' => [
'Authorization: YOUR_API_TOKEN'
]
]
])
);
$data = json_decode($response, true);
| Plan | Daily Requests | API Access |
|---|---|---|
| Free | 100 Requests | Basic APIs |
| Premium | 10,000 Requests | All APIs |
| Enterprise | Unlimited | All APIs + Priority Support |
API usage is automatically monitored based on your account type. Once your limit is reached, requests will be temporarily blocked until your allowance resets.
| Plan | Limit | Window |
|---|---|---|
| Free | 100 Requests | 24 Hours |
| Premium | 10,000 Requests | 24 Hours |
| Enterprise | Unlimited | No Restriction |
{
"success": false,
"error": "invalidToken",
"msg": "API token required"
}
{
"success": false,
"error": "invalidToken",
"msg": "Invalid API token"
}
{
"success": false,
"error": "rateLimit",
"msg": "API limit exceeded",
"plan": "free",
"limit": 100
}