Welcome to the Joke API! This API allows you to retrieve random jokes and one-liners from two different databases. Below is the documentation to help you understand how to use the API effectively.
The base URL for the API is http://localhost:3000. Make sure to prefix all endpoint paths with this base URL.
/api/singlelinerGETresult (optional): Number of jokes to retrieve (default is 1).id (optional): Retrieve a specific joke by ID.password (optional but required for result > MAX_RESULTS): Password for secure access./api/jokesGETresult (optional): Number of jokes to retrieve (default is 1).id (optional): Retrieve a specific joke by ID.password (optional but required for result > MAX_RESULTS): Password for secure access./api/randomGETcurl http://localhost:3000/api/singleliner
curl http://localhost:3000/api/jokes?result=3
curl http://localhost:3000/api/random
curl http://localhost:3000/api/jokes?id=42&password=your_password
In case of an error, the API will return a JSON response with a success field set to false and an error field providing a descriptive error message.
password parameter when required.Feel free to experiment with the API and integrate it into your projects. If you encounter any issues or have questions, please refer to the GitHub repository or open an issue. Happy joking!