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 with API credits. 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 20-25k characters depending on plan. 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 .
|
difficulty | string | No | easy | The difficulty of questions to generate. Can be easy ,
medium or hard . Defaults to easy .
|
language | string | No | en | The language of the text. Defaults to en . See the languages endpoint for a list of supported languages. |
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",
"difficulty": "easy"
}'
Example response:
{
"data": [
{
"answer": "B",
"answer_text": "Nonviolent resistance",
"question": "What was Gandhi's main method of resistance?",
"type": "multiple_choice",
"choices": {
"A": "Violence",
"B": "Nonviolent resistance",
"C": "Political manipulation",
"D": "Bribery"
},
"answer_info": "He employed nonviolent resistance to lead India's successful campaign for independence from British rule."
},
{
"answer": "C",
"answer_text": "London",
"question": "Where did Gandhi train in law?",
"type": "multiple_choice",
"choices": {
"A": "Mumbai",
"B": "Delhi",
"C": "London",
"D": "New York"
},
"answer_info": "He was born in 1869 in coastal Gujarat and trained in law in London."
},
{
"answer": "B",
"answer_text": "Women's rights and religious and ethnic amity",
"question": "What were some of the causes that Gandhi led campaigns for in India?",
"type": "multiple_choice",
"choices": {
"A": "Animal rights and environmental protection",
"B": "Women's rights and religious and ethnic amity",
"C": "Gun control and military expansion",
"D": "Tax cuts and economic deregulation"
},
"answer_info": "He returned to India in 1915 and led nationwide campaigns for various causes, including poverty, women's rights, and religious and ethnic amity."
}
]
}
POST /languages
Fetch a list of supported languages. You can also view the list as a text file here: https://quizgecko.com/api/v1/languages?text=1
Endpoint
GET https://quizgecko.com/api/v1/languages
Example request:
curl -X "GET" "https://quizgecko.com/api/v1/languages"
Example response:
{
"ab": "Abkhazian",
"ace": "Achinese",
"ach": "Acoli",
"ada": "Adangme",
"ady": "Adyghe",
"aa": "Afar",
"afh": "Afrihili",
...
}