JokeAPI · Schema

TwopartJoke

A joke delivered as a setup/delivery pair.

JokesHumorEntertainmentOpen SourceREST APIGames And ComicsPublic APIs

Properties

Name Type Description
error boolean Always false on a successful joke response.
category string Category the joke belongs to.
type string Joke shape — always `twopart` for this schema.
setup string Setup line of the joke.
delivery string Punchline of the joke.
flags object Content classification flags carried on every joke.
id integer Joke identifier within its language scope.
safe boolean True when the joke has no flags and is not Dark.
lang string ISO 639-1 language code of the joke.
View JSON Schema on GitHub

JSON Schema

jokeapi-twopart-joke-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/jokeapi/refs/heads/main/json-schema/jokeapi-twopart-joke-schema.json",
  "title": "TwopartJoke",
  "description": "A joke delivered as a setup/delivery pair.",
  "type": "object",
  "properties": {
    "error": {
      "type": "boolean",
      "description": "Always false on a successful joke response.",
      "example": false
    },
    "category": {
      "type": "string",
      "description": "Category the joke belongs to.",
      "enum": [
        "Misc",
        "Programming",
        "Dark",
        "Pun",
        "Spooky",
        "Christmas"
      ],
      "example": "Programming"
    },
    "type": {
      "type": "string",
      "description": "Joke shape \u2014 always `twopart` for this schema.",
      "enum": [
        "twopart"
      ],
      "example": "twopart"
    },
    "setup": {
      "type": "string",
      "description": "Setup line of the joke.",
      "example": "Why don't programmers like nature?"
    },
    "delivery": {
      "type": "string",
      "description": "Punchline of the joke.",
      "example": "It has too many bugs."
    },
    "flags": {
      "type": "object",
      "description": "Content classification flags carried on every joke.",
      "properties": {
        "nsfw": {
          "type": "boolean",
          "description": "Joke contains adult or explicit sexual content.",
          "example": false
        },
        "religious": {
          "type": "boolean",
          "description": "Joke references or mocks religion.",
          "example": false
        },
        "political": {
          "type": "boolean",
          "description": "Joke references politics or political figures.",
          "example": false
        },
        "racist": {
          "type": "boolean",
          "description": "Joke contains racist content.",
          "example": false
        },
        "sexist": {
          "type": "boolean",
          "description": "Joke contains sexist content.",
          "example": false
        },
        "explicit": {
          "type": "boolean",
          "description": "Joke contains explicit language unrelated to NSFW.",
          "example": false
        }
      },
      "required": [
        "nsfw",
        "religious",
        "political",
        "racist",
        "sexist",
        "explicit"
      ]
    },
    "id": {
      "type": "integer",
      "description": "Joke identifier within its language scope.",
      "example": 127
    },
    "safe": {
      "type": "boolean",
      "description": "True when the joke has no flags and is not Dark.",
      "example": true
    },
    "lang": {
      "type": "string",
      "description": "ISO 639-1 language code of the joke.",
      "example": "en"
    }
  },
  "required": [
    "error",
    "category",
    "type",
    "setup",
    "delivery",
    "flags",
    "id",
    "safe",
    "lang"
  ]
}