Unlock Programmatic Access to Google NotebookLM with notebooklm-py

The unofficial notebooklm-py library reverse‑engineers Google’s private NotebookLM API, offering a full Python and CLI interface that enables batch downloads, content export, AI‑agent integration, and automated research workflows, while outlining its architecture, quick‑start steps, suitable users, and the risk of API changes.

AI Explorer
AI Explorer
AI Explorer
Unlock Programmatic Access to Google NotebookLM with notebooklm-py

Why developers are interested

NotebookLM is a powerful AI research assistant that can converse, summarize, and create content based on uploaded material, but its official capabilities are limited to web interaction. notebooklm-py breaks this ceiling by providing programmatic access.

It addresses core pain points: lack of batch processing, difficulty integrating into automated workflows, and hidden advanced features in the web UI. The library lets you drive the entire research process with code as if calling a regular API.

Core value

Programmatic access : control NotebookLM fully with Python or CLI.

Hidden features unlocked : batch download, format export and other capabilities not available in the web UI.

AI‑agent integration : can be invoked directly by agents such as Claude Code.

Technical highlights and architecture

The core technical work is reverse‑engineering Google’s unpublished API and wrapping it in a complete asynchronous Python client that covers all NotebookLM modules. It is not a simple scraper.

The design offers three usage modes: a native async Python API, a convenient CLI, and pre‑built skills for AI agents such as Claude Code, allowing selection of the most suitable interaction model.

Feature coverage is extensive: creating notebooks, managing sources (URL, PDF, video, Google Drive), performing research queries, generating audio, video, slides, mind maps, and sharing collaboration, with virtually no missing capability.

It even provides functions absent from the web UI, such as exporting generated quizzes and flashcards in JSON or Markdown for educational technology and content automation.

Five‑minute quick start

Install the package: pip install notebooklm-py Configure Google authentication, either by using the browser_cookie3 library to extract cookies from a browser or by manually providing the __Secure-1PSID cookie.

Simple Python example that creates a notebook and adds a source:

from notebooklm import NotebookLM

async with NotebookLM() as nlm:
    notebook = await nlm.create_notebook("我的研究项目")
    source = await notebook.add_source('https://example.com/article.pdf')
    print(f"已添加源: {source.title}")

You can also use the CLI, e.g., notebooklm list to list all notebooks.

notebooklm-py project logo
notebooklm-py project logo

Who and what scenarios fit best

1. Researchers and academic workers: build automated literature‑review pipelines, batch import PDFs, and automatically generate summary audio or slides, greatly improving efficiency.

2. Content creators and educators: leverage the generation capabilities to turn research material into podcasts, videos, infographics, or study guides with a single click.

3. AI application developers and enthusiasts: use NotebookLM as a backend engine, integrate it into custom AI agents; the “Agent Skills” let Claude and similar agents operate NotebookLM via natural language.

4. Automation script hobbyists: combine the CLI or Python API to automate daily research and material‑organization tasks, such as scheduled fetching of topic‑specific resources and report generation.

Important notes and future outlook

This is an unofficial library that depends on Google’s unpublished API, so API changes may break it. The author advises using it for prototyping, research, and personal projects.

Despite the risk, notebooklm-py demonstrates an exciting shift from manual GUI interaction toward programmable, API‑driven AI tool usage.

As AI agents become more prevalent, open‑source projects that encapsulate complex AI services as standardized tools are likely to gain increasing value. notebooklm-py is both a tool and a signal of how future AI‑human collaboration may become more flexible and powerful.

Python developers interested in AI automation are encouraged to explore the GitHub repository https://github.com/teng-lin/notebooklm-py for inspiration.

CLIPythonAIAutomationReverse engineeringnotebooklm-py
AI Explorer
Written by

AI Explorer

Stay on track with the blogger and advance together in the AI era.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.