Trivia

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

Get API Key

Descripción general

Casos de uso

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

Funcionalidades

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

Puntos finales de la API

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

Parámetros

Nombre Tipo Obligatorio Descripción
category string Opcional Filter by category. One of: science, history, geography, sports, music, movies, literature, math, technology, nature.
difficulty string Opcional Filter by difficulty. One of: easy, medium, hard.

Pruébalo

Demostración en vivo
Solicitud

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

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

Campos de respuesta

Campo Tipo Descripción
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)

Ejemplos de código

# 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"

Respuestas de error

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

Parámetros

Nombre Tipo Obligatorio Descripción
filters array<object> Obligatorio Array of filters to get (min: 1, max: 50).

Pruébalo

Demostración en vivo
Solicitud

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

Campos de respuesta

Campo Tipo Descripción
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.

Ejemplos de código

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" }
    ]
  }'

Respuestas de error

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.

Preguntas frecuentes