Questions Generator API

Integrate our questions generator API into your application. Only successful generations are counted. Create an account and get started now.

Documentation

Credits

$5

Roughly 100 API requests.

Each API request generates 5-10 questions. Only successful generations are counted.

Number of questions


1,000


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`

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

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:

{ "data": [ { "id": "pDgnjdMzOt9", "question": "Who founded University College London?", "answer": "Jeremy Bentham", "options": ["Charles Darwin", "Jeremy Bentham", "Isaac Newton", "William Shakespeare", "Albert Einstein"] }, { "id": "GZG49mXC3Jy", "question": "In what year was UCL established?", "answer": "1826", "options": ["1826", "1939", "1865", "1790", "1901"] }, { "id": "r0SclR9bOYf", "question": "What is the motto of UCL?", "answer": "Scientia et Labore", "options": ["Lux et Veritas", "In Hoc Signo Vinces", "Sapere Aude", "Scientia et Labore", "Deo Juvante"] }, { "id": "Tjadx7EYWKL", "question": "Which famous philosopher taught at UCL?", "answer": "Karl Marx", "options": ["Socrates", "Aristotle", "Plato", "Friedrich Nietzsche", "Karl Marx"] }, { "id": "Z9TxfwpFzvN", "question": "Who is the current Provost of UCL?", "answer": "David Price", "options": ["Richard Horton", "David Price", "Jeremy Farrar", "Patrick Vallance", "Mark Walport"] }, { "id": "q-DdK8od76m", "question": "Which UCL constituent college specializes in medical sciences?", "answer": "UCL Faculty of Medical Sciences", "options": ["UCL School of Slavonic and East European Studies", "UCL Institute of Education", "UCL Faculty of Laws", "UCL Faculty of Engineering Science", "UCL Faculty of Medical Sciences"] }, { "id": "0eUI1bSZpaE", "question": "What is the name of UCL's student union?", "answer": "UCLSU", "options": ["UCL Union", "UCLU", "UCLSU", "UCL Student Life", "UCL Campus Life"] }, { "id": "IXZvKXJMZoW", "question": "What is the name of UCL's main library?", "answer": "The UCL Main Library", "options": ["Senate House Library", "British Library", "UCL Library Services", "The Maughan Library", "The UCL Main Library"] }, { "id": "5qLp-pHWWnn", "question": "Which famous writer studied at UCL?", "answer": "Virginia Woolf", "options": ["Virginia Woolf", "Charles Dickens", "William Shakespeare", "Jane Austen", "Oscar Wilde"] }, { "id": "Hj2nDaEw2rW", "question": "Which famous museum is located on UCL's campus?", "answer": "The Petrie Museum of Egyptian Archaeology", "options": ["British Museum", "Science Museum", "Natural History Museum", "Victoria and Albert Museum", "The Petrie Museum of Egyptian Archaeology"] } ] }

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

Subscribe to OpExams newsletter

Get updates on education tips, new features, product releases, and more.

Contact Us: support@opexams.com

Products

Resources

© Hypatia.Tech. 2023 All rights reserved.