Knowledge & Fun

Trivia API

Pull random trivia questions with answers, filtered by topic and difficulty.

Request Headers

Name Required Description
X-RapidAPI-Key required Your RapidAPI key. Get one free.
X-RapidAPI-Host required trivia.p.rapidapi.com

Endpoints

GET /v1/trivia

Get random trivia questions, optionally filtered by category and difficulty

Parameters

NameTypeRequiredDefaultConstraints
categorystringoptional——
difficultystringoptional—matches easy|medium|hard
limitintegeroptional11-10

Code Examples

curl --request GET \
  --url 'https://trivia.p.rapidapi.com/v1/trivia?category=example&difficulty=example' \
  --header 'x-rapidapi-key: YOUR_API_KEY' \
  --header 'x-rapidapi-host: trivia.p.rapidapi.com'
GET /v1/trivia/categories

List all trivia categories available in the dataset, sorted alphabetically.

Code Examples

curl --request GET \
  --url 'https://trivia.p.rapidapi.com/v1/trivia/categories' \
  --header 'x-rapidapi-key: YOUR_API_KEY' \
  --header 'x-rapidapi-host: trivia.p.rapidapi.com'
GET /v1/trivia/difficulties

List all difficulty levels available in the trivia dataset, sorted alphabetically.

Code Examples

curl --request GET \
  --url 'https://trivia.p.rapidapi.com/v1/trivia/difficulties' \
  --header 'x-rapidapi-key: YOUR_API_KEY' \
  --header 'x-rapidapi-host: trivia.p.rapidapi.com'

Interactive Example

trivia
$ GET /v1/trivia?difficulty=easy&limit=1
{"data":[{"question":"What is the largest planet in our solar system?","answer":"Jupiter","category":"Science","difficulty":"easy"}],"meta":{"total":1,"limit":1,"offset":0}}

Subscribe & License

Access this API with commercial-ready tiers on RapidAPI. Flexible plans designed for side-projects, startups, and high-volume production architectures.

View Pricing & Subscribe

Developer Support

Need help integrating or have a custom endpoint request? Our engineering team is here to assist with authentication, payload schemas, and high-frequency rate limit increases.

Contact API Engineering

System Performance

Monitored 24/7 with a 99.9% uptime SLA. Built atop cloud-native microservices with globally distributed edge caching to ensure ultra-low latency response times.

All Systems Operational