Skip to content

As the Name tells this is Dark jokes API, returns dark jokes collected from various sources.

License

Notifications You must be signed in to change notification settings

qa-p1/Dark-Jokes-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Dark Jokes API Documentation

alt text

Table of Contents

Introduction

Welcome to the Joke API! This API provides a collection of jokes in JSON format. You can access the jokes through various endpoints, which are described below. These are just not meant to hurt anyone's emotion!!

API Endpoints

/

Just the root page nothing special just the app intro.

Response:

{
  "message": "Welcome to the Dark Jokes API. This api is created by none other than me. Visit our Github page for more Documentation: https://github.com/your-username/joke-api"
}

/random

This endpoint returns a random selection of jokes. The 'limit' parameter specifies the maximum number of jokes to return. Maximum limit is 20.

Example Request:

GET /random?limit=3

Example Response:

[
  {
    "id": 26,
    "joke": "  What's the difference between baby's and onions? I cry when cutting onions!"
  },
  {
    "id": 119,
    "joke": "How much time does it takes to fill a hole on the road?    Decades Lol"
  },
  {
    "id": 129,
    "joke": "Any joke can be funny when delivered right. Except abortion jokes, cause there's no delivery. "
  }
]

/joke-by-id

This endpoint returns a joke by its ID. If the ID is less than or equal to 0, an error message is returned. If the joke with the specified ID does not exist, an error message is returned.

Example Request:

GET /joke-by-id?id=5

Example Response:

{
    "joke": "Karate for amputees is called partial arts",
    "id": 5,
    "from": "reddit",
    "type": "dark"
}

/search

This endpoint searches for jokes containing the specified query. If no jokes are found matching the query, an error message is returned.

Example Request:

GET /search?query=black

Example Response:

[
  {
    "id": 10,
    "joke": "Why do black people have white palms and white bottoms of there feet?  Because there's a little good in everyone."
  },
  {
    "id": 11,
    "joke": "Why do black men cry after sex?  The pepper spray."
  },
  {
    "id": 29,
    "joke": "Sir, this is a gloryhole. We're going black then."
  },
  {
    "id": 48,
    "joke": "Why is there only two handles on a black persons casket?   Have you ever seen a trash can with more than two handles?"
  },
  {
    "id": 101,
    "joke": "What's the difference between a black man and a tractor tyre? The tyre doesn't sing when you put chains on it."
  }
]

Contributing

We welcome contributions to the Dark Joke API! Majorly If have any dark jokes available submit it. If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

About

As the Name tells this is Dark jokes API, returns dark jokes collected from various sources.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published