Skip to content

A REST API for trivia questions. Contains over 5000 trivia questions with multiple choice, true/false and category to filter by.

License

Notifications You must be signed in to change notification settings

jgoralcz/trivia

Repository files navigation

trivia REST API

5200+ multiple choice trivia questions in a REST API. You can use the live instance at beta-trivia.bongobot.io


How to Use:

There are a few ways to get your trivia question

  1. By id 1-5200

Example

GET /2 HTTP/1.1
Host: ip:port
Connection: keep-alive
cache-control: no-cache

Example Response

[
    {
        "question": "In the 2011 TV anime series, "THE iDOLM@STER", what was the name of Iori's stuffed toy bunny?",
        "category": "Entertainment: Japanese Anime & Manga",
        "type": "multiple",
        "difficulty": "medium",
        "correct_answer": "Charles",
        "incorrect_answers": [
            "Bubsy",
            "Kero",
            "Usagi"
        ],
        "id": 2
    }
]
  1. By random and with filters
  • search
  • category (Entertainment | Sports | Science | Animals | General Knowledge | Mythology | Politics | Geography | History)
  • difficulty (easy | medium | hard)
  • type (boolean | multiple)
  • limit (1-10)

Example

GET /?search=cat&category=entertainment&type=multiple&difficulty=medium&limit=10
Host: ip:port
Connection: keep-alive
cache-control: no-cache

Example Response

[
    {
        "question": "This movie contains the quote, "What we've got here is a failure to communicate."",
        "category": "Entertainment: Film",
        "type": "multiple",
        "difficulty": "medium",
        "correct_answer": "Cool Hand Luke",
        "incorrect_answers": [
            "Bonnie and Clyde",
            "The Graduate",
            "In the Heat of the Night"
        ],
        "id": 2479
    },
    {
        "question": "In the game "Cave Story," what is the character Balrog's catchphrase?",
        "category": "Entertainment: Video Games",
        "type": "multiple",
        "difficulty": "medium",
        "correct_answer": "Huzzah!",
        "incorrect_answers": [
            "Oh yeeaaah!",
            "Whoa there!",
            "Nyeh heh heh!"
        ],
        "id": 3080
    }
    .
    .
    .
]

About

A REST API for trivia questions. Contains over 5000 trivia questions with multiple choice, true/false and category to filter by.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages