Syrsly's Jokes API
Introduction
This is the front page of the jokes API. This API will pick a random joke from a database of hundreds of thousands of jokes and give you the joke as plain text to be used however you like.
How It Works
If you just go to syrsly.com/joke/random, you can get a random joke in any genre. To get a list of genres, go to syrsly.com/joke/genres. Some genres of jokes have more jokes in the pool than others.
The API's database has a lot of jokes stored locally, but the API will also occasionally pull jokes from other APIs and then save those jokes locally for future use. The goal is to eventually store up to 4k jokes per genre for safekeeping in case the third-party APIs break/die. I chose 4k as the max limit just because it sounds like a doable number and is still tons of jokes. I'm not trying to be the end-all-be-all archive of jokes. I just want a lot of them for variety's sake.
The jokes API may change and gain more restrictions later if it is abused or I just can't as easily host it. The hope is to document the changes in this changelog below:
Changelog
- V1.1.2 (5/28/2025): Bugfix: double quotes were being triple encoded for many of the APIs. I added a workaround to clean up these values at the output moment so everything shows up consistently as plain text. I will be trying to fix the code to handle encoding of each API separately.
- V1.1.1 (5/26/2025): Added Christmas jokes. These hit the jokeapi.dev API. This API is great for certain kinds of jokes, but its Christmas joke pool is rather limited, so I'll be searching for more sources.
- V1.1.0 (5/25/2025): Random jokes now optimized to reduce third party API hits and still store new jokes locally. Previously, this only happened when accessing the joke genres directly. Joke API front page now linked on sitewide navigation. Added disney jokes and food jokes to the random jokes pool. Added backend 'source' column to better track where each joke came from in case there's an issue. Added secondary API to yomomma jokes. Fixed bug where genre was stored as an int instead of string when backing up new jokes.
- V1.0.1 (5/23/2025): Chuck Norris jokes now optimized to reduce third party API hits.
- V1.0.0 (5/16/2025): Got the front page of the jokes API up and running. This marks the start of the API being easy to access by others.