notebooklm

package module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

README

notebooklm-go

Unofficial pure-Go client for Google NotebookLM's internal RPC. Reverse-engineered from the browser bundle. Use at your own risk. Not affiliated with or endorsed by Google.

notebooklm-go lets Go programs (and via the bundled notebooklm CLI, shell / Python / JS / cron / Makefile users too) drive NotebookLM programmatically — list notebooks, add sources (PDF / URL / text), trigger Audio Overviews / Reports / Mind Maps / Slide Decks / Deep Research, and download generated artifacts. No browser automation, no Selenium — direct HTTPS calls to the same batchexecute RPC that the official JS bundle uses.

go install github.com/LocalKinAI/notebooklm-go/cmd/notebooklm-go@latest
notebooklm-go login       # paste Google session cookie
notebooklm-go list        # list your notebooks

Why the binary is notebooklm-go, not notebooklm — the binary name notebooklm is already taken by the npm package notebooklm (Node.js port) and the PyPI package notebooklm-py (Python port). Suffixing -go lets all three coexist on the same machine without $PATH collisions. The Go package import stays notebooklm (import notebooklm "github.com/LocalKinAI/notebooklm-go").

Why this exists

NotebookLM is one of the highest-quality consumer LLM products Google ships: feed it PDFs/URLs, get back a 10–15 min conversational audio overview, a mind map, a slide deck, a deep research report. The model runs free for logged-in users (no API, no metering, no token bill).

There is, deliberately, no public API. Google's product economics require it stay UI-only — opening an API would commoditize the most expensive feature in their consumer line.

Yet programmatic access has obvious uses: bulk-processing a research library, archiving your own workflow, plugging NotebookLM into an agent system, building content pipelines.

The official client (the JS bundle) talks to notebooklm.google.com/ _/LabsTailwindUi/data/batchexecute over plain HTTPS. This library talks to the same endpoint, using your existing session cookie.

⚠️ Disclaimer

  • Reverse-engineered. Endpoints and RPC method IDs may change without notice. The library will break when Google changes them; pin to a release tag, not master.
  • Personal use only. High-volume / commercial scraping likely violates Google's Terms of Service. We don't recommend running this at fleet scale against accounts you don't own.
  • Not endorsed by Google. No warranty. No support contract. No promises about availability. If Google decides this protocol isn't reachable from non-browser clients, the library breaks.
  • Bring your own session. This library uses your logged-in Google session cookie. Anything you can do in the UI, the library can do — including delete your notebooks. Use a dedicated account if you're nervous.

Install

As a Go library
go get github.com/LocalKinAI/notebooklm-go@latest
package main

import (
    "fmt"
    "log"

    notebooklm "github.com/LocalKinAI/notebooklm-go"
)

func main() {
    // Reads cookies from ~/.config/notebooklm-go/auth.json by default.
    client, err := notebooklm.NewClient(notebooklm.DefaultStoragePath())
    if err != nil {
        log.Fatal(err)
    }

    notebooks, err := client.ListNotebooks()
    if err != nil {
        log.Fatal(err)
    }
    for _, nb := range notebooks {
        fmt.Printf("%s\t%s\n", nb.ID, nb.Title)
    }
}

See examples/ for runnable variants: list_notebooks, add_pdf_source, generate_audio_overview.

As a CLI
go install github.com/LocalKinAI/notebooklm-go/cmd/notebooklm-go@latest

notebooklm-go login                                # opens browser for one-time OAuth
notebooklm-go list                                 # list notebooks
notebooklm-go create "Paper Reading List"          # create a new notebook
notebooklm-go add <id> https://arxiv.org/pdf/X.pdf # add a URL source
notebooklm-go gen audio <id>                       # request Audio Overview
notebooklm-go download <id> <artifact-id> -o out.mp3
notebooklm-go help                                 # full subcommand list

The CLI also covers (v0.1.1, 🧪 experimental): rename / info / summarize / source-{get,refresh,rename,delete,guide} / conv-{last,turns} / mindmap-legacy / artifact-{export,delete} / notes-{list,add} / research-{poll,import} / share / share-status / settings.

