API Documentation

Endpoints

GET a Random Pun

Retrieve a random pun from our collection

Request TypeURL
GEThttps://punapi.rest/api/pun

Parameters

NameTypeDescription
none------------------

Request Example

Response Example

200
{
  "id": "23  "
  "pun": "I went to a seafood disco last week... and pulled a mussel."
}

GET Pun BY ID

Retrieve a specific pun by providing its unique identifier (ID).

Request TypeURL
GEThttps://punapi.rest/api/pun?id={id}

Parameters

NameTypeDescription
idintThe ID of the pun. This ID can be found in the Search page.

Request Example

Response Example

200
{
  "id": "2"
  "pun": "I would avoid the sushi if I was you. It’s a little fishy."
}

GET Pun(s) by Pagination

Retrieve a pun(s) by providing a page. Fixed to 10 puns per page.

Request TypeURL
GEThttps://punapi.rest/api/pun/pagination?{page}

Parameters

NameTypeDescription
pageintThe page number

Request Example

Response Example

200
[
  {
    "id": 11,
    "pun": "My cat was just sick on the carpet, I don’t think it’s feline well."
  },
  {
    "id": 12,
    "pun": "Why did the octopus beat the shark in a fight? Because it was well armed."
  },
  {
    "id": 13,
    "pun": "How much does a hipster weigh? An instagram."
  },
  {
    "id": 14,
    "pun": "What did daddy spider say to baby spider? You spend too much time on the web."
  },
  {
    "id": 15,
    "pun": "Atheism is a non-prophet organisation."
  },
  {
    "id": 16,
    "pun": "There’s a new type of broom out, it’s sweeping the nation."
  },
  {
    "id": 17,
    "pun": "What cheese can never be yours? Nacho cheese."
  },
  {
    "id": 18,
    "pun": "What did the Buffalo say to his little boy when he dropped him off at school? Bison."
  },
  {
    "id": 19,
    "pun": "Have you ever heard of a music group called Cellophane? They mostly wrap."
  },
  {
    "id": 20,
    "pun": "Why does Superman gets invited to dinners? Because he is a Supperhero."
  }
]

GET Pun(s) by Searching

Retrieve a pun(s) by searching

Request TypeURL
GEThttps://punapi.rest/api/pun/search?{query}

Parameters

NameTypeDescription
querystringKey words that you are looking for

Request Example

Response Example

200
[{
  "id": "4"
 "pun": "Why did the cookie cry? Because his father was a wafer so long!"
}]

GET Pun Meme

Retrieve a random pun meme.

Request TypeURL
GEThttps://punapi.rest/api/meme

Parameters

NameTypeDescription
none------------------

Request Example

Response Example

200
{
  "meme": "https://b085hi8rvymugnvm.public.blob.vercel-storage.com/2-bJZtO1TbX8MRhbK4Cx5UFkxHxNjz2C.jpg"
}
GET https://b085hi8rvymugnvm.public.blob.vercel-storage.com/2-bJZtO1TbX8MRhbK4Cx5UFkxHxNjz2C.jpg