Public APIs
Open Trivia favicon

Open Trivia

Games & Comics

Trivia Questions.

Open Trivia's website screenshot

About Open Trivia

Open Trivia DB is a free, user-contributed trivia question database exposed as a JSON API. Requests are built by specifying the number of questions (up to 50 per call), category, difficulty, and question type (multiple choice or true/false); results can be returned in default HTML-encoded form, legacy URL encoding, RFC 3986 URL encoding, or base64. No API key is required to use it, and all data is licensed under Creative Commons Attribution-ShareAlike 4.0 International.

The API supports session tokens, which track previously served questions for a client so the same question is not returned twice; tokens expire after 6 hours of inactivity and can be reset once exhausted. Each API call returns a response code indicating outcomes such as success, insufficient results for the query, invalid parameters, an unrecognized token, an exhausted token, or rate limiting (one request per IP every 5 seconds). Helper endpoints are also available to look up the list of categories and their IDs, question counts per category, and global question counts broken down by total, pending, verified, and rejected.

This is aimed at developers building trivia or quiz applications who need a ready-made question bank without maintaining their own content or authentication layer.

Key features

  • Free JSON API for retrieving trivia questions, no API key required
  • Session tokens prevent repeat questions until the pool is exhausted
  • Filter questions by category, difficulty, and type (multiple choice or true/false)
  • Multiple response encoding formats: HTML codes, URL encoding, Base64
  • Category and question-count lookup endpoints
  • Up to 50 questions per API call

Frequently asked questions

Is the Open Trivia DB API free to use?

Yes, it is a completely free JSON API and does not require an API key.

Are there rate limits?

Yes, each IP can only access the API once every 5 seconds, after which a rate limit response code is returned.

How many questions can I retrieve per request?

A maximum of 50 questions can be retrieved per API call, and only one category can be requested per call.

What license covers the trivia data?

All data provided by the API is available under the Creative Commons Attribution-ShareAlike 4.0 International License.

Can I avoid getting duplicate questions?

Yes, by using a Session Token the API will never give you the same question twice until the token's question pool is exhausted.

Advertise here

Featured products

  • SerpApi - Search API favicon
  • Screenshot Scout favicon
  • TalorData favicon
  • CoreClaw favicon

Show your product to thousands of developers

· 100k monthly pageviews
· 7k newsletter subscribers

Advertise your product