notebooklm-py
14,259
⭐ Stars
1,984
🍴 Forks
8
🐛 Issues

A Comprehensive NotebookLM Skill & Unofficial Python API

Full programmatic access to NotebookLM's features—including capabilities the web UI doesn't expose—via Python, CLI, and AI agents.

⚠️
Unofficial Library - Use at Your Own Risk
This library uses undocumented Google APIs that can change without notice. Not affiliated with Google. Best for prototypes, research, and personal projects.

What You Can Build

🤖

AI Agent Tools

Integrate NotebookLM into Claude Code, Codex, and other LLM agents. Ships with root NotebookLM skill for GitHub and npx discovery.

📚

Research Automation

Bulk-import sources (URLs, PDFs, YouTube, Google Drive), run web/Drive research queries with auto-import, and extract insights programmatically.

🎙️

Content Generation

Generate audio overviews, videos, slide decks, quizzes, flashcards, infographics, data tables, mind maps, and study guides with full control.

📥

Downloads & Export

Download all generated artifacts locally (MP3, MP4, PDF, PNG, CSV, JSON, Markdown). Export to Google Docs/Sheets. Features the web UI doesn't offer.

Three Ways to Use

Method Best For
Python API Application integration, async workflows, custom pipelines
CLI Shell scripts, quick tasks, CI/CD automation
Agent Integration Claude Code, Codex, LLM agents, natural language automation

Quick Start

# Install with browser support pip install "notebooklm-py[browser]" playwright install chromium # Authenticate notebooklm login # Create notebook and add sources notebooklm create "My Research" notebooklm source add "https://example.com" notebooklm source add "./paper.pdf" # Chat and generate content notebooklm ask "What are the key themes?" notebooklm generate audio --wait notebooklm download audio ./podcast.mp3
import asyncio from notebooklm import NotebookLMClient async def main(): async with await NotebookLMClient.from_storage() as client: # Create notebook and add sources nb = await client.notebooks.create("Research") await client.sources.add_url(nb.id, "https://example.com") # Chat with sources result = await client.chat.ask(nb.id, "Summarize this") print(result.answer) # Generate content status = await client.artifacts.generate_audio(nb.id, instructions="make it fun") await client.artifacts.wait_for_completion(nb.id, status.task_id) asyncio.run(main())
# Install skill locally notebooklm skill install # Or via npm npx skills add teng-lin/notebooklm-py # Check skill status notebooklm skill status

Platform Support

🍎

macOS

✅ Tested

Primary development platform

🐧

Linux

✅ Tested

Fully supported

🪟

Windows

✅ Tested

Tested in CI

Documentation

CLI Reference

Complete command documentation and usage examples

View Documentation →

Python API

Full API reference with method signatures and examples

View Documentation →

Configuration

Storage and settings configuration guide

View Documentation →

Troubleshooting

Common issues and solutions for debugging

View Documentation →

Development Guide

Architecture, testing, and releasing guidelines

View Documentation →

Security

Security policy and credential handling best practices

View Documentation →