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.
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.
CLI
Python API
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
Authentication for the Python API is handled by loading the saved session from the file written by notebooklm login. You do not call a login method directly.
from notebooklm import NotebookLMClient# Loads credentials from ~/.notebooklm/profiles/default/storage_state.jsonasync with await NotebookLMClient.from_storage() as client: ...
Run notebooklm login from the CLI first, then use NotebookLMClient.from_storage() in your Python code.
2
Create a notebook
Create a new notebook to hold your sources and generated content.
CLI
Python API
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>
import asynciofrom notebooklm import NotebookLMClientasync def main(): async with await NotebookLMClient.from_storage() as client: nb = await client.notebooks.create("My Research") print(f"Created notebook: {nb.id}")asyncio.run(main())
3
Add sources
Add sources from URLs, YouTube videos, and local files. NotebookLM indexes the content before you can chat with it.
CLI
Python API
# Add a web pagenotebooklm source add "https://en.wikipedia.org/wiki/Artificial_intelligence"# Add a YouTube videonotebooklm source add "https://www.youtube.com/watch?v=example"# Add a local PDFnotebooklm source add "./paper.pdf"
from pathlib import Pathasync with await NotebookLMClient.from_storage() as client: # Add a web page await client.sources.add_url(nb.id, "https://en.wikipedia.org/wiki/Artificial_intelligence", wait=True) # Add a YouTube video await client.sources.add_youtube(nb.id, "https://www.youtube.com/watch?v=example") # Add a local PDF await client.sources.add_file(nb.id, Path("./paper.pdf"))
Pass wait=True to block until NotebookLM finishes indexing the source.
4
Chat with your sources
Ask questions about the content you added. Answers include inline citations that reference specific sources.
CLI
Python API
notebooklm ask "What are the key themes?"
async with await NotebookLMClient.from_storage() as client: result = await client.chat.ask(nb.id, "What are the key themes?") print(result.answer) # Continue the conversation follow_up = await client.chat.ask( nb.id, "Can you elaborate on the first point?", conversation_id=result.conversation_id ) print(follow_up.answer)
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.
CLI
Python API
notebooklm generate audio "make it engaging" --wait
async with await NotebookLMClient.from_storage() as client: status = await client.artifacts.generate_audio(nb.id, instructions="make it fun") await client.artifacts.wait_for_completion(nb.id, status.task_id)
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.
async with await NotebookLMClient.from_storage() as client: await client.artifacts.download_audio(nb.id, "podcast.mp3") # Download a quiz as JSON await client.artifacts.download_quiz(nb.id, "quiz.json", output_format="json") # Download a mind map await client.artifacts.download_mind_map(nb.id, "mindmap.json")
The following script combines all steps above into a single runnable program.
import asynciofrom notebooklm import NotebookLMClientasync 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())