https://github.com/15Dkatz/official_joke_api
Official Joke API!
https://github.com/15Dkatz/official_joke_api
Last synced: 7 months ago
JSON representation
Official Joke API!
- Host: GitHub
- URL: https://github.com/15Dkatz/official_joke_api
- Owner: 15Dkatz
- License: mit
- Created: 2017-03-24T04:37:30.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-07-13T00:05:16.000Z (almost 2 years ago)
- Last Synced: 2024-07-13T23:51:18.821Z (almost 2 years ago)
- Language: JavaScript
- Homepage: https://davidtkatz.com
- Size: 1.27 MB
- Stars: 807
- Watchers: 21
- Forks: 343
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
- awesome-serverless - Official joke API - Vue Jokester application backend. (Projects)
- Awesome-API-Provider - Jokes
README
# Official Joke API
## Endpoints:
### Grab a random joke
[https://official-joke-api.appspot.com/random_joke](https://official-joke-api.appspot.com/random_joke)
[https://official-joke-api.appspot.com/jokes/random](https://official-joke-api.appspot.com/jokes/random)
### Get joke types
[https://official-joke-api.appspot.com/types](https://official-joke-api.appspot.com/types)
### Grab ten random jokes
[https://official-joke-api.appspot.com/random_ten](https://official-joke-api.appspot.com/random_ten)
[https://official-joke-api.appspot.com/jokes/ten](https://official-joke-api.appspot.com/jokes/ten)
### Grab any number of random jokes
Usage: `https://official-joke-api.appspot.com/jokes/random/`
For example:
* [https://official-joke-api.appspot.com/jokes/random/5](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/25)
* [https://official-joke-api.appspot.com/jokes/random/250](https://official-joke-api.appspot.com/jokes/random/250)
### Grab jokes by type
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/random)
[https://official-joke-api.appspot.com/jokes/programming/ten](https://official-joke-api.appspot.com/jokes/programming/ten)
### Grab joke by id
Use endpoint `/jokes/:id`
***
## How these jokes were collected
The majority of these jokes were contributed by joke-loving coders around the world!
### Make a contribution!
Submit a Pull Request, with your joke added to the jokes/index.json file. Make sure the joke is in this format:
```javascript
{
"type": "programming",
"setup": "What's the best thing about a Boolean?",
"punchline": "Even if you're wrong, you're only off by a bit."
}
```
***
### Run Locally
* Clone the repo
* `npm i && npm run dev`
* Visit `localhost:3005/jokes/random` or `localhost:3005/jokes/ten` on your browser