# Funtrivia — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search and browse thousands of trivia questions and quizzes across multiple categories, with the ability to filter by topic, difficulty, or find random challenges to test your knowledge. Discover trending topics, top-rated quizzes, and the latest additions to build custom trivia games or enhance your learning experience.

**Category:** Entertainment | **Website:** [funtrivia.com/](https://funtrivia.com/) | **Docs:** [parse.bot/marketplace/b8196629-b722-4750-81b0-b54933cd1dc4/funtrivia-com-api](https://parse.bot/marketplace/b8196629-b722-4750-81b0-b54933cd1dc4/funtrivia-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get hot topics

Retrieve trending/hot topic quizzes currently popular on FunTrivia. Returns quizzes that are currently receiving high engagement.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/get-hot-topics \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get most played quizzes

Retrieve currently most played quizzes on FunTrivia. Returns quizzes that are receiving the most plays, with titles and URLs.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/get-most-played-quizzes \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get newest quizzes

Retrieve the newest quizzes recently added to FunTrivia. Returns quiz titles and URLs for the most recently published quizzes.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/get-newest-quizzes \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get quiz categories

Retrieve the list of top-level quiz categories with their URL slugs. Slugs are used with get_quizzes_by_category to browse quizzes within a category.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/get-quiz-categories \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get quiz detail

Retrieve details for a specific quiz, including title, metadata, and all questions with their options and correct answers. Supports both /trivia-quiz/ and /quiz/ URL formats from FunTrivia.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | Full quiz URL (e.g. 'https://www.funtrivia.com/trivia-quiz/Animals/Various-Animals-250320.html'). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/get-quiz-detail \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"url":"<string>"}'
```

### Get quizzes by category

Retrieve quizzes within a specific category. Use the slug from get_quiz_categories with '/index' appended for top-level categories (e.g. 'animals/index'). Also supports subcategory paths. Returns the category name and a list of quizzes with titles and URLs.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `slug` | string | Yes | Category slug path (e.g. 'animals/index', 'movies/index', 'brain_teasers/word_play'). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/get-quizzes-by-category \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"slug":"<string>"}'
```

### Get random quiz

Retrieve a random quiz with its full details including title, metadata, and all questions with options and correct answers. Each call returns a different quiz.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/get-random-quiz \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get random trivia questions

Fetch random trivia questions from the main trivia questions page. Returns a set of questions across various categories with answers, explanations, difficulty levels, and choices. Results change on each request.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/get-random-trivia-questions \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get top rated

Retrieve top-rated quizzes on FunTrivia. Returns quizzes that have received the highest user ratings, with titles and URLs.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/get-top-rated \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get trivia categories

Retrieve the list of top-level trivia categories from the questions section of FunTrivia. Each category has an ID usable with get_trivia_subtopics_by_category and get_trivia_questions_by_category.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/get-trivia-categories \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get trivia questions by category

Retrieve trivia questions directly from a category page. Returns questions displayed on that category's main page with answers, explanations, difficulty, and choices.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `cat_id` | string | Yes | Category ID from get_trivia_categories (e.g. '1' for Animals). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/get-trivia-questions-by-category \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"cat_id":"<string>"}'
```

### Get trivia questions by subtopic

Retrieve trivia questions for a specific sub-topic. Returns questions with the correct answer, explanation, difficulty level, and incorrect choices. Typically returns 10-20 questions per subtopic.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `did` | string | Yes | Sub-topic ID from get_trivia_subtopics_by_category (e.g. '21375' for African Animals). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/get-trivia-questions-by-subtopic \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"did":"<string>"}'
```

### Get trivia subtopics by category

Retrieve sub-topics for a given trivia category. Returns subtopic IDs usable with get_trivia_questions_by_subtopic. Not all categories have subtopics; categories without subtopics return an empty array.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `cat_id` | string | Yes | Category ID from get_trivia_categories (e.g. '1' for Animals). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/get-trivia-subtopics-by-category \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"cat_id":"<string>"}'
```

### Search quizzes

Search for quizzes by keyword. Returns matching quiz titles and URLs across all categories. Results are ranked by relevance to the search query.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword (e.g. 'animals', 'history', 'science'). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/funtrivia/search-quizzes \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.