Vietnamese quiz parser API
Read a Vietnamese multiple-choice exam from Word or text ("Câu 1. … A. … B. …") with its answers and export JSON, GIFT, Aiken, Moodle XML or Quizizz CSV.
Send an exam as a Word file (.docx) or plain text written the usual Vietnamese way: questions start with Câu 1. / Câu 1: (or 1. when no "Câu" is used), options with A. B. … on separate lines or on one line separated by tabs, and true-false statements with a) b) …. The parser follows the 2025 THPT exam structure: PHẦN I multiple choice, PHẦN II true / false statements, PHẦN III short answers, and keeps reading passages ("Đọc đoạn văn sau và trả lời câu hỏi từ 4 đến 5") as groups.
The correct answer is found the way teachers mark it: an underlined option letter, red or highlighted text, a bold letter when the others are not, a * before the letter, an Đáp án: B line under the question, or an answer table at the end (BẢNG ĐÁP ÁN, 1.B 2.C …, a table of numbers and letters, ĐSĐS for true-false). Explanations (Lời giải:, Hướng dẫn giải:) are kept. Images in the Word file come back as data URIs with [img:img1] markers in the text; equations (OMML) are read as plain text.
format converts the result: gift and moodle_xml for Moodle, aiken, quizizz_csv (Quizizz spreadsheet template), kahoot_csv (columns of the Kahoot template) and a generic csv for Google Sheets / Forms add-ons. Warnings list questions without an answer, duplicate numbers or texts and odd option counts. Files are processed in memory and not stored.
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
file | body | file | no | The exam as .docx (or .txt): multipart, raw body or file_base64. | |
text | body | string | no | The exam as plain text instead of a file. | |
format | body|query | string | no | json | json, gift, aiken, moodle_xml, quizizz_csv, kahoot_csv or csv (export returned in output). |
images | body|query | boolean | no | true | false: list images without their data URIs. |
time_seconds | body|query | number | no | 30 | Time per question for Quizizz / Kahoot exports. |
Example
curl -X POST "https://apibox.io.vn/v1/vn-quiz-parse" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Câu 1. Thủ đô của Việt Nam là\nA. TP. Hồ Chí Minh\t*B. Hà Nội\nC. Đà Nẵng\tD. Huế\nCâu 2. 2 + 2 = ?\nA. 3\nB. 4\nC. 5\nD. 6\nĐáp án: B\nLời giải: 2 + 2 = 4."}'const res = await fetch('https://apibox.io.vn/v1/vn-quiz-parse', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"text": "Câu 1. Thủ đô của Việt Nam là\nA. TP. Hồ Chí Minh\t*B. Hà Nội\nC. Đà Nẵng\tD. Huế\nCâu 2. 2 + 2 = ?\nA. 3\nB. 4\nC. 5\nD. 6\nĐáp án: B\nLời giải: 2 + 2 = 4."
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/vn-quiz-parse",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"text": "Câu 1. Thủ đô của Việt Nam là\nA. TP. Hồ Chí Minh\t*B. Hà Nội\nC. Đà Nẵng\tD. Huế\nCâu 2. 2 + 2 = ?\nA. 3\nB. 4\nC. 5\nD. 6\nĐáp án: B\nLời giải: 2 + 2 = 4."},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/vn-quiz-parse');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"text":"Câu 1. Thủ đô của Việt Nam là\\nA. TP. Hồ Chí Minh\\t*B. Hà Nội\\nC. Đà Nẵng\\tD. Huế\\nCâu 2. 2 + 2 = ?\\nA. 3\\nB. 4\\nC. 5\\nD. 6\\nĐáp án: B\\nLời giải: 2 + 2 = 4."}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"question_count": 2,
"by_type": {
"multiple_choice": 2
},
"answered": 2,
"sections": [
{
"index": 0,
"title": "",
"type": null
}
],
"groups": [],
"warnings": [],
"answer_keys": [],
"questions": [
{
"number": 1,
"section": 0,
"type": "multiple_choice",
"points": null,
"stem": "Thủ đô của Việt Nam là",
"options": [
{
"label": "A",
"text": "TP. Hồ Chí Minh"
},
{
"label": "B",
"text": "Hà Nội"
},
{
"label": "C",
"text": "Đà Nẵng"
},
{
"label": "D",
"text": "Huế"
}
],
"answer": [
"B"
],
"answer_text": null,
"answer_source": "asterisk",
"explanation": null,
"group": null
},
{
"number": 2,
"section": 0,
"type": "multiple_choice",
"points": null,
"stem": "2 + 2 = ?",
"options": [
{
"label": "A",
"text": "3"
},
{
"label": "B",
"text": "4"
},
{
"label": "C",
"text": "5"
},
{
"label": "D",
"text": "6"
}
],
"answer": [
"B"
],
"answer_text": null,
"answer_source": "answer_line",
"explanation": "2 + 2 = 4.",
"group": null
}
]
}
Use cases
- Import Word exams into an LMS or exam app
- Turn a teacher’s .docx into Quizizz, Kahoot or Moodle quizzes
- Check an exam for missing answers before printing
- Build a question bank from existing Word files
FAQ
How must the correct answer be marked?
Any common way: underlined or red / highlighted option, a "*" before the letter, an "Đáp án: B" line, or an answer table at the end. The first marking style that singles out options in a question is used.
Are old .doc files and MathType equations supported?
Save .doc files as .docx first. Word equations are read as text; MathType objects only come through as their preview image.
Does it handle the 2025 THPT format?
Yes: parts I (4 options), II (true-false statements a–d, answers like ĐSĐS) and III (short answer) are recognised, with numbering restarting in each part.
Related APIs
Image Metadata & EXIF
Read image dimensions, format, EXIF camera data, capture settings and GPS location from JPEG, PNG, WebP, HEIC, AVIF, GIF and more – upload or URL.
PDFPDF Metadata
Read PDF metadata: page count, title, author, creator, producer, dates, PDF version, encryption, form fields and the size of each page (A4, Letter…).
PDF₫Quote & Receipt PDF
Generate clean PDF quotations, receipts, orders and simple invoices from JSON, with Vietnamese text, VAT, totals in words and a VietQR code for payment.