Authentication

NotebookLM uses standard Google session cookies. v0.2.1 ships two flows; the --attach flow is strongly recommended because Google's anti-automation detection now blocks sign-in on chromedp-launched Chromes ("Browser not secure").

Snapshot cookies from a normal, already-signed-in Chrome session via the Chrome DevTools Protocol. Google can't tell the difference between "user using Chrome" and "Go program reading cookies out of that Chrome's running process", because that's literally what's happening.

One-time setup (then re-usable indefinitely):

# 1. Fully quit Chrome — Cmd+Q on every window. The --remote-debugging-port
#    flag is silently ignored if any Chrome process is already running.

# 2. Relaunch Chrome with the debug port:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
  --remote-debugging-port=9222 &

# 3. Sign into Google in that Chrome and visit https://notebooklm.google.com

# 4. Snapshot cookies:
notebooklm-go login --attach

Your normal Chrome profile (history, bookmarks, logged-in sessions) is preserved. The debug port is the only thing new. Once snapshotted, auth.json is good until the cookies expire (typically months).

2. Fallback: chromedp launch (often blocked)

If you don't have Chrome installed yet, or you're on a fresh machine where Google hasn't seen automation yet:

notebooklm-go login    # launches a fresh chromedp Chrome

The Go library equivalent:

path := notebooklm.DefaultStoragePath()
if err := notebooklm.Login(path); err != nil {  // chromedp launch
    log.Fatal(err)
}
// or, recommended:
if err := notebooklm.LoginAttach(path, 9222); err != nil {  // CDP attach
    log.Fatal(err)
}
client, err := notebooklm.NewClient(path)

If Login returns "Browser not secure" or similar, switch to LoginAttach.

RPC method coverage

rpc.go declares the known method IDs. All of them are reachable through the typed Client API and the CLI.

Methods are marked 🟢 stable (battle-tested in LocalKin production) or 🧪 experimental (added in v0.1.1 with best-guess param shapes, not yet verified against a live NotebookLM session — see "EXPERIMENTAL methods" below).

Surface Methods Status
Notebooks List / Create / Delete 🟢 stable
Notebooks Get / Rename 🧪 experimental
Sources Add (URL / PDF / text / YouTube) 🟢 stable
Sources Delete / Get / Refresh / Update 🧪 experimental
Summaries Get source guide 🟢 stable
Summaries Get summary 🧪 experimental
Artifacts Generate (Audio: Deep Dive / Brief / Critique / Debate; 🟢 stable
Report, Video, Quiz, Mind Map, Infographic, Slide Deck,
Data Table) / List / Download (audio/video/infographic)
Artifacts Delete / Export (Docs/Sheets) 🧪 experimental
Conversations Chat 🟢 stable
Conversations Last conv ID / Conv turns 🧪 experimental
Notes Generate Mind Map (legacy RPC) / Create note / Get notes 🧪 experimental
Research Start Fast / Start Deep 🟢 stable
Research Poll / Import 🧪 experimental
Sharing Get share status 🟢 stable
Sharing Share notebook (write) 🧪 experimental
Settings Get user settings 🧪 experimental
Auth Check auth 🟢 stable
EXPERIMENTAL methods

The 🧪 methods live in client_extra.go. Their RPC method IDs are known (declared in rpc.go) but the param shape — what JSON the batchexecute call wants in its params field — has not been verified against a live NotebookLM account at release time. The shapes are best-guesses inferred from neighbouring stable methods and from notebooklm-py's wire conventions.

If you hit:

RPC error for s0tc2d: "..."

the param shape is wrong. To debug + fix:

LOCALKIN_NB_DEBUG=1 ./notebooklm <subcommand> ...

This dumps the failing request body and Google's response. File an issue with the redacted payload and the fix is usually a 1-line edit to the params slice in client_extra.go. PRs welcome — most of these will graduate to 🟢 with a single round of real-world testing.

