Skip to content

Repository files navigation

notebooklm-api

Rust client library and CLI for Google NotebookLM.

notebooklm-api ports the Python notebooklm-py functionality to Rust for:

  • Embedding NotebookLM automation in Rust applications (library/crate)
  • Scriptable terminal automation (CLI)

Status

This project is functional and actively ported from notebooklm-py. Implemented API groups:

  • Notebooks
  • Sources
  • Chat + history
  • Artifacts (generate/list/download/export)
  • Research
  • Sharing
  • Settings

Installation

Library

Add to Cargo.toml:

[dependencies]
notebooklm-api = "0.1.0-alpha"

CLI

cargo install --path .
# then
notebooklm --help

Authentication

Authentication uses Playwright/Chromium storage state cookies. Default search path is handled by the crate (same flow as existing implementation).

You can pass an explicit storage state file to CLI commands:

notebooklm --storage /path/to/storage_state.json auth-status

Quickstart (CLI)

# List notebooks
notebooklm notebook list

# Create one
notebooklm notebook create "My Notebook"

# Add source
notebooklm source <notebook_id> add-url "https://example.com"

# Ask a question
notebooklm chat <notebook_id> "Summarize this"

# Generate typed artifact
notebooklm artifact <notebook_id> generate-audio \
  --audio-format deep-dive \
  --audio-length long

Global output controls:

notebooklm --output json notebook list
notebooklm --output tsv artifact <notebook_id> list
notebooklm --quiet notebook <notebook_id> delete

Quickstart (Library)

use notebooklm_api::client::NotebookLmClient;
use notebooklm_api::{AudioGenerationOptions, Result};

#[tokio::main]
async fn main() -> Result<()> {
    let client = NotebookLmClient::from_storage(None).await?;
    let notebooks = client.notebooks().list().await?;
    println!("count={}", notebooks.len());

    if let Some(nb) = notebooks.first() {
        let status = client
            .artifacts()
            .generate_audio(&nb.id, AudioGenerationOptions::default())
            .await?;
        println!("task_id={} status={}", status.task_id, status.status);
    }

    Ok(())
}

Production Notes

  • API methods are based on reverse-engineered RPC identifiers and payloads.
  • Breakage can occur if NotebookLM changes internal RPC schemas.
  • Use retry policy tuning and robust error handling in production.
  • Pin crate versions and test against your own fixtures/cassettes.

Documentation

  • README.md: project overview and usage
  • CONTRIBUTING.md: contributor workflow

Development

cargo fmt
cargo check
cargo test
cargo run --bin notebooklm -- --help

CI runs formatting, build, clippy, and tests.

License

MIT

About

Unofficial API for NotebookLM

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages