Jester API Documentation

Unleash the power of laughter with Jester, the joke generator API that’s guaranteed to add a touch of humor to any application. Whether you’re building a game, chat bot, or simply want to inject some joy into your project, Jester is the go-to solution for a constant stream of fresh, funny content.

Contents

  1. Object Properties & Structure
  2. Operating Modes
    1. Stats Mode
    2. Random Mode
    3. Batch Mode
    4. Joke of the Day
  3. Use Limits

1. Object Properties

A jester object has the following properties.

PropertyDescription
textThe joke text.
sourceThe source domain text.
urlThe source hyperlink.
htmlThe joke in pre-formatted HTML.

Example Response {object}

{
"text": "The joke text will be displayed here.",
"source": "www.example.com",
"url": "https://www.example.com/some-page/",
"html": "<blockquote>Pre-formatted HTML<footer>Source Link</footer></blockquote>"
}

2. Operating Modes

There are several API modes depending on the type of data you want to retrieve.

i. Stats Mode

https://api.viewbits.com/v1/jester?mode=stats

Use this call to return information like current version and the number of entries in the database.

Response

{"info":"Jester v1.0","entries":209}

ii. Random Mode

https://api.viewbits.com/v1/jester?mode=random

Use this call to return a single random jester object.

Response

{object}

iii. Batch Mode

https://api.viewbits.com/v1/jester?mode=batch

When operating in batch mode, the API will return an array of random objects. This is mainly used when you want to cache data locally within your app. This is the most efficient method to work with several objects within your app.

Response

[ {object},{object},...{object} ]

The default limit is 50 items. When no API key is provided, the batch is limited to 10 entries.

iv. Joke of The Day

https://api.viewbits.com/v1/jester?mode=today

Each day we feature a single joke from the jester database, which you can call using the [today] mode. To reduce server load, this response should be loaded into your app cache and refreshed daily rather than making the same call each time you want to display an object in your project. A new joke is generated at midnight server time (00:00 CST).

Response

{object}

3. Use Limits

When no API key is provided, calls are limited to 5 per 30 second period. Its recommended that you use batch mode to cache the data in a local file, then updating only as needed. To increase rate limits and disable CORS, you must provide an API key by adding &key=[YOUR_KEY] to the end of your call.

Example

https://api.viewbits.com/v1/jester?mode=random&key=[YOUR_KEY]