# Trivia Generator API

> Trivia Generator is a trivia and quiz API that serves random trivia questions complete with multiple-choice options and the correct answer. Paid plans can filter questions across topics like history, science, geography, and pop culture.

**Endpoint:** `GET https://api.apiverve.com/v1/trivia`  
**Category:** Entertainment  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/trivia

## Overview

Each request delivers a question prompt, an array of multiple-choice choices, the verified answer, and the assigned category. Free plans draw questions from the general category, while paid plans can target categories like literature, history, and science-technology. A secondary lookup endpoint supplies the full list of available categories.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/trivia?category=general" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `category` | string | No | The category of the trivia question. default general. One of: animals, brain-teasers, celebrities, entertainment, for-kids, general, geography, history, hobbies, humanities, literature, movies, music, newest, people, rated, religion-faith, science-technology, sports, television, video-games, world. Premium field |

## Response fields

- `question` — string · The trivia question text to be answered
- `answer` — string · The correct answer to the trivia question
- `options` — array · Array of answer choices including correct and incorrect options. Each choice starts with its letter and a space ("A Wyoming"); answerIndex and answerLetter identify the correct one
- `category` — string · The category classification for this trivia question

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "question": "Is the Pink Cadillac the trademark of Mary Kay beauty products?",
    "answer": "Yes",
    "options": [
      "A Yes",
      "B No"
    ],
    "category": "general"
  }
}
```

## Use cases

- **Community Chatbot Games** — Discord and Slack bots fetch random questions with answer options to run automated trivia rounds during community gaming sessions.
- **Classroom Warmup Quizzes** — Teachers display quick multiple-choice questions on digital whiteboards to start class periods with low-stakes general knowledge challenges.
- **Digital Signage Displays** — Venues rotate fresh trivia prompts and answer choices across waiting room monitors to keep visitors entertained while in line.
- **Team Icebreaker Rounds** — Meeting hosts pull instant questions across diverse topics to run quick warmup competitions at the start of company gatherings.

## SDKs

- **npm** — `npm install @apiverve/trivia` (https://www.npmjs.com/package/@apiverve/trivia)
- **NuGet** — `dotnet add package APIVerve.API.TriviaGenerator` (https://www.nuget.org/packages/APIVerve.API.TriviaGenerator)
- **Source** — https://github.com/apiverve/trivia-api

## More

- Full reference: https://docs.apiverve.com/ref/trivia
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
