API offers a diverse collection of riddles across various categories, including science, who-am-i, math, mystery, funny and logic.Integrate our API into your application to provide users with endless fun and intellectual stimulation.
Welcome to the Riddles API! This API provides a collection of riddles across various categories including funny, math, logic, and mystery. It’s a fun way to challenge your mind and entertain yourself or your users with interesting riddles.
https://riddles-api-eight.vercel.app/{ category }
Funny Riddles: /funny
Math Riddles: /math
Logic Riddles: /logic
Mystery Riddles: /mystery
Science Riddles: /science
Method | Endpoint | Description |
---|---|---|
GET | /category | Retrieve specific riddle |
GET | /category/number | Get specified no. of riddles. |
POST | /category | Add a new riddle. |
PATCH | /category/id | Update an existing riddle. |
DELETE | /category/id | Deletes an existing riddle. |
Retrive riddles of science catefory
https://riddles-api-eight.vercel.app/science
{
"riddle": "string",
"answer": "string",
"category": "string"
}
https://riddles-api-eight.vercel.app/science/100
{
"riddlesArray": ["riddleQuestions"],
"answer": "string",
"category": "string"
}
POST/{ category }
https://riddles-api-eight.vercel.app/{category}
{
"message": "Riddle posted successfully",
"riddleQuestion": "riddleQuestion._id"
}
Clone the repository:
git clone https://github.com/Thiru-kumaran-R/Riddles-API.git
Go to project folder:
cd project
Start the server:
npm start
In case of any error, the API will return a JSON response with an appropriate status code and error message
Example
{
"message": "No such route exits",
"status": 404
}