Overview
With no parameters, returns one random riddle. `category` and `difficulty` narrow the pool and `matching` says how many riddles were in it; `count` (paid) returns up to 20 different riddles at once. `id` returns one specific riddle, so an app can show the question and reveal the answer on a later call. An empty pool returns 404.
The collection was curated by APIVerve from five public-domain books on Project Gutenberg (ebooks 52598, 32898, 36571, 69528 and 44099). Gutenberg's header and licence were stripped, question-and-answer passages extracted, and about 500 riddles kept by hand: offensive, dated or reference-dependent ones were dropped, spelling lightly modernised (to-day to today) and each riddle given a category and a difficulty.
Many classic conundrums are puns. Where the book printed the sound-alike in brackets, it is moved out of the answer into `explanation`, so `Tulips (two lips)` becomes answer `Tulips.` with explanation `two lips`; it is null when the answer stands alone. Difficulty is an editorial rating: easy riddles have a plain answer a child could find, hard ones turn on wordplay or a less common word.
Endpoint
One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.
curl "https://api.apiverve.com/v1/riddles?category=animals&difficulty=easy&id=rdl-0042&count=5" \
-H "x-api-key: your_api_key_here"const res = await fetch('https://api.apiverve.com/v1/riddles?category=animals&difficulty=easy&id=rdl-0042&count=5', {
headers: { 'x-api-key': 'your_api_key_here' },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const { data } = await res.json();
console.log(data);import requests
res = requests.get(
"https://api.apiverve.com/v1/riddles?category=animals&difficulty=easy&id=rdl-0042&count=5",
headers={"x-api-key": "your_api_key_here"},
timeout=15,
)
res.raise_for_status()
print(res.json()["data"])package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.apiverve.com/v1/riddles?category=animals&difficulty=easy&id=rdl-0042&count=5", nil)
req.Header.Set("x-api-key", "your_api_key_here")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.
Authentication
Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.
A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.
Parameters
Sent in the query string. Premium parameters are accepted on every plan but only take effect on plans that include them.
| Parameter | Type | Description |
|---|---|---|
categoryOptional | string | Riddle categoryanimalsbodyclassicfoodhouseholdmusicnaturenumbers+5 |
difficultyOptional | string | Riddle difficultyeasymediumhard |
idOptional | string | A riddle id from an earlier response, e.g. rdl-0042, to fetch that riddle again length 0–12 |
countOptionalPremium | integer | Number of different riddles to return, 1 to 20. Free plans get 1 range 1–20 |
Response
Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.
{
"status": "ok",
"error": null,
"data": {
"matching": 1,
"count": 1,
"riddles": [
{
"id": "rdl-0002",
"riddle": "What flowers can be found between the nose and chin?",
"answer": "Tulips.",
"explanation": "two lips",
"category": "body",
"difficulty": "easy",
"source": {
"title": "Conundrums, Riddles and Puzzles",
"author": "Dean Rivers",
"year": 1903
}
}
]
}
}
Response fields
Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.
| Field | Type | Example | Description |
|---|---|---|---|
matching | number | 1 | Riddles in the collection that match the filters |
count | number | 1 | Riddles in this response |
riddles | array[1] | The randomly chosen riddles | |
id | string | "rdl-0002" | Stable riddle id, e.g. rdl-0042 |
riddle | string | "What flowers can be found between the nose and chin?" | The riddle question |
answer | string | "Tulips." | The answer |
explanationPremium | string | "two lips" | The sound-alike or hidden word a pun answer turns on, e.g. two lips for Tulips; null when the answer needs none |
category | string | "body" | Category: animals, body, classic, food, household, music, nature, numbers, people, places, time, travel or words |
difficulty | string | "easy" | easy, medium or hard |
source | object | {...} | The public-domain book the riddle comes from |
titlePremium | string | "Conundrums, Riddles and Puzzles" | Book title |
authorPremium | string | "Dean Rivers" | Author or publisher |
yearPremium | number | 1903 | Year of publication |
Errors
Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.
| Status | Meaning | What to do |
|---|---|---|
400 | Input was rejected | Read error; it names the parameter. |
401 | Key missing or invalid | Check the header name and the key value. |
403 | Key valid, but not permitted | A key restriction or IP allow-list; see key scoping. |
429 | Rate limited, or out of credits | Read error to tell them apart; see rate limits. |
Use cases
- Riddle of the Day Widgets
- Show a new riddle each day on a site or app, then reveal the answer with the same id the next day.
- Kids and Family Apps
- Serve easy riddles about animals, food and household things for car rides, classrooms and bedtime.
- Chat Bots and Voice Assistants
- Answer 'tell me a riddle' with a random question, wait for a guess, then give the answer and the pun behind it.
- Party Games and Newsletters
- Pull a batch of riddles by category for a quiz round, an icebreaker or a newsletter puzzle corner.
Other ways to use Riddles
Set up Riddles on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.
Related
More in Entertainment: