The riddles API returns a random riddle or brain-teaser. Riddles are a great way to exercise your brain and keep it sharp. The API supports brain-teasers in three difficulty levels: easy, medium, and hard. You can also get a random riddle without specifying a difficulty level.
| Name | Example | Description |
|---|---|---|
difficulty | easy | The difficulty of the riddle, either "easy", "medium", or "hard". |
api-key | abcd1234 | Your API key. |
{
"riddle": "What has 13 hearts but no other organs?",
"answer": "A deck of cards",
"difficulty": "easy"
} Copy Code
curl -X GET 'https://api.apileague.com/retrieve-random-riddle?difficulty=easy' \ -H 'x-api-key: myapikey'
Response Headers:
Content-Type: application/jsonX-API-Quota-Request: The number of tokens used by the requestX-API-Quota-Used: The number of tokens used in total todayX-API-Quota-Left: The number of tokens left today (depends on your plan)You can request riddles with "easy", "medium", or "hard" difficulty levels to suit your audience.
Yes, every riddle returned by the API includes the correct answer so you can verify the solution.
Yes, by selecting the "easy" difficulty, you can retrieve riddles that are generally more suitable for children.
The Random Riddle API provides brain-teasers and puzzles that require lateral thinking, whereas the Random Trivia API returns factual questions and interesting facts.