# The Trivia API > An HTTP API that returns random trivia questions as JSON. It's free for non-commercial use, and you don't need an API key to start. Get questions from `GET https://the-trivia-api.com/v2/questions`, filtered with query parameters such as `categories`, `difficulties` and `limit`. Commercial use needs a subscription, and its API key goes in the `X-API-Key` header ([Authentication](https://the-trivia-api.com/docs/authentication.md) lists the features that need one). In TypeScript or JavaScript, the [`@trivia-api/sdk`](https://www.npmjs.com/package/@trivia-api/sdk) package has a typed function for every endpoint. There's also a keyless MCP server at `https://the-trivia-api.com/mcp` (Streamable HTTP) that serves English multiple choice questions to AI assistants. The docs below are markdown copies of the pages at https://the-trivia-api.com/docs. ## Getting started - [Quickstart](https://the-trivia-api.com/docs.md): Get random trivia questions as JSON in a couple of minutes, from the command line, JavaScript, TypeScript or Python. You don't need to sign up or get an API key. - [Authenticate with an API key](https://the-trivia-api.com/docs/authentication.md): Send your API key in the X-API-Key header to use other languages, typed answers, image questions, sessions and more. Includes curl, Python and JavaScript examples, and what 401, 403 and 429 responses mean. ## Guides - [Filter questions by category, difficulty and tag](https://the-trivia-api.com/docs/guides/filter-questions.md): Get only the trivia questions you want from The Trivia API, by category, difficulty, tag or region, and check how many questions match before you build a quiz around them. - [Avoid repeated questions with sessions](https://the-trivia-api.com/docs/guides/avoid-repeated-questions.md): Use sessions in The Trivia API so players never see the same trivia question twice, across as many requests as your quiz needs. - [Check typed answers to trivia questions](https://the-trivia-api.com/docs/guides/check-typed-answers.md): Ask trivia questions that players answer by typing, and let The Trivia API decide whether an answer is right, accepting typos, plurals and other ways of writing the same thing. - [Migrate from Open Trivia DB](https://the-trivia-api.com/docs/guides/migrate-from-open-trivia-db.md): Switch a quiz app from Open Trivia DB to The Trivia API, with how its parameters, response fields, categories, response codes and session tokens map across. - [Use trivia questions in Claude, Cursor and other AI apps](https://the-trivia-api.com/docs/guides/mcp-server.md): Connect The Trivia API's MCP server to Claude, Cursor, VS Code or any other MCP client, so an AI assistant can fetch real trivia questions for your quiz. ## Tutorials - [How to build a quiz app with React](https://the-trivia-api.com/docs/tutorials/react-quiz-app.md): A step-by-step guide to building a multiple choice quiz app in React and TypeScript, with questions from The Trivia API, a results screen and tests. - [How to build a quiz app with Vue](https://the-trivia-api.com/docs/tutorials/vue-quiz-app.md): Build a multiple choice quiz app with Vue 3, TypeScript and The Trivia API, using script setup, typed props and emits, and tests with Testing Library. ## Reference - [OpenAPI spec](https://the-trivia-api.com/openapi.json): The API reference as an OpenAPI 3 document: every endpoint, parameter, response and error.