https://official-joke-api.appspot.com/random_joke
https://official-joke-api.appspot.com/jokes/random
https://official-joke-api.appspot.com/types
https://official-joke-api.appspot.com/random_ten
https://official-joke-api.appspot.com/jokes/ten
Usage: https://official-joke-api.appspot.com/jokes/random/<any-number>
For example:
- https://official-joke-api.appspot.com/jokes/random/5
- https://official-joke-api.appspot.com/jokes/random/25
- https://official-joke-api.appspot.com/jokes/random/250
The endpoints are jokes/:type/random
or jokes/:type/ten
. For example:
https://official-joke-api.appspot.com/jokes/programming/random
https://official-joke-api.appspot.com/jokes/programming/ten
Use endpoint /jokes/:id
The majority of these jokes were contributed by joke-loving coders around the world!
Submit a Pull Request, with your joke added to the jokes/index.json file. Make sure the joke is in this format:
{
"type": "programming",
"setup": "What's the best thing about a Boolean?",
"punchline": "Even if you're wrong, you're only off by a bit."
}
- Clone the repo
npm i && npm run dev
- Visit
localhost:3005/jokes/random
orlocalhost:3005/jokes/ten
on your browser