NotebookLM-py: Comprehensive Skill & Unofficial Python API

NotebookLM-py: A Comprehensive Guide to the Unofficial Python API, CLI, and AI Agent Toolkit
Introduction NotebookLM-py is an ambitious, community-driven library that opens up NotebookLM’s capabilities beyond the web UI. It provides full programmatic access to NotebookLM’s features through a Python API, a CLI, and AI agent integrations with Claude Code, Codex, and OpenClaw. This is an unofficial project, built to empower prototypes, research workflows, and personal projects, with the caveat that it uses undocumented Google APIs that can change without notice. The project is not affiliated with Google, and APIs may break or be rate-limited as Google adjusts its internal endpoints. Nevertheless, NotebookLM-py offers a powerful toolkit for developers who want deeper automation, batch processing, and programmable control over notebooks, sources, chat interactions, and rich artifact generation.
What NotebookLM-py Delivers NotebookLM-py is designed to enable a wide spectrum of capabilities, from research automation to content creation, all driven by programmable recipes. The library comes with a ready-made root NotebookLM skill for discovery and integration, plus local tooling for managing skills, agents, and repositories. It unlocks features that the web UI may not expose, especially at scale, and provides options for deep automation via Python, shell, or AI agents.
Key capabilities you can build with NotebookLM-py include:
AI Agent Tools
Integrate NotebookLM into popular LLM agents like Claude Code and Codex.
Ship with a root NotebookLM skill for GitHub discovery and local skill management.
Supports repo-level Codex guidance and agent directories for easy setup.
Research Automation
Bulk-import sources from URLs, PDFs, YouTube, and Google Drive.
Run web searches and Drive research queries with auto-import of results.
Build repeatable, trackable research pipelines that scale across projects.
Content Generation
Create various output artifacts—audio, video, slides, infographics, quizzes, flashcards, data tables, mind maps, and study guides.
Complete control over formats, styles, and output specifics.
Downloads & Exports
Download generated artifacts locally in multiple formats (MP3, MP4, PDF, PNG, CSV, JSON, Markdown).
Export directly to Google Docs or Google Sheets.
Access additional formats and export options not always visible in the web UI.
Features beyond the Web UI
Batch downloads of artifact types.
Quiz/flashcard exports in JSON, Markdown, or HTML.
Mind map data extraction and export.
Slide decks as editable PPTX, not just PDFs.
Fine-grained slide revisions and report template customization.
Save chat transcripts as notebook notes and access source fulltext content.
Programmatic sharing, multi-account profiles, and cookie import to streamline authentication flows.
Three Ways to Use NotebookLM-py NotebookLM-py is designed for flexibility. You can use it in three complementary ways:
Python API
Deep integration into apps, asynchronous workflows, and custom data pipelines.
Ideal for embedding NotebookLM capabilities inside larger software projects.
CLI
Scriptable shell workflows, quick automation, and CI/CD pipelines.
Suitable for one-off tasks, batch processing, and orchestration without writing Python code.
Agent Integration
Seamless usage with Claude Code, Codex, OpenClaw, and other LLM agents.
Enables natural-language-driven automation and agent-based orchestration of NotebookLM tasks.
Complete NotebookLM Coverage NotebookLM-py provides a wide range of capabilities that mirror and extend NotebookLM’s core features:
Notebooks
Create, list, rename, and delete notebooks to organize your projects and research.
Sources
Manage sources with URLs, YouTube, files (PDF, text, Markdown, Word, EPUB), images, audio, and video.
Integrate Google Drive or pasted text.
Refresh sources, retrieve guide content or full text, and keep sources up to date.
Chat
Engage in questions and conversations with preserved history.
Use custom personas to tailor interactions and results.
Research
Web and Drive research agents with fast and deep modes.
Auto-import results to consolidate findings.
Sharing
Create public or private links, manage user permissions, and control view levels.
Content Generation (All Artifact Types) NotebookLM-py supports generating a broad spectrum of artifacts. Each type comes with configurable options and export formats:
Audio Overview
Formats: MP3, MP4
Variants: deep-dive, brief, critique, debate
Length options: multiple durations
Languages: 50+ languages
Video Overview
Formats: MP4
Styles: explainer, brief, cinematic
Visual styles: multiple presets, including a cinematic-video alias for a cinematic feel
Slide Deck
Formats: PDF, PPTX
Features: detailed or presenter-focused, adjustable length, per-slide revision
Infographic
Orientations: portrait, landscape, square
Detail levels: three levels
Quiz
Configurable quantity and difficulty
Formats: JSON, Markdown, HTML
Flashcards
Configurable quantity and difficulty
Formats: JSON, Markdown, HTML
Report
Formats: Markdown
Use cases: briefing doc, study guide, blog post, or custom prompt
Data Table
Custom structure via natural language prompts
Formats: CSV
Mind Map
Interactive hierarchical visualization
Output: JSON for flexible downstream visualization
Beyond the Web UI NotebookLM-py exposes several features not readily accessible in the standard web interface:
- Batch downloads: retrieve all artifacts of a given type in one go.
- Quiz/Flashcard export: obtain structured JSON, Markdown, or HTML exports.
- Mind map data extraction: export hierarchical JSON for integration with visualization tools.
- Data table CSV export: download structured tables as spreadsheets.
- Slide deck as PPTX: export editable PowerPoint files (not only PDFs).
- Slide revision: update individual slides through natural-language prompts.
- Report template customization: append extra instructions to built-in format templates.
- Save chat to notes: preserve Q&A or conversation history as notebook notes.
- Source fulltext access: retrieve indexed text content for deeper inspection.
- Programmatic sharing: manage permissions without the UI.
- Multi-account profiles: switch Google accounts without re-authenticating.
- Browser cookie import: reuse cookies from your browser session for easier authentication.
Installation and Getting Started The full installation guide lives in docs, with an emphasis on multiple personas, an optional extras matrix, and platform-specific notes. Here is a quick-start snapshot for both CLI/AI agents and library usage.
Quickest Start for CLI users and AI agents
- Install core and browser automation components:
- pip install "notebooklm-py[browser]"
- playwright install chromium
- Authenticate (opens a browser for Google sign-in):
- notebooklm login
- Verify configuration:
- notebooklm auth check --test --json
- You should see a status of "ok"
Using NotebookLM-py as a library (embedded in your app)
- Install the library (no Playwright required):
- pip install notebooklm-py
- Ship with a pre-acquired storage_state.json to reuse session data
Notes and tips
- If you encounter a Linux-specific issue with Playwright (TypeError: onExit is not a function), consult the Linux workaround in docs/troubleshooting.md.
- Contributors and contribution guidelines are documented in CONTRIBUTING.md.
- For a quick demonstration of a typical workflow, you can check the quick-start examples below.
Quick Start Demo: A 16-Minute Session in 30 Seconds A compact demonstration is available as an asciinema recording, illustrating a flow from authentication to generating and downloading artifacts. The embedded snippet below links to a 16-minute session compressed into 30 seconds.
CLI Workflow: A Practical Recipe
- Authenticate
- notebooklm login
- You can use an alternative browser if required (for example, notebooklm login --browser msedge for some orgs with Edge SSO)
- Reuse cookies from an already-logged-in browser session
- notebooklm login --browser-cookies chrome
- notebooklm login --browser-cookies 'chrome::Profile 1'
- Create a notebook and add sources
- notebooklm create "My Research"
- notebooklm use notebooklm source add "https://en.wikipedia.org/wiki/Artificial_intelligence"
- notebooklm source add "./paper.pdf"
- Chat with your sources
- notebooklm ask "What are the key themes?"
- notebooklm ask --prompt-file ./long_question.txt
- Generate content and download artifacts
- notebooklm generate audio "make it engaging" --wait
- notebooklm generate video --style whiteboard --wait
- notebooklm generate cinematic-video "documentary-style summary" --wait
- notebooklm generate quiz --difficulty hard
- notebooklm generate flashcards --quantity more
- notebooklm generate slide-deck
- notebooklm generate infographic --orientation portrait
- notebooklm generate mind-map
- notebooklm generate data-table "compare key concepts"
- Download artifacts
- notebooklm download audio ./podcast.mp3
- notebooklm download video ./overview.mp4
- notebooklm download cinematic-video ./documentary.mp4
- notebooklm download quiz --format markdown ./quiz.md
- notebooklm download flashcards --format json ./cards.json
- notebooklm download slide-deck ./slides.pdf
- notebooklm download infographic ./infographic.png
- notebooklm download mind-map ./mindmap.json
- notebooklm download data-table ./data.csv
Other useful CLI commands (quick references)
- notebooklm auth check --test
- notebooklm auth refresh --quiet
- notebooklm auth refresh --browser-cookies chrome
- notebooklm auth inspect --browser 'chrome::Profile 1'
- notebooklm agent show codex
- notebooklm agent show claude
- notebooklm language list
- notebooklm metadata --json
- notebooklm share status
- notebooklm source add-research "AI"
- notebooklm skill status
- notebooklm profile list
- notebooklm profile switch work
Python API: A Lightweight Example Here is a compact Python example that demonstrates a typical programmatic flow:
- Create a notebook
- Add a URL source
- Chat with the sources
- Generate an artifact and download it
Code snippet (for quick reference)
- 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", wait=True)
- result = await client.chat.ask(nb.id, "Summarize this")
- print(result.answer)
- status = await client.artifacts.generate_audio(nb.id, instructions="make it fun")
- await client.artifacts.waitforcompletion(nb.id, status.task_id)
- await client.artifacts.download_audio(nb.id, "podcast.mp3")
- asyncio.run(main())
Agent Setup: Two Paths NotebookLM-py supports flexible agent deployment, with two common paths:
Option 1 — CLI install
notebooklm skill install
Installs the NotebookLM skill into:
- ~/.claude/skills/notebooklm
- ~/.agents/skills/notebooklm
Option 2 — npx install (via the Open Skills ecosystem)
npx skills add teng-lin/notebooklm-py
This fetches the canonical SKILL.md directly from GitHub
Documentation and Resources NotebookLM-py ships with comprehensive documentation that covers:
- CLI Reference: Complete command documentation
- Python API: Full API reference
- Configuration: Storage and settings
- Releasing and Troubleshooting
- API Stability and Versioning
- Architecture and Development Guides for contributors
Platform Support NotebookLM-py is designed to work across major platforms:
- macOS: Tested and reliable as the primary development platform
- Linux: Fully supported and tested
- Windows: Tested in CI environments
License NotebookLM-py is released under the MIT License. See the LICENSE file for details.
Images and Visuals in Context
- Logo: The notebooklm-py logo at the top of the post signals branding and project identity.
- Quick Start Visual: The Asciinema SVG thumbnail linked above offers a quick visual cue of the CLI-based workflow.
- Additional visuals in the original docs (not embedded here) include status badges, trend badges, and repository links that help readers gauge project health and activity.
Conclusion NotebookLM-py stands as a potent, developer-focused bridge to NotebookLM’s capabilities, extended through a Python API, a CLI, and AI-agent integrations. It enables researchers, developers, and power users to automate data collection, perform sophisticated research workflows, and generate rich artifacts with unprecedented control over formats and exports. While it carries the caveats of being unofficial and subject to API changes, its design emphasizes practical workflows, batch processing, and programmable orchestration. If you’re building experimental research pipelines, education tools, or content generation systems, NotebookLM-py offers a flexible, extensible foundation to accelerate your work. Engage with the project, test out the quick-start flows, and explore the deep integration possibilities that Python, CLI, and AI agents unlock for NotebookLM.
Enjoying this project?
Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.
Repository:https://github.com/teng-lin/notebooklm-py
GitHub - teng-lin/notebooklm-py: NotebookLM-py: Comprehensive Skill & Unofficial Python API
NotebookLM‑py is an unofficial, community‑driven library that opens up NotebookLM’s capabilities beyond the web UI. It provides a full programmatic access to No...
github - teng-lin/notebooklm-py