Difficulty


Difficulty

You can specify a category by passing a difficulty parameter.

Some of the difficulties that we have include:

  • Easy
  • Medium
  • Hard

{info} This is NOT a required parameter

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 \
-d difficulty=easy

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"
  }
]
...