# Humor API: full reference > The complete Humor API reference in one Markdown file. Human-readable version: https://humorapi.com/docs/. OpenAPI 3 spec: https://humorapi.com/downloads/humorapi-openapi-3.json. ## Authentication Every request needs an API key. Get a free key by signing up at https://humorapi.com/console/. Send it as the `api-key` query parameter (`https://api.humorapi.com/jokes/random?api-key=YOUR_API_KEY`) or in the `x-api-key` header. ## Rate limits and quotas Each plan has a daily quota of points. A request usually costs 1 point plus 0.01 points per result returned; each endpoint below states its cost. The quota resets at midnight UTC. On the free plan the API answers 402 when the quota is used up; paid plans bill extra points. Too many requests per second get a 429. Response headers: `X-API-Quota-Request` (points used by the request), `X-API-Quota-Used` (points used today), `X-API-Quota-Left` (points left today). ## Plans - **Free**: $0/month, 10 points/day, then no more calls until the daily reset, 1 request/second, forum support, backlink to humorapi.com required - **Jack**: $3/month, 100 points/day, then $0.008 per point, 2 requests/second, forum support - **Jester**: $9/month, 1,000 points/day, then $0.007 per point, 5 requests/second, email support - **Joker**: $29/month, 4,000 points/day, then $0.005 per point, 10 requests/second, email support ## Joke categories Use these tag values with `include-tags` and `exclude-tags` (comma-separated): - Clean: `clean` - Animal: `animal` - Food: `food` - Sexual: `sexual` - Knock Knock: `knock_knock` - Sport: `sport` - Blondes: `blondes` - Law: `law` - Nerdy: `nerdy` - Relationship: `relationship` - Deep Thoughts: `deep_thoughts` - Dark: `dark` - One Liner: `one_liner` - Political: `political` - Chuck Norris: `chuck_norris` - Yo Momma: `yo_mama` - NSFW: `nsfw` - Religious: `religious` - School: `school` - Jewish: `jewish` - Racist: `racist` - Insults: `insults` - Sexist: `sexist` - Holiday: `holiday` - Analogy: `analogy` - Christmas: `christmas` - Kids: `kids` For family-friendly results, exclude `nsfw,dark,racist,sexist,sexual` or include only `clean`. ## Endpoints ### Search Jokes `GET https://api.humorapi.com/jokes/search` With over 50,000 jokes, you should find something for any occasion. There are [27 categories](https://humorapi.com/docs/#joke-categories) to choose from but you can also search for very specific words within jokes. | Parameter | In | Required | Type | Example | Description | |---|---|---|---|---|---| | `keywords` | query | no | string | airplane | A comma-separated list of words that must occur in the joke. | | `include-tags` | query | no | string | animal | A comma-separated list of tags the jokes should have. | | `exclude-tags` | query | no | string | nsfw,dark | A comma-separated list of tags the jokes must not have. | | `min-rating` | query | no | number | 0 | The minimum rating (0-10) of the jokes. | | `max-length` | query | no | number | 140 | The maximum length of the joke in letters. | | `offset` | query | no | number | 0 | The number of jokes to skip, between 0 and 1000. | | `number` | query | no | number | 10 | The number of jokes, between 0 and 10. | | `api-key` | query | yes | string | abcd1234 | Your API key. | Example request: `GET https://api.humorapi.com/jokes/search?number=3&keywords=horse,man` Example response: ```json { "jokes": [ { "id": 35642, "joke": "A man walked into a cowboy bar and ordered a beer just as President Bush appeared on the television. After a few sips, he looked up at the television and mumbled, \"Now, there's the biggest horse's ass I've ever seen.\" A customer at the end of the bar quickly stood up, walked over to him, and decked him. A few minutes later, as the man was finishing his beer, Mrs. Bush appeared \n on the television. \"She's a horse's ass too,\" the man. This time, a customer at the other end of the bar quickly stood up, walked over \n to him, and knocked him off his stool. \"Damn it!\" the man said, climbing back up to the bar. \"This must be Bush country!\" \"Nope,\" the bartender replied. \"Horse country!\"" }, { "id": 39052, "joke": "The General went out to find that none of his G.I.s were there. One finally ran up, panting heavily.\"Sorry, sir! I can explain, you see I had a date and it ran a little late. I ran to the bus but missed it, I hailed a cab but it broke down, found a farm, bought a horse but it dropped dead, ran 10 miles, and now I`m here.\"The General was very skeptical about this explanation but at least he was here so he let the G.I. go. Moments later, eight more G.I.s came up to the general panting, he asked them why they were late.\"Sorry, sir! I had a date and it ran a little late, I ran to the bus but missed it, I hailed a cab but it broke down, found a farm, bought a horse but it dropped dead, ran 10 miles, and now I`m here.\"The General eyed them, feeling very skeptical but since he let the first guy go, he let them go, too. A ninth G.I. jogged up to the General, panting heavily.\"Sorry, sir! I had a date and it ran a little late, I ran to the bus but missed it, I hailed a cab but...\"\"Let me guess,\" the General interrupted, \"it broke down.\"\"No,\" said the G.I., \"there were so many dead horses in the road, it took forever to get around them.\"" }, { "id": 41701, "joke": "A man has a racehorse, never won a race. Man in disgust says, Horse, you win today or you pull a milk wagon tomorrow morning.\" The starting gate opens, the horses take-off, they move the gate away and there lays his horse asleep on the track. He kicks the horse and asks, \"WHY ARE YOU SLEEPING. The horse, half asleep says, \"I have to get up at three in the morning.\"" } ], "available": 541 } ``` Cost: 1 point per call. ### Random Joke `GET https://api.humorapi.com/jokes/random` This endpoint is similar to the [Search Jokes](https://humorapi.com/docs/#search-jokes) endpoint but you'll receive a random joke every time. | Parameter | In | Required | Type | Example | Description | |---|---|---|---|---|---| | `include-tags` | query | no | string | animal | A comma-separated list of tags the jokes should have. | | `exclude-tags` | query | no | string | nsfw,dark | A comma-separated list of tags the jokes must not have. | | `min-rating` | query | no | number | 0 | The minimum rating (0-10) of the jokes. | | `max-length` | query | no | number | 140 | The maximum length of the joke in letters. | | `api-key` | query | yes | string | abcd1234 | Your API key. | Example request: `GET https://api.humorapi.com/jokes/random` Example response: ```json { "id": 38242, "joke": "Q: How many divorced men does it take to screw in a light bulb?\nA: None, the sockets go with the house." } ``` Cost: 1 point per call. ### Create Joke `GET https://api.humorapi.com/jokes/create` Use a large language model to create a joke for a certain topic or even multiple topics. | Parameter | In | Required | Type | Example | Description | |---|---|---|---|---|---| | `topics` | query | no | string | airplane | A comma-separated list of topics that the joke should be about. | | `max-length` | query | no | number | 1000 | The maximum length of the joke in letters. | | `api-key` | query | yes | string | abcd1234 | Your API key. | Example request: `GET https://api.humorapi.com/jokes/create?topics=pirates` Example response: ```json { "joke": "What's a pirate's least favorite exercise? The plank." } ``` Cost: 1 point per call. ### Analyze Joke `POST https://api.humorapi.com/jokes/analyze` This endpoint analyzes and tags the joke. Example request: `POST https://api.humorapi.com/jokes/analyze` with the body: ``` What do you call a deer without eyes? No ideer. ``` Example response: ```json { "joke": "What do you call a deer without eyes? No ideer.", "tags": [ "ANIMAL" ] } ``` Cost: 1 point per call. ### Submit Joke `POST https://api.humorapi.com/jokes` Submit a joke to the database. Example request: `POST https://api.humorapi.com/jokes` with the body: ``` What do you call a deer without eyes? No ideer. ``` Example response: ```json { "joke": { "id": 52625, "joke": "What do you call a deer without eyes? No ideer.", "tags": [ "ANIMAL" ] }, "message": "Thanks for submitting the joke. We will evaluate the joke asap." } ``` Cost: 1 point per call. ### Upvote Joke `POST https://api.humorapi.com/jokes/{id}/upvote` Upvote a joke that is liked by you or your users. | Parameter | In | Required | Type | Example | Description | |---|---|---|---|---|---| | `id` | path | no | number | 123 | The id of the joke to vote. | | `api-key` | query | yes | string | abcd1234 | Your API key. | Example request: `POST https://api.humorapi.com/jokes/123/upvote` Example response: ```json { "message": "Thanks for submitting an upvote." } ``` Cost: 1 point per call. ### Downvote Joke `POST https://api.humorapi.com/jokes/{id}/downvote` Downvote a joke that you or your users don't like. | Parameter | In | Required | Type | Example | Description | |---|---|---|---|---|---| | `id` | path | no | number | 123 | The id of the joke to vote. | | `api-key` | query | yes | string | abcd1234 | Your API key. | Example request: `POST https://api.humorapi.com/jokes/123/downvote` Example response: ```json { "message": "Thanks for submitting a downvote." } ``` Cost: 1 point per call. ### Search Memes `GET https://api.humorapi.com/memes/search` With over 450,000 memes, you'll surely find something funny. You can even search for text within memes and filter by user ratings. | Parameter | In | Required | Type | Example | Description | |---|---|---|---|---|---| | `keywords` | query | no | string | airplane | A comma-separated list of words that must occur in the meme. | | `keywords-in-image` | query | no | boolean | true | Whether the keywords must occur in the image. | | `media-type` | query | no | string | image | The media type (either 'image', 'video' or even specific format such as 'jpg', 'png', or 'gif'). | | `min-rating` | query | no | number | 0 | The minimum rating (0-10) of the meme. | | `max-age-days` | query | no | number | 30 | The maximum age of the meme in days. | | `offset` | query | no | number | 0 | The number of memes to skip, between 0 and 1000. | | `number` | query | no | number | 10 | The number of memes, between 0 and 10. | | `api-key` | query | yes | string | abcd1234 | Your API key. | Example request: `GET https://api.humorapi.com/memes/search?number=3&keywords=rocket` Example response: ```json { "memes": [ { "id": 6696, "url": "https://i.imgur.com/1rmAxUG.jpg", "type": "image/jpeg" }, { "id": 6697, "url": "https://i.imgur.com/ELT8zMQ.jpg", "type": "image/jpeg" }, { "id": 6698, "url": "https://i.imgur.com/8JTc5z3.jpg", "type": "image/jpeg" } ], "available": 32 } ``` Cost: 1 point per call. ### Random Meme `GET https://api.humorapi.com/memes/random` Get a random meme out of over 450,000 memes and growing. | Parameter | In | Required | Type | Example | Description | |---|---|---|---|---|---| | `keywords` | query | no | string | airplane | A comma-separated list of words that must occur in the meme. | | `keywords-in-image` | query | no | boolean | true | Whether the keywords must occur in the image. | | `media-type` | query | no | string | image | The media type (either 'image', 'video' or even specific format such as 'jpg', 'png', or 'gif'). | | `min-rating` | query | no | number | 0 | The minimum rating (0-10) of the meme. | | `max-age-days` | query | no | number | 30 | The maximum age of the meme in days. | | `api-key` | query | yes | string | abcd1234 | Your API key. | Example request: `GET https://api.humorapi.com/memes/random?keywords=rocket` Example response: ```json { "id": 50561, "url": "https://preview.redd.it/hg0zn2mhjsh01.png?width=640&crop=smart&auto=webp&s=f19b0a87edfc6c71b35ec9aceb64799cd532ff59", "type": "image/png" } ``` Cost: 1 point per call. ### Upvote Meme `POST https://api.humorapi.com/memes/{id}/upvote` Upvote a meme that you or your users like. | Parameter | In | Required | Type | Example | Description | |---|---|---|---|---|---| | `id` | path | no | number | 123 | The id of the meme to vote. | | `api-key` | query | yes | string | abcd1234 | Your API key. | Example request: `POST https://api.humorapi.com/memes/123/upvote` Example response: ```json { "message": "Thanks for submitting an upvote." } ``` Cost: 1 point per call. ### Downvote Meme `POST https://api.humorapi.com/memes/{id}/downvote` Downvote a meme that you or your users like. | Parameter | In | Required | Type | Example | Description | |---|---|---|---|---|---| | `id` | path | no | number | 123 | The id of the meme to vote. | | `api-key` | query | yes | string | abcd1234 | Your API key. | Example request: `POST https://api.humorapi.com/memes/123/downvote` Example response: ```json { "message": "Thanks for submitting a downvote." } ``` Cost: 1 point per call. ### Search Gifs `GET https://api.humorapi.com/gif/search` Search through hundreds of thousands of gifs to match any reaction you want. | Parameter | In | Required | Type | Example | Description | |---|---|---|---|---|---| | `query` | query | yes | string | dog | A query to search for. | | `number` | query | no | number | 10 | The number of gifs, between 1 and 10. | | `api-key` | query | yes | string | abcd1234 | Your API key. | Example request: `GET https://api.humorapi.com/gif/search?query=dog&number=3` Example response: ```json { "images": [ { "url": "https://static.klipy.com/ii/a15b48460c436e1e92c85ffc680932cc/3c/4c/2mJn9yWc.gif", "width": 640, "height": 610 }, { "url": "https://static.klipy.com/ii/2711dd8a75a85be822d136ec94899b3f/df/25/rVPMO3Km.gif", "width": 640, "height": 640 }, { "url": "https://static.klipy.com/ii/4e7bea9f7a3371424e6c16ebc93252fe/7b/87/eMP7ArRedjmII0YSb.gif", "width": 311, "height": 373 } ] } ``` Cost: 1 point per call. ### Praise `GET https://api.humorapi.com/praise` Praise somebody for something. | Parameter | In | Required | Type | Example | Description | |---|---|---|---|---|---| | `name` | query | yes | string | Alex | The name of the person to be praised/insulted. | | `reason` | query | yes | string | You dropped the ball | The reason the person is praised/insulted for. | | `api-key` | query | yes | string | abcd1234 | Your API key. | Example request: `GET https://api.humorapi.com/praise?name=Alex&reason=you+did+it+again` Example response: ```json { "text": "Bravo Alex, you mastermind, you did it again." } ``` Cost: 1 point per call. ### Insult `GET https://api.humorapi.com/insult` Insult somebody for something. | Parameter | In | Required | Type | Example | Description | |---|---|---|---|---|---| | `name` | query | yes | string | Alex | The name of the person to be praised/insulted. | | `reason` | query | yes | string | You dropped the ball | The reason the person is praised/insulted for. | | `api-key` | query | yes | string | abcd1234 | Your API key. | Example request: `GET https://api.humorapi.com/insult?name=Alex&reason=you+dropped+the+ball` Example response: ```json { "text": "Holy moley, you dropped the ball Alex, you dingbat." } ``` Cost: 1 point per call. ### Rate Word `GET https://api.humorapi.com/words/rate` Rate a word on its funniness. | Parameter | In | Required | Type | Example | Description | |---|---|---|---|---|---| | `word` | query | yes | string | cookie | The word to be rated. A rating of 0 is low funniness and 1 is super funny. | | `api-key` | query | yes | string | abcd1234 | Your API key. | Example request: `GET https://api.humorapi.com/words/rate?word=cookie` Example response: ```json { "rating": 0.57 } ``` Cost: 1 point per call. ### Generate Nonsense Word `GET https://api.humorapi.com/words/nonsense/random` Generate a funny sounding nonsense word. | Parameter | In | Required | Type | Example | Description | |---|---|---|---|---|---| | `api-key` | query | yes | string | abcd1234 | Your API key. | Example request: `GET https://api.humorapi.com/words/nonsense/random` Example response: ```json { "word": "caboo", "rating": 0.41 } ``` Cost: 1 point per call. ## FAQ ### Is there a free plan? Yes. The free plan includes 10 points per day (most calls cost 1 point) at up to 1 request per second. When the daily points are used up, the API answers with status 402 until the quota resets at midnight UTC. The free plan requires a backlink to humorapi.com from the site or app that uses it. ### What is a point? Every call costs points. Usually a request costs 1 point plus 0.01 points per result returned; each endpoint's documentation states its cost. Every response carries the headers `X-API-Quota-Request`, `X-API-Quota-Used` and `X-API-Quota-Left`, so you always know where you stand. ### What happens when I use more than my daily points on a paid plan? Paid plans keep working and bill the extra points: $0.008 per point on Jack, $0.007 on Jester and $0.005 on Joker. ### How do I authenticate? Sign up in the [console](https://humorapi.com/console/) to get an API key, then send it with every request, either as the `api-key` query parameter or in the `x-api-key` header. ### Can I filter out offensive or adult jokes? Yes. Every joke is tagged. Pass `exclude-tags` (for example `nsfw,dark,racist,sexist,sexual`) to leave those categories out, or `include-tags=clean` to get clean jokes only. See the [joke categories](https://humorapi.com/docs/#joke-categories). ### Are there SDKs? Yes, for 21 languages including JavaScript, TypeScript, Python, Java, PHP, Go, Ruby, C# and Rust, all open source on GitHub. You can also generate a client from the [OpenAPI 3 spec](https://humorapi.com/downloads/humorapi-openapi-3.json) or start in Postman. See [SDKs](https://humorapi.com/sdks/). ### Can I cancel any time? Yes. All plans are month-to-month. You are charged immediately when you subscribe and can cancel under My Console > Plan / Billing. ### Is Humor API on RapidAPI? Yes, Humor API is also [listed on RapidAPI](https://rapidapi.com/skycraft-skycraft-default/api/humor-jokes-and-memes/), with RapidAPI's own plans and billing. The SDKs on this site work with direct Humor API access only. ## Contact skycraft GmbH, Leibnizstraße 5, 01187 Dresden, Germany. mail@humorapi.com