Unofficial NotebookLM Enterprise API client
🦀 Rust CLI: Command-line tool for shell scripting and automation
🐍 Python SDK: Python bindings for integration in Python applications
Important
This project targets the NotebookLM Enterprise API only. Google hasn’t published an API for the consumer edition or general Google Workspace tenants as of 2025-10-25.
In September 2025, Google released the NotebookLM Enterprise API, enabling programmatic access to NotebookLM features for the first time.
While you can interact with the API using simple curl commands, this approach has several limitations that this project addresses:
-
Authentication complexity
- Problem: Managing OAuth tokens, handling token refresh, and ensuring secure credential storage
- Solution: Seamless
gcloudCLI integration with automatic token caching and refresh
-
Manual request construction
- Problem: Writing JSON payloads by hand, managing resource names, and handling API versioning
- Solution: Type-safe CLI flags and Python SDK with intelligent defaults and validation
-
Error handling
- Problem: Cryptic HTTP error codes without context or recovery suggestions
- Solution: Clear, actionable error messages with automatic retries for transient failures
-
Repeated operations
- Problem: Writing boilerplate loops for fetch/add/delete sequences
- Solution: Higher-level client helpers and CLI flags that wrap single API calls (with retries built in) so scripts stay concise
-
Output parsing
- Problem: Manual JSON parsing and extracting specific fields from responses
- Solution: Structured response objects in the Python SDK and
--jsonoutput in the CLI for easy integration with tools likejq
This project provides production-ready tools that make the NotebookLM API accessible and reliable:
- Rust CLI: Fast, cross-platform binary for shell scripting and automation
- Python SDK: Idiomatic Python bindings for application integration
- Type safety: Compile-time checks prevent common API usage errors
- Developer experience: Intuitive commands and clear documentation
brew tap k-dash/nblm https://github.com/K-dash/homebrew-nblm
brew install k-dash/nblm/nblm
nblm --versionDownload the tarball for your architecture from the Releases page, then extract and install it. Example for x86_64:
VERSION=x.x.x
ARCH=linux-x86_64 # or linux-aarch64
curl -LO https://github.com/K-dash/nblm-rs/releases/download/v${VERSION}/nblm-${ARCH}.tar.gz
tar -xzf nblm-${ARCH}.tar.gz
chmod +x nblm
sudo mv nblm /usr/local/bin/
nblm --versionOptional: verify the download with
shasum -a 256 nblm-${ARCH}.tar.gzand compare with the digest listed on the release page.
git clone https://github.com/K-dash/nblm-rs.git
cd nblm-rs
cargo build --release -p nblm-cli
./target/release/nblm --versionYou can also install the CLI locally with cargo install --path crates/nblm-cli.
pip install nblm
# or
uv add nblmPrerequisite: a Google Cloud project with the NotebookLM Enterprise API enabled and either
gcloud auth loginor an OAuth token ready forNBLM_ACCESS_TOKEN.
For detailed setup and troubleshooting, see the documentation in docs/.
# 1. Authenticate
gcloud auth login
# 2. Set environment variables
export NBLM_PROJECT_NUMBER="123456789012" # Get from GCP console
export NBLM_LOCATION="global"
export NBLM_ENDPOINT_LOCATION="global"
# 3. Create a notebook
nblm notebooks create --title "My Notebook"
# 4. Add a source
nblm sources add \
--notebook-id YOUR_NOTEBOOK_ID \
--web-url "https://example.com" \
--web-name "Example"from nblm import NblmClient, GcloudTokenProvider, WebSource
# Initialize client
client = NblmClient(
token_provider=GcloudTokenProvider(),
project_number="123456789012"
)
# Create a notebook
notebook = client.create_notebook(title="My Notebook")
# Add sources
response = client.add_sources(
notebook_id=notebook.notebook_id,
web_sources=[WebSource(url="https://example.com", name="Example")]
)Note
The NotebookLM API is currently in alpha. Some features may not work as documented due to API limitations. See Known API Issues for details.
| Feature | CLI | Python | Status | Notes |
|---|---|---|---|---|
| Create notebook | ◯ | ◯ | Working | |
| List recent notebooks | ◯ | ◯ | Working | Pagination not implemented by API |
| Delete notebook(s) | ◯ | ◯ | Working | Sequential deletion (API limitation) |
| Feature | CLI | Python | Status | Notes |
|---|---|---|---|---|
| Add web URL | ◯ | ◯ | Working | |
| Add text content | ◯ | ◯ | Working | |
| Add video (YouTube) | ◯ | ◯ | Working | Uses youtubeUrl field |
| Add Google Drive | ◯ | ◯ | Working | Requires Drive-enabled auth |
| Upload file | ◯ | ◯ | Working | |
| Delete source(s) | ◯ | ◯ | Working | |
| Get source by ID | ◯ | ◯ | Working |
| Feature | CLI | Python | Status | Notes |
|---|---|---|---|---|
| Create audio overview | ◯ | ◯ | Working | Config fields not supported |
| Delete audio overview | ◯ | ◯ | Working |
| Feature | CLI | Python | Status | Notes |
|---|---|---|---|---|
| Share notebook | ◯ | ✗ | Untested | Requires additional users |
| Platform | CLI | Python SDK |
|---|---|---|
| Linux | ||
| macOS | ||
| Windows |
Complete guides and API references:
- Getting Started - Installation, authentication, configuration
- CLI Reference - All commands, options, and examples
- Python SDK Reference - API reference and usage patterns
Note
The NotebookLM API is currently in alpha and has several known limitations. See API Limitations for details.
- NotebookLM API Documentation - Official API documentation
- NotebookLM API Reference - API reference
Contributions are welcome! See CONTRIBUTING.md for development setup and guidelines.
Important
All pull requests must pass cargo make all (Rust) and cargo make py-all (Python) before being merged.
MIT