MCQ Generator, AI Quiz Builder from PDF, DOCX & Text API

Upload a PDF, Word doc, or paste any study material this widget uses Google Gemini AI to generate contextual multiple choice questions at your chosen difficulty

Input

Send these Fields as input. A Field not listed here is refused.

pasted_text

Paste Text

  • Type: string
  • Required: no
  • Length in characters: at most 30000

api_key

API Key

  • Type: string
  • Required: yes
  • Length in characters: 1 to 30000

document

Upload Document

An https URL or an upload id.

  • Type: string
  • Required: yes
  • Length in characters: at least 1

num_questions

Number of Questions

  • Type: number
  • Required: yes

difficulty

Difficulty Level

  • Type: string
  • Required: yes
  • Allowed values: Easy, Medium, Hard, Mixed

Run it

One call presses the Widget and answers the run once its status is succeeded or failed, however long it takes. The key is read from ABYSS_API_KEY. Install the library with npm install abysshub or pip install abysshub; cURL sends the Fields as a form.

JavaScript

// index.mjs
import Abyss, { file } from "abysshub";

const abyss = new Abyss();

const run = await abyss.run("widget_366", {
  api_key: "AIzaSyAun0xnCXav5f_tHkUAfb8_yn5Y4YDLezM",
  document: file("report.pdf"),
  num_questions: 2,
  difficulty: "Medium",
});

for (const path of await run.save("output")) {
  console.log(path);
}

Python

from abysshub import Abyss, file

abyss = Abyss()

run = abyss.run("widget_366", {
    "api_key": "AIzaSyAun0xnCXav5f_tHkUAfb8_yn5Y4YDLezM",
    "document": file("report.pdf"),
    "num_questions": 2,
    "difficulty": "Medium",
})

for path in run.save("output"):
    print(path)

cURL

curl https://api.abysshub.com/v1/widgets/widget_366/runs \
  -H "Authorization: Bearer $ABYSS_API_KEY" \
  -F api_key=AIzaSyAun0xnCXav5f_tHkUAfb8_yn5Y4YDLezM \
  -F document=@report.pdf \
  -F num_questions=2 \
  -F difficulty=Medium

A succeeded run carries its result and its output_files. Their URLs are signed for each read: re-read the run, never store a URL. A run still queued or running in the answer (after an hour, or when the API is busy) is read again at its Location with ?wait=true.

More

Keys, files, errors and limits: API access.