Quiz Question Generation API
Automate your quiz question generation workflow or add question generation features to your own product. Perfect for LMS platforms. Create an account to get started with the API for free today. Each API request will use one generation credit.
Getting a key
To access our API, please first subscribe to a paid plan. You can then generate a key from this page.
Documentation
Authentication
You need to pass your API key/token with every request, otherwise you will get a 401 Unauthenticated error.
The preferred method is Bearer authentication. Send your secret token in the
Authorization
header with the Bearer
keyword. E.g.
curl -H "Authorization: Bearer YOUR_API_KEY_HERE" https://quizgecko.com/api/v1/test
For convenience, you can also pass your API key in the api_key
query parameter. E.g.
curl https://quizgecko.com/api/v1/test?api_key=YOUR_API_KEY_HERE
You can use the /test
endpoint as above to quickly check authentication is working.
POST /questions
Generate questions by providing text or a URL.
Endpoint
POST https://quizgecko.com/api/v1/questions
Parameters
Pass parameters in the request body as JSON.
Name | Type | Required | Default | Description |
---|---|---|---|---|
text | string | Yes | The text to generate questions from. Min 400 characters. Maximum 5000 characters. Required if URL is not provided. | |
url | string | Yes | The URL to generate questions from. Must be a public, crawlable URL. Text is automatically trimmed after 5000 characters. Required if text is not provided. | |
question_type | string | No | auto | The type of questions to generate. Can be multiple_choice ,
short_answer , true_false or auto . Default is
auto .
|
count | integer | No | 3 | The number of questions to generate. |
difficulty | string | No | easy | The difficulty of questions to generate. Can be easy ,
medium or hard . Defaults to easy .
|
Example request:
curl -X "POST" "https://quizgecko.com/api/v1/questions" \
-H 'Authorization: Bearer YOUR_API_KEY_HERE' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"url": "https://en.wikipedia.org/wiki/Physics",
"question_type": "multiple_choice",
"count": 5,
"difficulty": "easy"
}'
Example response:
{
"data": [
{
"answer": "C",
"question": "What did early civilizations use astronomy for?",
"type": "multiple_choice",
"choices": {
"A": "To predict the future",
"B": "To understand the universe",
"C": "To worship the stars and planets",
"D": "All of the above"
}
},
{
"answer": "A",
"question": "What is the goal of physics?",
"type": "multiple_choice",
"choices": {
"A": "To understand how the universe works",
"B": "To develop new technologies",
"C": "To study the fundamental constituents of matter",
"D": "All of the above"
}
},
{
"answer": "B",
"question": "What did Philoponus do that was different from Aristotle?",
"type": "multiple_choice",
"choices": {
"A": "He based his physics on observations",
"B": "He questioned Aristotle's teachings",
"C": "He introduced the theory of impetus",
"D": "All of the above"
}
}
]
}