NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

Riddles API

The Riddles API provides quality riddles perfect for entertainment apps.

(4.5)

From 2,882 users

2,800+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
357ms383ms447ms738ms1075ms

Didn't find what you were looking for? Suggest an improvement


/v1/riddles GET

https://api.api-ninjas.com/v1/riddles

Returns one or more random riddles.

PlanAvailable Riddles
Free100 riddles
PremiumMore than 10,000 riddles

Parameters

  • limit  optional premium only

    Number of results to return. Must be between 1 and 20. Default is 1.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of riddle objects, each containing the following fields, or an error if the request is unsuccessful.

  • title

    The title or name of the riddle

  • question

    The riddle question.

  • answer

    The answer to the riddle.

Sample Request Live Demo!

limit premium

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/riddles

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
[
    {
      title:"What Is It",
      question:"what is naked in the winter and dressed at summer and keeps on repeating this pattern?",
      answer:"a tree"
    }
]

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/riddles" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the Riddles API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • Use the optional limit parameter on the /v1/riddles endpoint to request between 1 and 20 riddles at once (the default is 1). The limit parameter is a premium feature, so a paid plan is required to return more than one riddle per call.
  • Each riddle in the returned JSON array contains a title (the name of the riddle), a question (the riddle text), and an answer (the solution). If a request fails, the response is an error instead of a riddle array.
  • The free tier provides access to 100 riddles, while premium plans unlock more than 10,000 riddles. The endpoint returns a random selection on each call, making it well suited for quiz or trivia features.
  • Riddles works nicely alongside other lighthearted content endpoints such as the Jokes, Dad Jokes, and Trivia APIs to build a richer entertainment experience.