Fun Utilities

Random Trivia

Fetches random trivia facts from a curated database for educational content, conversation starters, or app features. Access via MCP in Cursor and other AI editors using the random_trivia tool, or call GET /v1/fun/trivia directly. Returns structured JSON with the fact, category, and difficulty level. Perfect for Claude agents building quiz apps or adding engaging content to user interactions.

API Endpoint

GET /v1/fun/trivia

Code Examples

curl "https://tinyfn.io/v1/fun/trivia" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/fun/trivia', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/fun/trivia',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's fun tools:

{
  "mcpServers": {
    "tinyfn-fun": {
      "url": "https://tinyfn.io/mcp/fun",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

What format does the random trivia API return?

Returns JSON with 'fact', 'category', and 'difficulty' fields. Example: {"fact": "Honey never spoils", "category": "science", "difficulty": "easy"}.

Can I filter trivia by category or difficulty through MCP?

The base endpoint returns completely random trivia. Check the MCP tool parameters in your AI editor for any available filtering options.

How can AI agents use random trivia effectively?

Great for icebreakers, educational chatbots, quiz generation, or adding personality to conversations. MCP integration lets Cursor and Windsurf pull fresh facts dynamically.

Are the trivia facts verified and family-friendly?

Yes, facts are curated for accuracy and appropriate for general audiences. Sources are vetted to ensure educational value.

What's the rate limit for trivia requests?

Standard TinyFn rate limits apply. For high-volume applications, cache responses locally or implement request throttling.

Try Random Trivia Now

Get your free API key and start using Random Trivia in seconds.

Get Free API Key