Trivia

Get random trivia questions with multiple-choice answers. Filter by category and difficulty to target specific question pools.

Get API Key

Overview

Use Cases

  • Quiz games and trivia applications
  • Educational platforms and learning apps
  • Social and party game features
  • Daily challenge widgets
  • Knowledge-testing integrations

Features

10 categories β€” science, history, geography, sports, music, movies, literature, math, technology, nature
Three difficulty levels β€” easy, medium, hard
Four answer options per question with the correct answer always included
Optional category and difficulty filtering
Each request returns a randomly selected question from the matching pool

API Endpoints

Get Trivia Question

Returns a random trivia question with multiple-choice answers. Use the optional category and difficulty query parameters to filter the question pool.

GET
https://requiems.xyz/v1/entertainment/trivia

Parameters

Name Type Required Description
category string Optional Filter by category. One of: science, history, geography, sports, music, movies, literature, math, technology, nature.
difficulty string Optional Filter by difficulty. One of: easy, medium, hard.

Try it out

Live Demo
Request

Filter by category. One of: science, history, geography, sports, music, movies, literature, math, technology, nature.

Filter by difficulty. One of: easy, medium, hard.

Response Fields

Field Type Description
question string The trivia question text
options array<string> Four multiple-choice answer options
answer string The correct answer β€” always one of the values in options
category string The category the question belongs to
difficulty string The difficulty level of the question (easy, medium, or hard)

Code Examples

# Random question (no filters)
curl "https://requiems.xyz/v1/entertainment/trivia" \
  -H "requiems-api-key: YOUR_API_KEY"

# Filtered by category and difficulty
curl "https://requiems.xyz/v1/entertainment/trivia?category=science&difficulty=medium" \
  -H "requiems-api-key: YOUR_API_KEY"

Error Responses

bad_request

An invalid category or difficulty value was provided

not_found

No questions match the given category and difficulty combination

unauthorized

Missing API key

forbidden

Invalid or revoked API key

Get Batch Trivia Questions

Returns up to 50 trivia questions in a single request.

POST
https://requiems.xyz/v1/entertainment/trivia/batch

Parameters

Name Type Required Description
filters array<object> Required Array of filters to get (min: 1, max: 50).

Try it out

Live Demo
Request

Array of filters to get (min: 1, max: 50).

Response Fields

Field Type Description
results array<object> List of trivia questions returned in the same order as the input filters.
results[].category string The topic filter used to retrieve the trivia question.
results[].difficulty string The complexity level filter used to retrieve the trivia question.
results[].error string Describes why the question could not be retrieved for this filter. Omitted if the query was successful.
results[].data object The trivia question returned for this filter. Empty if the query failed.
results[].data.question string The trivia question text.
results[].data.options array<string> List of possible answers for the question.
results[].data.answer string The correct answer to the trivia question.
results[].data.category string The category the trivia question belongs to.
results[].data.difficulty string The difficulty level of the trivia question.
total integer Total number of trivia results returned.

Code Examples

curl -X POST "https://requiems.xyz/v1/entertainment/trivia/batch" \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "filters": [
      { "category": "sports", "difficulty": "easy" },
      { "category": "history", "difficulty": "medium" }
    ]
  }'

Error Responses

validation_failed

The filters array is missing, empty, or contains more than 50 items.

bad_request

Invalid JSON, malformed request body, or unexpected field types.

unauthorized

Missing API key.

forbidden

Invalid or revoked API key.

Frequently Asked Questions