Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/teng-lin/notebooklm-py/llms.txt

Use this file to discover all available pages before exploring further.

This page walks you through the complete end-to-end flow: install the package, log in with your Google account, create a notebook, add sources, ask questions, generate an Audio Overview, and download the result. Each step shows the CLI command and the equivalent Python API call side by side.

Before you begin

Install notebooklm-py with browser support if you have not done so already. See Install notebooklm-py for platform-specific instructions.
pip install "notebooklm-py[browser]"
playwright install chromium

End-to-end flow

1

Authenticate

The first thing you need to do is log in with your Google account. notebooklm-py opens a Chromium browser window and saves your session cookies to ~/.notebooklm/profiles/default/storage_state.json.
notebooklm login
Log in with your Google account in the browser window that opens, then return to the terminal and press Enter to save the session.For organizations that require Microsoft Edge for SSO:
notebooklm login --browser msedge
2

Create a notebook

Create a new notebook to hold your sources and generated content.
notebooklm create "My Research"
The command prints the new notebook ID. Set it as the active notebook so you do not need to pass it to every subsequent command:
notebooklm use <notebook_id>
3

Add sources

Add sources from URLs, YouTube videos, and local files. NotebookLM indexes the content before you can chat with it.
# Add a web page
notebooklm source add "https://en.wikipedia.org/wiki/Artificial_intelligence"

# Add a YouTube video
notebooklm source add "https://www.youtube.com/watch?v=example"

# Add a local PDF
notebooklm source add "./paper.pdf"
4

Chat with your sources

Ask questions about the content you added. Answers include inline citations that reference specific sources.
notebooklm ask "What are the key themes?"
5

Generate an Audio Overview

Generate a podcast-style Audio Overview from your sources. Generation is asynchronous—use --wait on the CLI or wait_for_completion() in Python to block until it finishes.
notebooklm generate audio "make it engaging" --wait
Always use --wait for generation commands on the CLI. Without it the command returns immediately after submitting the task, and the artifact may not be ready to download yet. In Python, call wait_for_completion() before downloading.
6

Download the artifact

After generation completes, download the artifact to a local file.
notebooklm download audio ./podcast.mp3
Other download examples:
notebooklm download video ./overview.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

Full Python example

The following script combines all steps above into a single runnable program.
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", wait=True)

        # Chat with your sources
        result = await client.chat.ask(nb.id, "Summarize this")
        print(result.answer)

        # Generate an Audio Overview and download it
        status = await client.artifacts.generate_audio(nb.id, instructions="make it fun")
        await client.artifacts.wait_for_completion(nb.id, status.task_id)
        await client.artifacts.download_audio(nb.id, "podcast.mp3")

        # Generate a quiz and download as JSON
        status = await client.artifacts.generate_quiz(nb.id)
        await client.artifacts.wait_for_completion(nb.id, status.task_id)
        await client.artifacts.download_quiz(nb.id, "quiz.json", output_format="json")

        # Generate a mind map and export
        result = await client.artifacts.generate_mind_map(nb.id)
        await client.artifacts.download_mind_map(nb.id, "mindmap.json")

asyncio.run(main())

Next steps

Authentication

Learn how sessions are stored, how to use profiles for multiple accounts, and how to authenticate in CI/CD.

Python API guide

Explore the full async Python client with all available methods.

CLI reference

See all CLI commands with options and examples.

Content generation

Generate all NotebookLM Studio content types with format and style control.

Build docs developers (and LLMs) love