This is a simple Java console application that fetches multiple-choice questions from the Open Trivia DB API and allows users to take a quiz. It demonstrates basic API integration, JSON parsing, and user interaction through the terminal.
- Gets live quiz questions from API
- Randomizes multiple-choice options
- Accepts user input and checks answers
- Tracks score and shows final result
- Java (JDK 8+)
- JSON.simple (v1.1.1)
- Open Trivia DB API
- IntelliJ Idea
QuizGame.java– main game logicQuizService.java– handles API and parsingQuestion.java– model for each questionjson-simple-1.1.1.jar– library for JSON
On IntelliJ
Open project → Add .java files to src
Add json-simple-1.1.1.jar to
Project Structure → Libraries
Run QuizGame.java
Open Trivia DB
Example: https://opentdb.com/api.php?amount=5&type=multiple
Below is a screenshot showing the quiz running in IntelliJ IDEA:
Submitted by Aniket Saini.

