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
- Endpoint to get funny riddles that will tickle your funny bone.
-
Math Riddles:
/math
- Endpoint to get math-related riddles that will test your mathematical skills.
-
Logic Riddles:
/logic
- Endpoint to get logic-based riddles that will make you think outside the box.
-
Mystery Riddles:
/mystery
- Endpoint to get mysterious riddles that will keep you guessing.
-
Science Riddles:
/science
- Endpoint to get science riddles that incorporate scientific concepts or phenomena..
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
}