| name | notebooklm |
| description | Programmatic access to Google NotebookLM via the notebooklm-py CLI and Python API. Use this skill whenever the user wants to create notebooks, add sources (URLs, YouTube, PDFs, files), generate audio overviews/podcasts, videos, slide decks, quizzes, flashcards, infographics, reports, mind maps, or data tables from their research materials. Also use when the user mentions NotebookLM, wants to turn documents into podcasts, generate study materials, or automate any NotebookLM workflow — even if they don't explicitly say "NotebookLM". Triggers on: podcast from documents, audio overview, NotebookLM, notebook research, generate quiz from PDF, flashcards from notes, study materials, deep dive audio.
|
NotebookLM Automation
Unofficial Python CLI and API for Google NotebookLM (notebooklm-py). Provides full programmatic access including capabilities the web UI doesn't expose.
Prerequisites
- Python 3.10+
- Google account with NotebookLM access
- One-time browser login via Playwright
Installation
pip install "notebooklm-py[browser]"
playwright install chromium
playwright install-deps chromium
Authentication
First-time setup requires browser login:
notebooklm login
Check auth status: notebooklm auth check --test
For headless/CI environments, copy storage_state.json from a local machine or set NOTEBOOKLM_AUTH_JSON env var.
Environment Variables
| Variable | Description | Default |
|---|
NOTEBOOKLM_HOME | Config directory | ~/.notebooklm |
NOTEBOOKLM_AUTH_JSON | Inline auth JSON (CI/CD) | — |
NOTEBOOKLM_LOG_LEVEL | DEBUG/INFO/WARNING/ERROR | WARNING |
NOTEBOOKLM_DEBUG_RPC | Enable RPC debug (1) | false |
Core Workflow
The typical workflow is: create notebook → add sources → generate content → download.
1. Notebook Management
notebooklm create "My Research"
notebooklm list
notebooklm use <id>
notebooklm summary
notebooklm rename "New Title"
notebooklm delete <id>
2. Adding Sources
Sources are auto-detected by type:
notebooklm source add "https://example.com/article"
notebooklm source add "https://youtube.com/watch?v=..."
notebooklm source add ./document.pdf
notebooklm source add-drive <drive-file-id> "Title"
notebooklm source add-research "climate policy" --mode deep --import-all
Other source commands:
notebooklm source list
notebooklm source fulltext <id>
notebooklm source guide <id>
notebooklm source rename <id> "New"
notebooklm source refresh <id>
notebooklm source delete <id>
3. Chat / Q&A
notebooklm ask "What are the key findings?" -s <source_id>
notebooklm ask "Compare sources" --json --save-as-note --note-title "Comparison"
notebooklm history
notebooklm history --save
4. Content Generation
All generate commands support: -s/--source (repeatable, limit to specific sources), --json, --language, --retry N.
Most are async — use --wait to block until complete.
Audio Overviews (Podcasts)
notebooklm generate audio "Focus on practical applications" \
--format deep-dive \
--length long \
--wait
Video Overviews
notebooklm generate video "Explain the architecture" \
--format explainer \
--style whiteboard \
--wait
Slide Decks
notebooklm generate slide-deck "Executive summary" \
--format detailed \
--length default \
--wait
notebooklm generate revise-slide "Add more data points" \
-a <artifact_id> --slide 2 --wait
Study Materials
notebooklm generate quiz --difficulty hard --quantity more --wait
notebooklm generate flashcards --difficulty medium --wait
Visual & Data
notebooklm generate infographic \
--orientation landscape \
--detail detailed \
--wait
notebooklm generate mind-map
notebooklm generate data-table "Compare metrics across studies" --wait
Reports
notebooklm generate report "Security analysis" \
--format briefing-doc \
--append "Include threat modeling" \
--wait
5. Downloading Content
All download commands support: -a/--artifact, --all, --latest, --earliest, --name, --force, --no-clobber, --dry-run, --json.
notebooklm download audio ./podcast.mp3
notebooklm download video ./overview.mp4
notebooklm download slide-deck ./slides.pptx --format pptx
notebooklm download infographic ./info.png
notebooklm download report ./report.md
notebooklm download mind-map ./map.json
notebooklm download data-table ./data.csv
notebooklm download quiz --format json ./quiz.json
notebooklm download flashcards --format markdown ./cards.md
6. Sharing
notebooklm share status
notebooklm share public --enable
notebooklm share view-level full
notebooklm share add user@email.com --permission editor -m "Check this out"
notebooklm share remove user@email.com
7. Language
notebooklm language list
notebooklm language get
notebooklm language set ja
Python API
Fully async API for programmatic workflows:
import asyncio
from notebooklm import NotebookLMClient
async def main():
async with await NotebookLMClient.from_storage() as client:
nb = await client.notebooks.create("Research")
await client.sources.add_url(nb.id, "https://example.com")
artifact = await client.artifacts.generate_audio(
nb.id, description="Deep dive on findings",
format=AudioFormat.DEEP_DIVE, length=AudioLength.LONG
)
await client.artifacts.wait(nb.id, artifact.id)
await client.artifacts.download_audio(nb.id, artifact.id, "output.mp3")
result = await client.chat.ask(nb.id, "Summarize key points")
print(result.answer)
asyncio.run(main())
API modules: client.notebooks, client.sources, client.artifacts, client.chat, client.research, client.notes, client.settings, client.sharing
Common Recipes
Research-to-Podcast Pipeline
notebooklm create "Climate Research"
notebooklm use <id>
notebooklm source add "https://en.wikipedia.org/wiki/Climate_change"
notebooklm source add-research "climate change solutions 2025" --mode deep --import-all
notebooklm generate audio "Focus on actionable solutions" --format debate --length long --wait
notebooklm download audio ./climate-debate.mp3
Document Analysis to Study Materials
notebooklm create "Exam Prep"
notebooklm use <id>
notebooklm source add ./textbook.pdf
notebooklm generate quiz --difficulty hard --quantity more --wait
notebooklm generate flashcards --wait
notebooklm download quiz --format markdown ./quiz.md
notebooklm download flashcards --format json ./cards.json
Batch Import + Full Report
notebooklm create "Literature Review"
notebooklm use <id>
for f in ./papers/*.pdf; do notebooklm source add "$f"; done
notebooklm generate report "Systematic review" --format briefing-doc --wait
notebooklm download report ./review.md
Troubleshooting
| Issue | Fix |
|---|
| Auth expired | Run notebooklm login again |
playwright not found | pip install "notebooklm-py[browser]" then playwright install chromium |
| Generation stuck | Use notebooklm source wait <id> for pending sources, check --retry flag |
| Partial ID not matching | Use more characters of the notebook ID |
| Debug API calls | Set NOTEBOOKLM_LOG_LEVEL=DEBUG or NOTEBOOKLM_DEBUG_RPC=1 |
Gotchas
- Source upload >200MB silently fails after the request returns 200 — downstream shows "processing" forever. Pre-check file size before upload.
- Concurrent audio/video generation per project is rate-limited — second concurrent gen fails with a generic "try again later". Serialize generation jobs.
- gcloud auth vs notebooklm-account differ — a user logged into gcloud may not have notebooklm access; pass
--account explicitly when they diverge.
- Source ordering at upload affects citation precedence in generated content — re-uploading to fix order changes the output style.
- Studio types have different timeout windows — audio ~5min, video ~15min, slides ~3min. CLI default of 60s drops mid-generation for the longer types.