> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # ApiNinjasTriviaSkill > Fetch trivia questions from the API Ninjas service with optional category filtering. [add-skill]: /docs/server-sdks/reference/typescript/agents/agent-base/add-skill Fetch trivia questions from the API Ninjas service with optional category filtering. **Class:** `ApiNinjasTriviaSkill` **Tools:** Configurable via `tool_name` (default `get_trivia`) **Env vars:** `API_NINJAS_KEY` **Multi-instance:** Yes — each instance must use a distinct `tool_name`. **`tool_name`** `string` — default: get\_trivia Custom name for the SWAIG trivia tool. Set a distinct value per instance when registering multiple `ApiNinjasTriviaSkill` instances on the same agent. --- **`api_key`** `string` — required API Ninjas API key. Falls back to the `API_NINJAS_KEY` environment variable. --- **`categories`** `string[]` Subset of trivia categories to enable. Defaults to all 14 supported categories. Values outside the allowed set are filtered out. Available categories: `artliterature`, `language`, `sciencenature`, `general`, `fooddrink`, `peopleplaces`, `geography`, `historyholidays`, `entertainment`, `toysgames`, `music`, `mathematics`, `religionmythology`, `sportsleisure`. --- **`default_category`** `string` Default trivia category if none is specified by the user. Must be one of the enabled `categories`. --- **`reveal_answer`** `boolean` — default: false Whether to include the answer in the response. When `false`, the AI receives the answer privately so it can quiz the user. --- ```typescript {6-9} import { AgentBase, ApiNinjasTriviaSkill } from '@signalwire/sdk'; const agent = new AgentBase({ name: 'assistant', route: '/assistant' }); agent.setPromptText('You are a helpful assistant.'); await agent.addSkill(new ApiNinjasTriviaSkill({ default_category: 'sciencenature', reveal_answer: false, })); agent.run(); ``` > Fetch trivia questions from the API Ninjas service with optional category filtering.