问题生成器API

将我们的问题生成器API集成到您的应用程序中。仅计算成功的生成。创建帐户并立即开始。

文档

积分

$5

大约100个API请求。

每个API请求生成5-10个问题。仅计算成功的生成。

问题数量


1,000


文档

将我们的问题生成器API集成到您的应用程序中。每个API请求生成5-10个问题。仅计算成功的生成。

获取密钥

订阅问题生成器API,您将在此页面中看到您的API密钥。

API端点

https://api.opexams.com

身份验证

要使用问题生成器API,您需要验证您的请求。您可以通过在api-key标头中发送您的API密钥来完成此操作。

"api-key": "YOUR-API-KEY"

POST /questions-generator

通过提供以下参数的JSON体来生成问题:

名称

类型

必需

描述

type

string

true

要生成的问题类型。可以是`contextBased``topicBased`

context

string

if type is `contextBased`

生成问题的文本

topic

string

if type is `topicBased`

要生成的问题的主题

questionType

string

true

要生成的问题类型。可以是`MCQ``TF``open`

language

string

false

生成问题的语言。您可以在此处找到支持的语言列表。默认值为`Auto`

difficulty

string

false

要生成的问题的难度。可以是`easy``medium``hard`

requestId

string

false

请求的ID。可以用于跟踪请求

测试请求

您可以通过将`request-type`标头设置为`test`来测试API,该请求不会计入您的使用情况。

响应

成功请求的响应示例:

{ "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请求来获取您的使用情况。

响应

成功请求的响应示例:

{ "usedCredits": 150, "totalCredits": 1000, "creditsLeft": 850 }

错误代码

问题生成器API使用以下错误代码:

Code

Description

400

Bad Request — Your request is invalid.

401

Unauthorized — Your API key is invalid.

支持的语言

这是问题生成器API支持的所有语言列表。您需要按照标题提供语言。默认值为`Auto`,这意味着语言将自动检测。

标题

语言

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