← Развлечения

Вопросы викторин

GET /trivia/questions

Получение случайных вопросов викторины с ответами с множественным выбором или true/false. Настраиваемое количество (до 50), категория и уровень сложности (лёгкий/средний/сложный). Возвращает вопросы с правильными и неправильными ответами, категорией и сложностью. Полезно для приложений викторин, тривии, образовательных инструментов, тимбилдинга и развлекательных функций чат-ботов. Данные из Open Trivia Database с 4 000+ проверенных вопросов.

Параметры

amount необязательный по умолчанию: 10

Count

category необязательный

Category

difficulty необязательный

easy/medium/hard

Примеры запросов

Базовое использование
curl "https://nordapi.ee/api/v1/trivia/questions?amount=5"
5 random trivia questions
curl "https://nordapi.ee/api/v1/trivia/questions?amount=5"
10 easy science questions
curl "https://nordapi.ee/api/v1/trivia/questions?amount=10&category=17&difficulty=easy"
20 hard history questions
curl "https://nordapi.ee/api/v1/trivia/questions?amount=20&category=23&difficulty=hard"

Ответ в реальном времени

{
  "count": 5,
  "data": [
    {
      "category": "General Knowledge",
      "correct_answer": "February 14, 2005",
      "difficulty": "hard",
      "incorrect_answers": [
        "May 22, 2004",
        "September 12, 2005",
        "July 19, 2009"
      ],
      "question": "When was \"YouTube\" founded?",
      "type": "multiple"
    },
    {
      "category": "History",
      "correct_answer": "116",
      "difficulty": "medium",
      "incorrect_answers": [
        "100",
        "90",
        "101"
      ],
      "question": "How many years did the Hundred Years' War last?",
      "type": "multiple"
    },
    {
      "category": "Mythology",
      "correct_answer": "Spider",
      "difficulty": "medium",
      "incorrect_answers": [
        "Wild dog",
        "Monkey",
        "Crocodile"
      ],
      "question": "In African mythology, Anansi is a trickster and storyteller who takes the shape of which animal?",
      "type": "multiple"
    },
    {
      "category": "Entertainment: Film",
      "correct_answer": "Michael Douglas",
      "difficulty": "medium",
      "incorrect_answers": [
        "Michael Fox",
        "Michael Richards",
        "Michael Kane"
      ],
      "question": "What is the birth name of Michael Keaton?",
      "type": "multiple"
    },
    {
      "category": "Entertainment: Video Games",
      "correct_answer": "By continually mounting it",
      "difficulty": "easy",
      "incorrect_answers": [
        "By feeding it Wheat",
        "By feeding it Sugar",
        "By petting it"
      ],
      "question": "How do you tame a horse in Minecraft?",
      "type": "multiple"
    }
  ],
  "success": true
}