将我们的问题生成器API集成到您的应用程序中。仅计算成功的生成。创建帐户并立即开始。
文档
积分
$5.00
大约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`或`transcriptBased`
context
string
if type is `contextBased`
生成问题的文本
topic
string
if type is `topicBased`
要生成的问题的主题
audio
File
if type is `transcriptBased`
要转录的音频文件,支持的格式为mp3、mp4、mpeg、mpga、m4a、wav和webm。
youtubeUrl
string
if type is `transcriptBased`
要转录的YouTube视频的URL
questionType
string
true
要生成的问题类型。可以是`MCQ`,`TF`或`open`
difficulty
string
false
要生成的问题的难度。可以是`easy`,`medium`或`hard`
requestId
string
false
请求的ID。可以用于跟踪请求
测试请求
您可以通过将`request-type`标头设置为`test`来测试API,该请求不会计入您的使用情况。
响应
成功请求的响应示例:
{ "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请求来获取您的使用情况。
响应
成功请求的响应示例:
{ "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