NotebookLM doesn't have a public API. nlm::gateway fixes that. Run it on your own server, connect your Google account once, and query your notebooks via REST or a simple web chat.
Send queries as JSON. Get back clean text and markdown. No browser automation needed on your client.
A no-install terminal-style chat interface. Switch notebooks, browse history, and see live session status.
Every conversation is saved locally per device. History survives restarts. Your data stays on your server.
Each browser gets its own ID and history. Shared server, separate conversations. No login system required.
Pre-warmed Playwright pages mean sub-second responses. LRU eviction keeps memory bounded.
One docker compose up and you're done. Mount your auth file, and it just works.
Run npm run login. It reads your Google cookies from Chrome (macOS Keychain or Windows DPAPI) and saves them to auth-state.json. That's your only auth step.
Paste any NotebookLM URL into the web UI or send it to /api/notebook. The gateway loads the page in a headless browser in the background.
Type a question in the chat or POST to /api/ask. The gateway submits it to NotebookLM, waits for the response, strips citation markers, and returns clean JSON.
Simple JSON in, structured JSON out. No tokens, no rate-limit dashboards — just your own Google session running on your own hardware.
curl -X POST http://localhost:3005/api/ask \
-H "Content-Type: application/json" \
-d '{"query": "Summarize the methodology"}'
GET /health
Status, sessions, cookie expiry
POST /api/ask
Send a query, get text + markdown
GET /api/history
Per-device conversation history
POST /api/notebook
Set or switch active notebook
PATCH /api/notebook
Rename a saved notebook
DELETE /api/notebook
Remove a saved notebook profile
GET /api
Swagger UI docs
Clone, log in, and run. Or use Docker.
git clone https://github.com/Ayash13/notebook-lm-gateway.git cd notebook-lm-gateway npm install npm run login # one-time cookie extraction npm start # http://localhost:3005
docker run -d \ --name nlm-gateway \ -p 3005:3005 \ -v $(pwd)/auth-state.json:/app/auth-state.json:ro \ -v nlm-gateway-db:/app/data \ -e PORT=3005 \ -e DB_DIR=/app/data \ --restart unless-stopped \ ayash13/notebook-lm-gateway:latest