https://github.com/eklavyadev/karljoke
A free and open-source API to fetch dad-jokes
https://github.com/eklavyadev/karljoke
api dadjokes hacktoberfest jokes
Last synced: 2 months ago
JSON representation
A free and open-source API to fetch dad-jokes
- Host: GitHub
- URL: https://github.com/eklavyadev/karljoke
- Owner: eklavyadev
- License: mit
- Created: 2021-09-18T10:58:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-04T16:34:35.000Z (8 months ago)
- Last Synced: 2025-02-28T06:10:35.666Z (3 months ago)
- Topics: api, dadjokes, hacktoberfest, jokes
- Language: HTML
- Homepage:
- Size: 319 KB
- Stars: 24
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KarlJoke
NOTE:- OUTDATED API, CURRENTLY INACTIVE. PLEASE MOVE TO https://github.com/15Dkatz/official_joke_apiA free and open-source API to fetch dadjokes
Inspired from https://github.com/15Dkatz/official_joke_api
Since the creators are not accepting PRs' and also the server is unavailable, we have a new system in place as an alternative 🚀
## Public Endpoints
#### Get a random joke
```http
GET /jokes/random
```
#### Get ten random jokes```http
GET /jokes/ten
```
#### Get number of random jokes```http
GET /jokes/{number}
```| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `number` | `int` | **Required**. Number of jokes to fetch |#### Get random joke by type
```http
GET /jokes/{type}/random
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `type` | `string` | **Required**. Category of joke |#### Get number of random jokes by type
```http
GET /jokes/{type}/{number}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `type` | `string` | **Required**. Category of joke |
| `number` | `int` | **Required**. Number of jokes to fetch |
## Authors- [Eklavya Chandra](https://www.github.com/eklavyadev)
## ContributingContributions are always welcome!
### Implement jokes.json with this structure
```
},
{
"id": last joke id + 1,
"type": "Your category here",
"setup": "Your joke here",
"punchline": "Your punchline here"
}
```Please adhere to this project's `code of conduct`.
## Run LocallyClone the project
```bash
git clone https://github.com/eklavyadev/karljoke.git
```Go to the project directory
```bash
cd karljoke
```Install dependencies
```bash
npm install
```Start the server
```bash
npm run start
```