Integrate our questions generator API into your application. Only successful generations are counted. Create an account and get started now.
Documentation
Credits
$5.00
Roughly 100 API requests.
Each API request generates 5-10 questions. Only successful generations are counted.
Number of questions
1,000
Pricing
Documentation
Integrate our questions generator API into your application. Each API request generates 5-10 questions. Only successful generations are counted.
Getting a key
Subscribe to the Questions Generator API and you will see your api key in this page.
API Endpoint
https://api.opexams.com
Authentication
To use the Questions Generator API, you need to authenticate your requests. You can do this by sending your API key in the api-key header.
"api-key": "YOUR-API-KEY"
POST /questions-generator
Generate questions by providing a body as JSON with the following parameters:
Name
Type
Required
Description
type
string
true
The type of the question to generate. Can be `contextBased` or `topicBased` or `transcriptBased`
context
string
if type is `contextBased`
The text to generate questions from
topic
string
if type is `topicBased`
The topic of the question to generate
audio
File
if type is `transcriptBased`
Audio file to be transcribed, supported formats are mp3, mp4, mpeg, mpga, m4a, wav, and webm.
youtubeUrl
string
if type is `transcriptBased`
The URL of the YouTube video to be transcribed
questionType
string
true
The type of the question to generate. Can be `MCQ`, `TF` or `open`
language
string
false
The language of the generated questions. You can find the full list of supported languages here. The default value is `Auto`
difficulty
string
false
The difficulty of the question to generate. Can be `easy`, `medium` or `hard`
requestId
string
false
The id of the request. can by used to track the request
Test request
You can test the API by setting a `request-type` header to `test` and the request will not be counted in your usage.
Response
Response example for a successful request:
{ "title": "Countries and their capitals" "data": [ { "question": "What is the capital of France?", "options": [ "Paris", "London", "Berlin", "Madrid" ], "answer": "Paris" }, { "question": "What is the capital of Germany?", "options": [ "Paris", "London", "Berlin", "Madrid" ], "answer": "Berlin" }, { "question": "What is the capital of Spain?", "options": [ "Paris", "London", "Berlin", "Madrid" ], "answer": "Madrid" }, { "question": "What is the capital of the United Kingdom?", "options": [ "Paris", "London", "Berlin", "Madrid" ], "answer": "London" }, { "question": "What is the capital of Italy?", "options": [ "Paris", "London", "Berlin", "Madrid" ], "answer": "Rome" }, { "question": "What is the capital of Russia?", "options": [ "Paris", "London", "Berlin", "Moscow" ], "answer": "Moscow" }, { "question": "What is the capital of India?", "options": [ "Paris", "New Delhi", "Berlin", "Madrid" ], "answer": "New Delhi" }, { "question": "What is the capital of the United States of America?", "options": [ "Washington D.C.", "London", "Berlin", "Madrid" ], "answer": "Washington D.C." }, { "question": "What is the capital of Canada?", "options": [ "Paris", "London", "Ottawa", "Madrid" ], "answer": "Ottawa" }, { "question": "What is the capital of Australia?", "options": [ "Paris", "London", "Berlin", "Canberra" ], "answer": "Canberra" } ], }
GET /questions-generator/usage
Get your usage by sending a GET request to this endpoint.
Response
Response example for a successful request:
{ "usedCredits": 150, "totalCredits": 1000, "creditsLeft": 850 }
Error codes
The Questions Generator API uses the following error codes:
Code
Description
400
Bad Request — Your request is invalid.
401
Unauthorized — Your API key is invalid.
Supported languages
This is a list of all the languages that are supported by the questions generator API. You will need to provide the language as in Title. The default value is `Auto` which means that the language will be detected automatically.
Title
Language
English
English
Arabic
العربية
Afrikaans
Afrikaans
Albanian
Shqip
Armenian
Հայերեն
Assamese
অসমীয়া
Azerbaijani
Azərbaycanca
Bashkir
Башҡорт
Basque
Euskara
Belarusian
Беларуская
Bengali
বাংলা
Bhojpuri
भोजपुरी
Bosnian
Bosanski
Brazilian Portuguese
Português do Brasil
Bulgarian
Български
Cantonese (Yue)
粵語
Catalan
Català
Chinese
中文
Croatian
Hrvatski
Czech
Čeština
Danish
Dansk
Dutch
Nederlands
Estonian
Eesti
Faroese
Føroyskt
Filipino
Filipino
Finnish
Suomi
French
Français
Galician
Galego
Georgian
ქართული
German
Deutsch
Greek
Ελληνικά
Gujarati
ગુજરાતી
Haitian Creole
Kreyòl Ayisyen
Hausa
Hausa
Hebrew
עברית
Hindi
हिन्दी
Hmong
Hmoob
Hungarian
Magyar
Icelandic
Íslenska
Igbo
Igbo
Indonesian
Bahasa Indonesia
Irish
Gaeilge
Italian
Italiano
Japanese
日本語
Kannada
ಕನ್ನಡ
Kazakh
Қазақ
Khmer
ភាសាខ្មែរ
Korean
한국어
Kurdish
Kurdî
Lao
ລາວ
Latvian
Latviešu
Lithuanian
Lietuvių
Malay
Bahasa Melayu
Maltese
Malti
Marathi
मराठी
Mongolian
Монгол
Nepali
नेपाली
Norwegian
Norsk
Pashto
پښتو
Persian
فارسی
Polish
Polski
Portuguese
Português
Romanian
Română
Russian
Русский
Serbian
Српски
Sinhala
සිංහල
Slovak
Slovenčina
Slovenian
Slovenščina
Spanish
Español
Swahili
Kiswahili
Swedish
Svenska
Tamil
தமிழ்
Telugu
తెలుగు
Thai
ไทย
Turkish
Türkçe
Ukrainian
Українська
Urdu
اردو
Vietnamese
Tiếng Việt