Random Quiz


Random Quiz

If you do not specify any parameters and hit the /api/v1/questions1 end point you would get a random set of 20 questions from various difficulties and categories.

{info} The only required parameter is always the API Key

Example

The request that you would use would look something like this:

curl https://quizapi.io/api/v1/questions -G \
-d apiKey=YOUR_API_KEY

This returns a JSON object with the results in an array we can iterate over.

[
  {
    "id": 1,
    "question": "How to delete a directory in Linux?",
    "description": "delete folder",
    "answers": {
      "answer_a": "ls",
      "answer_b": "delete",
      "answer_c": "remove",
      "answer_d": "rmdir",
      "answer_e": null,
      "answer_f": null
    },
    "multiple_correct_answers": "false",
    "correct_answers": {
      "answer_a_correct": "false",
      "answer_b_correct": "false",
      "answer_c_correct": "false",
      "answer_d_correct": "true",
      "answer_e_correct": "false",
      "answer_f_correct": "false"
    },
    "explanation": "rmdir deletes an empty directory",
    "tip": null,
    "tags": [],
    "category": "linux",
    "difficulty": "Easy"
  }
]
...