The batchexecute protocol (≈1 paragraph)

Google's frontends talk to backends via a universal envelope called batchexecute. Every "tool call" the JS bundle makes maps to an RPC identified by a 6-character method ID (e.g. wXbhsf for list-notebooks). A request is a triple-nested JSON: [[[rpc_id, params_json_string, null, "generic"]]]. The response is )]}'-prefixed JSON the body of which is also stringly-encoded inner JSON. Authentication is via cookies (SAPISIDHASH derivation) plus a 32-character at token grabbed from the page HTML. This library handles all of that — you call typed Go methods, it handles the encoding/decoding.

If you want to add a new RPC: open NotebookLM in Chrome, DevTools → Network → filter batchexecute, take whatever action you want to reverse-engineer, copy the request payload from the request body, and add a constant + typed wrapper to rpc.go / client.go. PRs welcome.

Why pure Go and not Python?

The existing Python equivalent is [notebooklm-py](https://github.com/ teng-lin/notebooklm-py) — same protocol, different language. We picked Go because:

  • One static binary. No pip install, no virtualenv, no missing system libraries. Cross-compile to Linux ARM64 → drop on a Raspberry Pi and it just runs.
  • Goroutines for concurrent scraping. Batch-add 50 sources, batch- generate 50 audio overviews, in parallel without thread-safety worries.
  • CLI binary is built-in. No python -m notebooklm_py.cli. Just notebooklm in your $PATH.
  • Embeddable. Other Go projects can vendor this without dragging in a Python runtime.

We're standing on notebooklm-py's shoulders — the protocol they reverse-engineered is exactly the protocol we use. Independent Go re-implementation, no shared code.

Production usage

This library is the audio backbone of LocalKin's content publishing pipeline. As of v2.6 of content_director.soul, NotebookLM audio generation is pure-Go via this library (we dropped Playwright + Chromium and saved ~500 MB RAM per pipeline run).

If you're building a similar pipeline, the [LocalKin papers](https:// localkin.dev/papers) cover the architecture — particularly papers #2 (Heart cron) and #8 (Swarm Genesis).

Versioning

Pre-1.0 — the RPC method IDs can change with Google's frontend bundle updates. We tag releases when we hit breakage in production and have patched it. Pin to a release tag:

// go.mod
require github.com/LocalKinAI/notebooklm-go v0.1.0

If you hit a breakage, file an issue with the failing request payload (redact your at token + cookies first).

Contributing

PRs welcome — especially for:

  • New RPC methods (Mind Map node manipulation, custom artifact prompts, etc.)
  • Better headless auth flows
  • Test coverage (currently rpc_test.go covers envelope encoding only)
  • CLI command coverage
  • Documentation in examples/

See examples/ for working programs.

Acknowledgments

  • notebooklm-py — the Python project that first reverse-engineered the batchexecute protocol for NotebookLM. This Go port re-implements independently but borrows the protocol understanding.
  • chromedp — the headless Chrome library used for the interactive OAuth path.

License

Apache License 2.0. See LICENSE.

Author

LocalKinAI — building AI agents that run on local hardware. See also [11 research papers on Zenodo](https:// localkin.dev/papers) for the architectural thesis.

Documentation

Overview

Package notebooklm provides a Go client for Google NotebookLM's internal RPC API. Reverse-engineered from the notebooklm-py project (github.com/teng-lin/notebooklm-py).

This is an unofficial client using undocumented Google APIs. Use at your own risk — endpoints may change without notice.

Index

Constants

View Source
const (
	// Notebook operations
	RPCListNotebooks  = "wXbhsf"
	RPCCreateNotebook = "CCqFvf"
	RPCGetNotebook    = "rLM1Ne"
	RPCRenameNotebook = "s0tc2d"
	RPCDeleteNotebook = "WWINqb"

	// Source operations
	RPCAddSource     = "izAoDd"
	RPCDeleteSource  = "tGMBJ"
	RPCGetSource     = "hizoJc"
	RPCRefreshSource = "FLmJqe"
	RPCUpdateSource  = "b7Wfje"

	// Summary and query
	RPCSummarize      = "VfAZjd"
	RPCGetSourceGuide = "tr032e"

	// Artifact operations
	RPCCreateArtifact = "R7cb6c"
	RPCListArtifacts  = "gArtLc"
	RPCDeleteArtifact = "V5N4be"
	RPCExportArtifact = "Krh3pd"

	// Conversation
	RPCGetLastConvID = "hPTbtc"
	RPCGetConvTurns  = "khqZz"

	// Notes & mind maps
	RPCGenerateMindMap = "yyryJe"
	RPCCreateNote      = "CYK0Xb"
	RPCGetNotes        = "cFji9"

	// Research
	RPCStartFastResearch = "Ljjv0c"
	RPCStartDeepResearch = "QA9ei"
	RPCPollResearch      = "e3bVqc"
	RPCImportResearch    = "LBwxtb"

	// Sharing
	RPCShareNotebook  = "QDyure"
	RPCGetShareStatus = "JFMDGd"

	// Settings
	RPCGetUserSettings = "ZwVcOc"
)

RPC method IDs — obfuscated identifiers used by Google's batchexecute API.

View Source
const (
	ArtifactAudio     = 1
	ArtifactReport    = 2
	ArtifactVideo     = 3
	ArtifactQuiz      = 4
	ArtifactMindMap   = 5
	ArtifactInfogr    = 7
	ArtifactSlideDeck = 8
	ArtifactDataTable = 9
)

Artifact type codes

View Source
const (
	AudioDeepDive = 1
	AudioBrief    = 2
	AudioCritique = 3
	AudioDebate   = 4
)

Audio format codes

Variables

This section is empty.

Functions

func DefaultStoragePath

func DefaultStoragePath() string

DefaultStoragePath returns the default path for the storage state file.

func LoadCookieJarFromStorage

func LoadCookieJarFromStorage(path string) (http.CookieJar, error)

LoadCookieJarFromStorage builds a Go cookiejar from Playwright storage_state.json, preserving domain / path / secure / httpOnly info.

This is REQUIRED for media downloads: NotebookLM hands out URLs on domains like `googleusercontent.com`, and a single cross-domain Cookie header (the shortcut used by RPC calls on notebooklm.google.com) won't be honored. A proper jar sends the right cookies per destination host as the client follows redirects.

func LoadCookiesFromStorage

func LoadCookiesFromStorage(path string) (string, error)

LoadCookiesFromStorage reads a Playwright storage_state.json file and returns the Cookie header string for Google domains.

func Login

func Login(storagePath string) error

Login opens a browser window for the user to sign into Google, then captures cookies and saves them as a Playwright-compatible storage state.

func LoginAttach added in v0.2.1

func LoginAttach(storagePath string, port int) error

LoginAttach connects to an already-running Chrome via the Chrome DevTools Protocol (CDP) and snapshots its Google cookies into the Playwright-compatible storage state at storagePath.

Why this exists: Google's anti-bot detection blocks sign-in on Chromes launched by chromedp ("Browser not secure"). Attaching to the user's real, already-signed-in Chrome bypasses the detection entirely — we just read cookies out of a normal browsing session.

Prerequisites:

  1. Fully quit Chrome (Cmd+Q on macOS — must close ALL windows, otherwise the new launch attaches to the existing process and silently drops the --remote-debugging-port flag).

  2. Relaunch Chrome with the remote debugging port. On macOS:

    /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \ --remote-debugging-port=9222 &

    This preserves your default profile (cookies, login state) — only the debug port is new.

  3. In that Chrome, sign into Google and open https://notebooklm.google.com (or verify you're already signed in).

  4. Run `notebooklm-go login --attach`.

port=0 defaults to 9222.

Types

type Artifact

type Artifact struct {
	ID        string `json:"id"`
	Title     string `json:"title"`
	TypeCode  int    `json:"type_code"`
	Status    int    `json:"status"`
	CreatedAt int64  `json:"created_at,omitempty"`
}

Artifact represents a NotebookLM artifact (audio, video, quiz, etc.).

Field mapping to the raw RPC response array (verified against notebooklm-py v0.3 Artifact.from_api_response, 2026-04-20):

data[0]  → ID       (string UUID)
data[1]  → Title    (string; CJK chars → zh, else en)
data[2]  → TypeCode (1=video, 3=audio, 7=infographic, etc.)
data[4]  → Status
data[15][0] → CreatedAt (unix seconds)

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the Go client for Google NotebookLM's internal RPC API.

func NewClient

func NewClient(storagePath string) (*Client, error)

NewClient creates a new NotebookLM client from a storage state file.

func (*Client) AddTextSource

func (c *Client) AddTextSource(notebookID, title, content string) error

AddTextSource adds plain text as a source to a notebook.

func (*Client) AddURLSource

func (c *Client) AddURLSource(notebookID, sourceURL string) error

AddURLSource adds a web URL as a source to a notebook.

func (*Client) AddYouTubeSource

func (c *Client) AddYouTubeSource(notebookID, youtubeURL string) error

AddYouTubeSource adds a YouTube video as a source to a notebook.

func (*Client) Chat

func (c *Client) Chat(notebookID, question string) (string, error)

Chat sends a question to a notebook and returns the response. Uses NotebookLM's GenerateFreeFormStreamed endpoint (not batchexecute).

func (*Client) CheckAuth

func (c *Client) CheckAuth() error

CheckAuth verifies that cookies and tokens are valid by making a test request.

func (*Client) CreateNote added in v0.1.1

func (c *Client) CreateNote(notebookID, title, content string) error

CreateNote saves a note attached to a notebook (the right-hand "Notes" panel in the NotebookLM UI).

EXPERIMENTAL.

func (*Client) CreateNotebook

func (c *Client) CreateNotebook(title string) (string, error)

CreateNotebook creates a new notebook with the given title.

func (*Client) DeleteArtifact added in v0.1.1

func (c *Client) DeleteArtifact(notebookID, artifactID string) error

DeleteArtifact removes an artifact (audio, report, mind map, etc.) from a notebook.

EXPERIMENTAL — batch-delete shape (mirrors DeleteSource).

func (*Client) DeleteNotebook

func (c *Client) DeleteNotebook(notebookID string) error

DeleteNotebook deletes a notebook by ID.

func (*Client) DeleteSource added in v0.1.1

func (c *Client) DeleteSource(notebookID, sourceID string) error

DeleteSource removes a source from a notebook by source ID.

EXPERIMENTAL — param shape mirrors notebooklm-py's batch-delete: the first param is a list because the underlying RPC supports deleting multiple sources in one call.

func (*Client) DownloadArtifact

func (c *Client) DownloadArtifact(notebookID, artifactID, outputPath string) error

DownloadArtifact downloads an artifact to a local file.

Architecture note (2026-04-20): the previous implementation called a separate RPC `RPCExportArtifact` to get a download URL — that RPC is for exporting reports/data-tables to Google Docs/Sheets, NOT for media download. Its response contains no URL, so `could not extract download URL` was the inevitable outcome.

The correct mechanism (per notebooklm-py's download_audio/video/infographic in _artifacts.py:955+) is: the ListArtifacts response already contains media URLs embedded in type-specific positions:

  • Audio (type 1): artifact[6][5] — list of {url, ?, mime} tuples, find mime="audio/mp4"
  • Video (type 3): artifact[8] — list of lists, first URL with mime="video/mp4" preferred (quality tag == 4)
  • Infographic (type 7): artifact[N][2][0][1][0] for N scanned from end of entry — raw PNG url

So "downloading" is really: list → find by ID → parse URL from raw → HTTP GET.

func (*Client) ExportArtifact added in v0.1.1

func (c *Client) ExportArtifact(notebookID, artifactID string) (json.RawMessage, error)

ExportArtifact exports a Report or Data Table artifact to Google Docs / Sheets and returns the export response (containing the destination URL).

NOTE: this is NOT the right way to download Audio/Video/Infographic — those URLs live inside ListArtifacts entries. See DownloadArtifact in client.go for the correct media-download path.

EXPERIMENTAL.

func (*Client) GenerateArtifact

func (c *Client) GenerateArtifact(notebookID string, typeCode int) (string, error)

GenerateArtifact creates any artifact type (video, quiz, slides, etc.).

func (*Client) GenerateAudio

func (c *Client) GenerateAudio(notebookID string, format int) (string, error)

GenerateAudio creates an audio overview (podcast) for a notebook.

func (*Client) GenerateMindMap added in v0.1.1

func (c *Client) GenerateMindMap(notebookID string) (json.RawMessage, error)

GenerateMindMap creates a mind map via the legacy direct RPC. Distinct from `GenerateArtifact(notebookID, ArtifactMindMap)` which goes through the artifact pipeline (preferred for v2.x+ NotebookLM frontends).

EXPERIMENTAL — kept for parity with notebooklm-py's `generate_mind_map`.

func (*Client) GetConvTurns added in v0.1.1

func (c *Client) GetConvTurns(notebookID, convID string) (json.RawMessage, error)

GetConvTurns returns the message history of a conversation.

EXPERIMENTAL.

func (*Client) GetLastConvID added in v0.1.1

func (c *Client) GetLastConvID(notebookID string) (string, error)

GetLastConvID returns the most-recent conversation ID for a notebook. Useful for resuming a chat without spawning a fresh thread.

EXPERIMENTAL.

func (*Client) GetNotebook added in v0.1.1

func (c *Client) GetNotebook(notebookID string) (json.RawMessage, error)

GetNotebook returns the full notebook record. This is the raw RPC; the already-stable `GetNotebookMetadata` is an alias kept for callers that don't want to type-assert.

EXPERIMENTAL — response shape varies by Google build; treat as RawMessage.

func (*Client) GetNotebookMetadata

func (c *Client) GetNotebookMetadata(notebookID string) (json.RawMessage, error)

GetNotebookMetadata returns detailed notebook info including sources.

func (*Client) GetNotes added in v0.1.1

func (c *Client) GetNotes(notebookID string) (json.RawMessage, error)

GetNotes lists notes for a notebook.

EXPERIMENTAL.

func (*Client) GetShareStatus

func (c *Client) GetShareStatus(notebookID string) (json.RawMessage, error)

GetShareStatus returns the sharing state of a notebook.

func (*Client) GetSource added in v0.1.1

func (c *Client) GetSource(notebookID, sourceID string) (json.RawMessage, error)

GetSource returns a single source's full record (content excerpts, ingestion status, metadata).

EXPERIMENTAL.

func (*Client) GetSourceGuide

func (c *Client) GetSourceGuide(notebookID string) (string, error)

GetSourceGuide retrieves the auto-generated summary for a notebook's sources.

func (*Client) GetUserSettings added in v0.1.1

func (c *Client) GetUserSettings() (json.RawMessage, error)

GetUserSettings returns the current user's NotebookLM settings (audio voice preferences, notification toggles, etc.).

EXPERIMENTAL.

func (*Client) ImportResearch added in v0.1.1

func (c *Client) ImportResearch(notebookID, researchTaskID string) error

ImportResearch imports a finished research task's output as a source on the same notebook (so the report becomes searchable / summarizable).

EXPERIMENTAL.

func (*Client) ListArtifacts

func (c *Client) ListArtifacts(notebookID string) ([]Artifact, error)

ListArtifacts returns all artifacts in a notebook.

RPC params (verified against notebooklm-py v0.3 _artifacts.py:263, 2026-04-20):

params = [[2], notebook_id, "NOT artifact.status = \"ARTIFACT_STATUS_SUGGESTED\""]

Passing only [notebook_id] makes Google's backend return a null payload (the outer envelope says "generic" but the inner data slot is null).

Response envelope is typically [[<artifact-entry>, ...]] — a single-element outer list wrapping the actual entries. Each entry is:

[ id, title, typeCode, _, status, _, _, _, _, [..variant..], _, _, _, _, _, [ts_sec, ts_ns], ... ]

We read fields 0 (id), 1 (title), 2 (type), 4 (status), 15[0] (createdAt).

func (*Client) ListNotebooks

func (c *Client) ListNotebooks() ([]Notebook, error)

ListNotebooks returns all notebooks in the account.

func (*Client) PollResearch added in v0.1.1

func (c *Client) PollResearch(notebookID, researchTaskID string) (json.RawMessage, error)

PollResearch returns the status (and, when ready, output) of a research task started via StartResearch.

EXPERIMENTAL.

func (*Client) RefreshSource added in v0.1.1

func (c *Client) RefreshSource(notebookID, sourceID string) error

RefreshSource asks NotebookLM to re-ingest a source (e.g. re-fetch a URL whose content has changed).

EXPERIMENTAL.

func (*Client) RenameNotebook added in v0.1.1

func (c *Client) RenameNotebook(notebookID, newTitle string) error

RenameNotebook changes a notebook's title.

EXPERIMENTAL.

func (*Client) ShareNotebook added in v0.1.1

func (c *Client) ShareNotebook(notebookID string, emails []string, shareLevel int) error

ShareNotebook grants access to a notebook.

shareLevel: 1 = view-only, 2 = edit (best-guess from notebooklm-py; confirm against Google's UI semantics if it matters).

EXPERIMENTAL — exact param shape (especially the email-list encoding) has the highest uncertainty in this file. If the call returns `RPC error for QDyure`, capture the failing payload and file an issue.

func (*Client) StartResearch

func (c *Client) StartResearch(notebookID, query, mode string) (string, error)

StartResearch begins a web research query and auto-imports discovered sources. mode: "fast" or "deep"

func (*Client) Summarize added in v0.1.1

func (c *Client) Summarize(notebookID string) (json.RawMessage, error)

Summarize returns the full auto-summary for a notebook (the long-form text NotebookLM generates when sources change).

EXPERIMENTAL — distinct from `GetSourceGuide` which returns the shorter per-source overview.

func (*Client) UpdateSource added in v0.1.1

func (c *Client) UpdateSource(notebookID, sourceID, newTitle string) error

UpdateSource changes a source's metadata (currently: title).

EXPERIMENTAL.

type Notebook

type Notebook struct {
	ID    string `json:"id"`
	Title string `json:"title"`
}

Notebook represents a NotebookLM notebook.

type Tokens

type Tokens struct {
	CSRF      string // SNlM0e value
	SessionID string // FdrFJe value
}

Tokens holds the CSRF and session tokens needed for RPC calls.

func FetchTokens

func FetchTokens(cookieHeader string) (*Tokens, error)

FetchTokens makes an authenticated GET request to NotebookLM and extracts CSRF (SNlM0e) and session (FdrFJe) tokens from the page HTML.

Directories

Path Synopsis
cmd
notebooklm-go command
notebooklm-go — CLI wrapper for github.com/LocalKinAI/notebooklm-go.
notebooklm-go — CLI wrapper for github.com/LocalKinAI/notebooklm-go.
examples
add_pdf_source command
add_pdf_source — add a remote PDF (or any URL NotebookLM accepts) to an existing notebook.
add_pdf_source — add a remote PDF (or any URL NotebookLM accepts) to an existing notebook.
generate_audio_overview command
generate_audio_overview — request a "Deep Dive" audio overview for a notebook, poll until ready, download the MP3.
generate_audio_overview — request a "Deep Dive" audio overview for a notebook, poll until ready, download the MP3.
list_notebooks command
list_notebooks — the simplest possible notebooklm-go program.
list_notebooks — the simplest possible notebooklm-go program.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL