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.
client.sources lets you populate notebooks with content from anywhere — web pages, YouTube videos, local files, plain text, or Google Drive documents. Every source is identified by a source_id string scoped to a specific notebook. You can read the full indexed text of any source, get an AI-generated summary and keyword guide, and check whether a URL-based source needs refreshing.
Supported source types
SourceType | Description |
|---|---|
WEB_PAGE | Any public web URL |
YOUTUBE | YouTube video (transcript indexed) |
PDF | PDF file uploaded locally |
MARKDOWN / DOCX / CSV / EPUB | Document file types |
PASTED_TEXT | Inline text content |
GOOGLE_DOCS / GOOGLE_SLIDES / GOOGLE_SPREADSHEET | Google Drive native formats |
GOOGLE_DRIVE_AUDIO / GOOGLE_DRIVE_VIDEO | Audio/video files in Drive |
IMAGE | Image file (OCR’d) |
MEDIA | Other audio or video file |
Methods
list(notebook_id)
Returns all sources in a notebook.
The notebook ID.
List of
Source objects ordered by creation time.get(notebook_id, source_id)
Returns a single source by ID, or None if not found.
The notebook ID.
The source ID to retrieve.
Source object with current status, or None if the source does not exist.get_fulltext(notebook_id, source_id)
Returns the full text that NotebookLM has indexed from a source. This is exactly the content used for chat answers and artifact generation.
The notebook ID.
The source ID.
Object with fields:
source_id, title, content (full indexed text), url (original URL or None), char_count, and a kind property returning a SourceType enum.SourceNotFoundError if the source does not exist or returns no data.
SourceFulltext.find_citation_context() to locate chat citations inside the fulltext:
get_guide(notebook_id, source_id)
Returns the AI-generated Source Guide — a markdown summary with bold keywords and a flat list of topic keywords. This mirrors the guide shown in the NotebookLM sidebar when you click a source.
The notebook ID.
The source ID.
Dict with
summary (str, markdown with bold keywords) and keywords (list of str).add_url(notebook_id, url, wait, wait_timeout)
Adds a public web URL as a source. YouTube URLs are detected automatically and routed through the YouTube ingestion path.
The notebook ID.
The public URL to add.
When
True, blocks until the source finishes processing (status becomes READY or ERROR).Maximum seconds to wait when
wait=True.The created
Source object. If wait=False, status may still be PROCESSING.SourceAddError on API failure. SourceTimeoutError if wait=True and timeout is reached.
YouTube URLs: You do not need a separate method for YouTube. Pass any YouTube URL (
youtube.com/watch?v=..., youtu.be/..., youtube.com/shorts/...) to add_url() and it automatically routes through the YouTube ingestion path, indexing the video transcript.add_text(notebook_id, title, content, wait, wait_timeout)
Adds a plain-text string directly as a source (equivalent to “Paste text” in the UI).
The notebook ID.
Display title for this source.
The text content to index.
Block until the source is ready.
Maximum seconds to wait when
wait=True.The created
Source object.add_file(notebook_id, path, mime_type, wait, wait_timeout)
Uploads a local file using Google’s resumable upload protocol. Files are streamed in 64 KB chunks so large documents don’t exhaust memory.
The notebook ID.
Path to the local file. Supported formats: PDF, TXT, Markdown, EPUB, DOCX, CSV, audio, video, and image files.
MIME type hint. Currently unused by the upload implementation; the API infers type from content.
Block until processing is complete.
Maximum seconds to wait when
wait=True.The created
Source object. The kind property reflects the actual type only after processing completes.add_drive(notebook_id, file_id, title, mime_type, wait, wait_timeout)
Adds a Google Drive document as a source using the Drive file ID.
The notebook ID.
The Google Drive file ID (found in the file’s URL).
Display title for the source.
MIME type of the Drive file. Use
DriveMimeType enum values for convenience.Block until processing is complete.
Maximum seconds to wait when
wait=True.The created
Source object.rename(notebook_id, source_id, new_title)
Renames a source.
The notebook ID.
The source ID to rename.
The new display title.
Updated
Source object.refresh(notebook_id, source_id)
Re-fetches content from a URL or Drive source to pick up changes since it was originally added.
The notebook ID.
The source ID to refresh.
True when the refresh was successfully initiated.check_freshness(notebook_id, source_id)
Checks whether a source’s remote content has changed since it was last indexed.
The notebook ID.
The source ID to check.
True if the source is up to date; False if it needs refreshing.delete(notebook_id, source_id)
Permanently removes a source from a notebook.
The notebook ID.
The source ID to delete.
True when deletion succeeds.Complete example
Source dataclass
Unique source identifier within the notebook.
Display title, or
None for untitled sources.Original URL for web and Drive sources, or
None for uploaded files and text.Creation timestamp.
Property returning a
SourceType str-enum. Supports both enum and string comparison: src.kind == SourceType.PDF and src.kind == "pdf" are both valid.