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)
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
Add to Cargo.toml:
[dependencies]
notebooklm-api = "0.1.0-alpha"cargo install --path .
# then
notebooklm --helpAuthentication 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# 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 longGlobal output controls:
notebooklm --output json notebook list
notebooklm --output tsv artifact <notebook_id> list
notebooklm --quiet notebook <notebook_id> deleteuse 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(())
}- 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.
README.md: project overview and usageCONTRIBUTING.md: contributor workflow
cargo fmt
cargo check
cargo test
cargo run --bin notebooklm -- --helpCI runs formatting, build, clippy, and tests.
MIT