BUILD GUIDE · EDUCATORS

How to build a YouTube quiz and worksheet generator for teachers

Teachers assign YouTube videos constantly, then spend their evenings writing questions to check that students watched and understood. A quiz generator reads the transcript and produces questions, vocabulary and an answer key in seconds.

Who it's for
K-12 teachers, tutors, corporate trainers
Build time
Weekend
API endpoints
/transcribe

The problem it solves

Writing good comprehension questions for a 15-minute video takes 30 minutes or more, and teachers do it for many videos a week. Generic AI tools often invent content that isn't in the video. Teachers need questions grounded in what was actually said, at the right level, in formats they already use.

What to include in your first version

  • Multiple-choice, short-answer and true/false questions
  • Reading level and difficulty settings
  • An answer key with the timestamp where each answer is explained
  • Vocabulary lists with definitions
  • Export to Google Forms, PDF and common learning platforms

How to build it, step by step

  1. 01

    Fetch the transcript

    Call /transcribe with format.timestamp for the lesson video.

  2. 02

    Generate grounded questions

    Ask an LLM to write questions using only the transcript, and to return the segment timestamp that supports each answer.

  3. 03

    Let the teacher edit

    Show questions in an editor where the teacher can regenerate, reorder or remove them.

  4. 04

    Export

    Create a Google Form, printable PDF or LMS file with the quiz and a separate answer key.

Starter code

This idea is built on the "Recipe 1: One video in, structured output out" pattern. Swap in your own channels, prompts and storage.

import requests

API = "https://www.youtubetranscript.dev/api/v2"
HEADERS = {"Authorization": "Bearer yt_sk_live_YOUR_KEY"}

res = requests.post(f"{API}/transcribe", headers=HEADERS, json={
    "video": "https://www.youtube.com/watch?v=VIDEO_ID",
    "format": {"timestamp": True, "paragraphs": True},
}).json()

transcript = res["data"]["transcript"]
print(transcript["text"][:500])        # plain text for your LLM prompt
for seg in transcript["segments"][:3]:  # timestamps for deep links
    print(seg["start"], seg["text"])

Why it's worth building

A freemium model works well: a few free quizzes per month, then a low monthly price for individual teachers and site licenses for schools and districts. Corporate trainers will pay more for compliance and onboarding videos.

Mistakes to avoid

  • Questions about things not in the video: ground every question in the transcript and show its timestamp.
  • One difficulty for everyone: let teachers choose grade level and question type.
  • Ignoring the formats teachers already use: export to their existing tools rather than asking them to switch.

Questions about this idea

Can AI make a quiz from a YouTube video?

Yes. With the video's transcript, an AI model can write questions based on what was said, including the timestamp where each answer appears.

Does it work for videos in other languages?

Yes. Fetch captions in the video's language or translate the transcript, then generate questions in the language your students need.

Is there a ready-made version for students?

Our Study app already turns YouTube videos into notes, flashcards and quizzes, and you can build your own version with the API.

Start building today

10 free credits every month. No credit card needed.

How to Build a YouTube Quiz Generator for Teachers | YouTubeTranscript.dev