5 Free Trivia API's to create your own quiz app
Tags: api, webdev
Published: 2023-02-01 16:04:01

I'm a recent graduate of Code Institute, a coding bootcamp that takes you from zero coding knowledge to junior full stack developer. 

The second assessment project tests your competency using JavaScript. Now I won't lie, this project was a big jump from the HTML and CSS project, as JavaScript was my first 'proper' coding language - but it was also massively exciting to learn about the sheer scope of what can be achieved with JavaScript!  So for my second project I created The Quiz Arms - a pub-style trivia quiz that utilised an API to provide trivia questions, grouped by their difficulty level. I decided to push myself and use an API to generate my quiz content rather than writing my own questions, because 'no pain, no gain' right? 😉 Which got me to thinking - what other free trivia APIs are available? I’ve scoured the internet and have found these 5 APIs for you to try!


---

### [Open Trivia DB](https://opentdb.com/)

🔐 API Key Required? - No

💰 Cost - Free

I used the Open Trivia DB for my project and found the documentation to be well-written, a big plus when you're learning something new. This API gives you the option to either create a general knowledge style of quiz or to specify the category. You can also specify the number of questions you would like, the difficulty of the question and whether you want questions to be multiple choice or true/false. Open Trivia DB currently has over 4000 questions and is growing daily thanks to the option to add your own question to the database.


---

### [Quiz API](https://quizapi.io/)

🔐 API Key Required? - Yes

💰 Cost - Free option for developers to try.

Quiz API is perfect if you want to create a more technical quiz, with questions covering networking, programming languages, docker, cloud etc. This API also gives you the option to return a set number of questions, difficulty levels and categories. It also has the option to return certain tags - for example, questions with PHP & Laravel tags.


---

### [The Trivia API](https://the-trivia-api.com/)

🔐 API Key Required? - No for non-commercial use (An API Key can be obtained for commercial use or to bypass the rate limit)

💰 Cost - Free

The Trivia API features some nice easy-to-follow documentation along with examples of the JSON, which updates to reflect the choices made. With this API you can specify a category, difficulty and number of questions returned. It also features tags, which allow you to select a sub-category and create a super-specific quiz. Something really cool about this API is the option to set a question region - we've all taken part in a quiz at some point that is really specific to one area of the world (looking at you America and TV show quizzes!)  The question region selector allows you to choose a county code, which then prevents you from receiving questions that are unsuitable to the region you chose.


---

### [jService](http://jservice.io/)

🔐 API Key Required? - No

💰 Cost - Free

jService is a trivia API that utilises over 221,510 questions from the popular US TV show Jeopardy. The API will return the question with a difficulty rating, category, id, and shows airing dates along with the correct answer and question id.


---

### [API Ninjas Trivia](https://api-ninjas.com/api/trivia)

🔐 API Key Required? - Yes

💰 Cost - Free option along with other paid subscriptions

API Ninjas provide random trivia from a database containing hundreds of thousands of questions and answers about science, literature, philosophy and other fascinating topics. You can specify the category and the number of questions returned. The documentation for this API is a bit on the basic side, however, I liked that they included code examples for several different languages.


---

So now comes the hard part, choosing one of the APIs and creating a quiz app! And if you'd like to see my second project in all its glory you can find the live site and repo links below. I'd love to know what team name you came up with, my current favourites are Les Quizerables & In Dog Beers, We’ve Only Had One 🤣  - feel free to drop them in the comments section below


![The Quiz Arms Site](https://github.com/kera-cudmore/TheQuizArms/raw/main/assets/images/the-quiz-arms.png)

The Quiz Arms - [Live Site](https://kera-cudmore.github.io/TheQuizArms/)

The Quiz Arms - [Repo](https://github.com/kera-cudmore/TheQuizArms)