Full programmatic access to Google NotebookLM — including features not exposed in the web UI.
Library: teng-lin/notebooklm-py ⚠️ Unofficial — Uses undocumented Google APIs. May break without notice.
Authentication must be active before any command:
bash
notebooklm login # Opens browser — log in with Google account
notebooklm list # Confirm auth works
notebooklm auth check # Diagnose auth issues
notebooklm auth check --test # Full validation including network test
Verify readiness before any workflow:
bash
notebooklm status # Active notebook and session
notebooklm doctor # Environment health check
notebooklm doctor --fix # Auto-fix issues
Explicit: /notebooklm, "use notebooklm", "with notebooklm"
Intent detection:
Run without confirmation:
notebooklm status, list, doctor — read-onlynotebooklm auth check — diagnosticsnotebooklm create — create notebooknotebooklm use <id> — set context (⚠️ single-agent only; use -n in parallel)notebooklm source add — add sourcesnotebooklm ask "..." — chat (without --save-as-note)notebooklm language list/get/set — language settingsnotebooklm profile list/create/switch — profile managementAsk user first:
notebooklm delete — destructivenotebooklm generate * — long-running, may hit rate limitsnotebooklm download * — writes to filesystemnotebooklm ask "..." --save-as-note — writes a notenotebooklm history --save — writes a noteTaskCommandLog innotebooklm loginList notebooksnotebooklm listCreate notebooknotebooklm create "Title"Set active notebooknotebooklm use <notebook_id>Show contextnotebooklm statusAdd URLnotebooklm source add "https://..."Add filenotebooklm source add ./file.pdfAdd YouTubenotebooklm source add "https://youtube.com/..."Add Drive docnotebooklm source add-drive <file_id> "Title"List sourcesnotebooklm source listWeb research (fast)notebooklm source add-research "query"Web research (deep)notebooklm source add-research "query" --mode deep --no-waitAsk a questionnotebooklm ask "question"Ask with referencesnotebooklm ask "question" --jsonSave answer as notenotebooklm ask "question" --save-as-noteChat historynotebooklm historyGenerate podcastnotebooklm generate audio "instructions"Generate videonotebooklm generate videoGenerate cinematic videonotebooklm generate cinematic-video "description"Generate slide decknotebooklm generate slide-deckGenerate quiznotebooklm generate quizGenerate flashcardsnotebooklm generate flashcardsGenerate infographicnotebooklm generate infographicGenerate mind mapnotebooklm generate mind-mapGenerate data tablenotebooklm generate data-table "description"Generate reportnotebooklm generate report --format study-guideCheck artifact statusnotebooklm artifact listWait for artifactnotebooklm artifact wait <artifact_id>Download podcastnotebooklm download audio ./podcast.mp3Download videonotebooklm download video ./video.mp4Download slides (PDF)notebooklm download slide-deck ./slides.pdfDownload slides (PPTX)notebooklm download slide-deck ./slides.pptx --format pptxDownload quiznotebooklm download quiz quiz.jsonSet languagenotebooklm language set en
URLs, YouTube videos, PDFs, text/Markdown/Word files, Google Drive docs, audio, video, images, pasted text.
bash
notebooklm source add "https://example.com/article"
notebooklm source add ./report.pdf
notebooklm source add "https://www.youtube.com/watch?v=VIDEO_ID"
notebooklm source add-drive <drive_file_id> "Doc Title"
notebooklm source list
notebooklm source fulltext <source_id> # Get indexed text content
notebooklm source guide <source_id> # Get source guide
notebooklm source wait <source_id> # Wait for indexing
notebooklm source delete <source_id>
notebooklm source delete-by-title "Exact Title"
bash
# Fast (5–10 sources, seconds)
notebooklm source add-research "AI trends 2025"
# Deep — blocking (20+ sources, waits up to 5 min)
notebooklm source add-research "AI safety" --mode deep --import-all
# Deep — non-blocking (recommended for agents)
notebooklm source add-research "AI safety" --mode deep --no-wait
notebooklm research status # Check progress
notebooklm research wait --import-all # Wait and auto-import
# Search Google Drive
notebooklm source add-research "Project Report" --from drive
Source limits by plan: Standard 50 · Plus 100 · Pro 300 · Ultra 600
bash
notebooklm ask "What are the main themes?"
# Use specific sources only
notebooklm ask "Compare these" -s src_id1 -s src_id2
# Get answer with source citations
notebooklm ask "What is X?" --json
# Save answer as note
notebooklm ask "Summarize" --save-as-note
notebooklm ask "Summarize" --save-as-note --note-title "Research Summary"
# Continue a specific conversation
notebooklm ask "Tell me more" -c <conversation_id>
notebooklm history # View history
notebooklm history --show-all # Full Q&A content
notebooklm history --save # Save as note
notebooklm history --save --note-title "Session Log"
bash
# Formats: deep-dive | brief | critique | debate
# Lengths: short | default | long
notebooklm generate audio "Focus on practical applications"
notebooklm generate audio "Compare two viewpoints" --format debate --length long
notebooklm generate audio -s src1 -s src2 # Specific sources
notebooklm generate audio --language en --json # JSON output → task_id
notebooklm download audio ./podcast.mp3
bash
# Formats: explainer | brief
# Styles: auto | classic | whiteboard | kawaii | anime | watercolor | retro-print | heritage | paper-craft
notebooklm generate video "Explain for beginners" --style whiteboard
notebooklm generate cinematic-video "Documentary-style summary"
notebooklm download video ./video.mp4
notebooklm download cinematic-video ./documentary.mp4
bash
# Formats: detailed | presenter
# Lengths: default | short
notebooklm generate slide-deck --format detailed
notebooklm download slide-deck ./slides.pdf
notebooklm download slide-deck ./slides.pptx --format pptx # ← not in web UI
# Revise individual slide (zero-indexed)
notebooklm generate revise-slide "Make title more impactful" --artifact <id> --slide 0 --wait
notebooklm generate revise-slide "Remove the table" --artifact <id> --slide 3 --wait
bash
# Difficulty: easy | medium | hard
# Quantity: fewer | standard | more
notebooklm generate quiz --difficulty hard --quantity more
notebooklm download quiz quiz.json # JSON ← not in web UI
notebooklm download quiz --format markdown quiz.md
notebooklm download quiz --format html quiz.html
bash
notebooklm generate flashcards --difficulty medium --quantity more
notebooklm download flashcards cards.json
notebooklm download flashcards --format markdown cards.md
bash
notebooklm generate mind-map # Synchronous — instant, no --wait needed
notebooklm download mind-map ./mindmap.json # ← not in web UI
bash
# Orientation: landscape | portrait | square
# Detail: concise | standard | detailed
# Style: auto | sketch-note | professional | bento-grid | editorial |
# instructional | bricks | clay | anime | kawaii | scientific
notebooklm generate infographic --orientation portrait --style professional --detail detailed
notebooklm download infographic ./infographic.png
bash
notebooklm generate data-table "Compare the key concepts"
notebooklm download data-table ./data.csv
bash
# Formats: briefing-doc | study-guide | blog-post | custom
notebooklm generate report --format study-guide
notebooklm generate report --format briefing-doc --append "Keep under 2 pages"
notebooklm generate report "Technical white paper on AI trends" # → auto custom
notebooklm generate report --format study-guide -s src1 -s src2 # Specific sources
notebooklm download report ./report.md
TypeCommandOptionsDownloadPodcastgenerate audio``--format, --length.mp3Videogenerate video``--format, --style.mp4Cinematic Videogenerate cinematic-videosame as video.mp4Slide Deckgenerate slide-deck``--format, --length.pdf / .pptxQuizgenerate quiz``--difficulty, --quantity.json/.md/.htmlFlashcardsgenerate flashcards``--difficulty, --quantity.json/.md/.htmlInfographicgenerate infographic``--orientation, --detail, --style.pngReportgenerate report``--format, --append.mdMind Mapgenerate mind-map(sync, instant).jsonData Tablegenerate data-tabledescription required.csv
All generate commands also support: -s/--source (specific sources), --language, --json, --retry N
bash
notebooklm artifact list
notebooklm artifact list --type audio # Filter by type
notebooklm artifact get <artifact_id>
notebooklm artifact rename <artifact_id> "New Title"
notebooklm artifact delete <artifact_id>
notebooklm artifact wait <artifact_id> --timeout 1200
notebooklm artifact export <artifact_id> --type docs # → Google Docs
notebooklm artifact export <artifact_id> --type sheets # → Google Sheets
notebooklm artifact suggestions
# Batch downloads (not in web UI)
notebooklm download audio --all
notebooklm download infographic --all
notebooklm download video --latest
notebooklm download audio --all --dry-run # Preview only
bash
notebooklm note list
notebooklm note create "My research notes..."
notebooklm note get <note_id>
notebooklm note save <note_id> --title "New Title" --content "Updated content"
notebooklm note rename <note_id> "New Title"
notebooklm note delete <note_id>
bash
notebooklm share status
notebooklm share public --enable
notebooklm share public --disable
notebooklm share view-level full # Chat + sources + notes
notebooklm share view-level chat # Chat only
notebooklm share add user@example.com
notebooklm share add user@example.com --permission editor
notebooklm share update user@example.com --permission editor
notebooklm share remove user@example.com
bash
notebooklm language list # List all 80+ supported languages
notebooklm language get # Show current setting
notebooklm language set en # Set globally
# Per-command override
notebooklm generate audio --language de
notebooklm generate video --language fr
Important: Language is a GLOBAL setting affecting all notebooks in your account.
Common codes: en English · de German · fr French · es Spanish · it Italian ·
pt_BR Portuguese · ja Japanese · ko Korean · zh_Hans Simplified Chinese · ar Arabic
FeatureCommandBatch downloadsdownload <type> --allQuiz/Flashcard as JSON or Markdowndownload quiz --format jsonMind map JSON exportdownload mind-mapSlide deck as PPTXdownload slide-deck --format pptxIndividual slide revisiongenerate revise-slide "..." --artifact <id> --slide NReport template appendgenerate report --format study-guide --append "..."Source full-text accesssource fulltext <id>Save chat to noteask "..." --save-as-noteProgrammatic sharingshare commands
bash
notebooklm create "Research: AI"
notebooklm use <id>
notebooklm source add "https://en.wikipedia.org/wiki/Artificial_intelligence"
notebooklm source add-research "AI trends 2025" --mode deep --import-all
notebooklm generate audio "Focus on breakthroughs and future outlook" --format debate --wait
notebooklm download audio ./ai-podcast.mp3
bash
notebooklm create "Exam Prep"
notebooklm use <id>
notebooklm source add ./lecture-notes.pdf
notebooklm source add ./textbook-chapter.pdf
notebooklm generate quiz --difficulty hard --wait
notebooklm generate flashcards --wait
notebooklm generate report --format study-guide --wait
notebooklm ask "What are the most important topics?"
bash
notebooklm create "Video Notes"
notebooklm use <id>
notebooklm source add "https://www.youtube.com/watch?v=VIDEO_ID"
notebooklm ask "What are the main points?"
notebooklm generate report --format briefing-doc --wait
notebooklm download report ./notes.md
bash
notebooklm create "Presentation: [Topic]"
notebooklm use <id>
notebooklm source add "https://source1.com"
notebooklm source add ./data.pdf
notebooklm generate slide-deck --format detailed --wait
notebooklm download slide-deck ./slides.pptx --format pptx
notebooklm generate revise-slide "Stronger opening title" --artifact <id> --slide 0 --wait
bash
NB_ID=$(notebooklm create "Bulk Research" --json | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
notebooklm use $NB_ID
SRC=$(notebooklm source add "https://url.com" --json | python3 -c "import sys,json; print(json.load(sys.stdin)['source_id'])")
notebooklm source wait $SRC --timeout 120
TASK=$(notebooklm generate audio "Overview" --json | python3 -c "import sys,json; print(json.load(sys.stdin)['task_id'])")
notebooklm artifact wait $TASK --timeout 1200
notebooklm download audio ./podcast.mp3
jsonc
// notebooklm list --json
{"notebooks": [{"id": "...", "title": "...", "created_at": "..."}]}
// notebooklm source add "..." --json
{"source_id": "...", "title": "...", "status": "processing"}
// notebooklm generate audio "..." --json
{"task_id": "...", "status": "pending"}
// notebooklm ask "..." --json
{"answer": "...[1]", "conversation_id": "...", "turn_number": 1,
"references": [{"source_id": "...", "citation_number": 1, "cited_text": "..."}]}
// notebooklm source list --json
{"sources": [{"id": "...", "title": "...", "status": "ready|processing|error"}]}
// notebooklm artifact list --json
{"artifacts": [{"id": "...", "title": "...", "type": "...", "status": "completed|in_progress|pending|unknown"}]}
ErrorCauseFixAuth/cookie errorSession expirednotebooklm auth check → notebooklm login"No notebook context"Context not setnotebooklm use <id> or -n <id> flag"No result found for RPC ID"Rate limitingWait 5–10 min, retryGENERATION_FAILEDGoogle rate limitWait and retry; use web UI as fallbackDownload failsGeneration incompleteCheck notebooklm artifact listInvalid IDWrong IDnotebooklm list to find correct IDRPC protocol errorGoogle changed APIUpdate notebooklm-py
On failure, offer the user: retry / skip / investigate.
CodeMeaning0Success1Error (not found, failed)2Timeout (wait commands only)
OperationTypical TimeTimeoutSource indexing30s – 10 min600sResearch (fast)30s – 2 min180sResearch (deep)15 – 30+ min1800sMind mapinstant—Quiz, flashcards5 – 15 min900sReport, data table5 – 15 min900sAudio generation10 – 20 min1200sVideo generation15 – 45 min2700s
Always reliable: Notebook/source management, chat, mind map, report, data table. May hit rate limits: Audio, video, quiz, flashcards, infographic, slide deck — retry after 5–10 min.
For agents, avoid
--waiton long operations. Useartifact wait <id>in a background task.
notebooklm use <id> writes to a shared file — unsafe in parallel workflows.
Solutions:
-n <notebook_id> directly to each command (recommended)export NOTEBOOKLM_PROFILE=agent-$ID — per-agent profile isolationexport NOTEBOOKLM_HOME=/tmp/agent-$ID — full isolationbash
notebooklm --help
notebooklm auth check --test # Full auth + network validation
notebooklm doctor --fix # Auto-fix environment
notebooklm login # Re-authenticate
notebooklm --version # Check version
Docs: https://github.com/teng-lin/notebooklm-py/blob/main/docs/troubleshooting.md