Docs/APIs/Random Pun

Random Pun

Get random puns

OperationalCredits 1 per callp50 104msEntertainmentStar

Overview

Puns are drawn from a stored joke collection. Each request picks an entry at random, with no weighting and no memory of earlier calls, so repeats are possible and two calls in a row can return the same joke. Entries without text are skipped; if none turns up after 50 picks the request fails with a 500 rather than looping.

The joke text is returned in `pun` with line breaks replaced by spaces, so multi-line jokes arrive as one line ready for display, and double quotes swapped for single quotes. The collection holds about 1,500 one-line puns of 140 characters or less, screened for profanity and adult themes. `category` is one topic: Food, Animals, Science, Math, Music, Technology, Work, Family, Sports, Words or General. `rating` (paid) is a 1 to 5 popularity score from how often the pun recurs across the source joke archive (5 is the most reposted); it is stored with the entry, not computed per request.

Live Test Random Pun API →

Endpoint

One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.

GEThttps://api.apiverve.com/v1/randompun
curl "https://api.apiverve.com/v1/randompun" \
  -H "x-api-key: your_api_key_here"

Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.

Authentication

Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.

401 is the only auth verdict

A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.

Response

Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.

Sample response
{
  "status": "ok",
  "error": null,
  "data": {
    "category": "Family, Parents",
    "rating": 2,
    "pun": "There was this guy who decided he wanted to live with his gay friends in a nudest colony and so he up and quit his job, and moved. He was really happy until he got a letter from his grandma. She told…"
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
categorystring"Family, Parents"Category or theme of the pun content
ratingPremiumnumber2Popularity score from 1 to 5, based on how often the pun recurs across the source joke archive
punstring"There was this guy who decided he wanted to live with his gay friends in a nudest colony and so he u…"Full text of the random pun

Errors

Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.

StatusMeaningWhat to do
400Input was rejectedRead error; it names the parameter.
401Key missing or invalidCheck the header name and the key value.
403Key valid, but not permittedA key restriction or IP allow-list; see key scoping.
429Rate limited, or out of creditsRead error to tell them apart; see rate limits.

Use cases

Daily Standup Icebreakers
Chat bots send a pun and category to team channels every morning to start meetings with a quick laugh.
Gaming Loading Screens
To keep players entertained during long loading screens, video games fetch a pun to show between levels.
Newsletter Footer Jokes
Email newsletters inject a fresh joke into the footer section of automated weekly subscriber digests.
Smart Speaker Skills
When users ask for humor, smart speaker apps pull pun text to read aloud over audio.

Other ways to use Random Pun

Set up Random Pun on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.

Give it to an AI agentConnect over MCP and your agent calls it as a native tool — Claude, Cursor, ChatGPT.VerveKit →Reference →

More in Entertainment:

Was this page helpful?