@roomi-fields/notebooklm-mcp 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -22
- package/README.md +2 -0
- package/deployment/INDEX.md +292 -0
- package/deployment/PACKAGE-FILES.txt +180 -0
- package/deployment/QUICK-START.md +100 -0
- package/deployment/docs/01-INSTALL.md +611 -0
- package/deployment/docs/02-CONFIGURATION.md +404 -0
- package/deployment/docs/03-API.md +1691 -0
- package/deployment/docs/04-N8N-INTEGRATION.md +373 -0
- package/deployment/docs/05-TROUBLESHOOTING.md +429 -0
- package/deployment/docs/06-NOTEBOOK-LIBRARY.md +692 -0
- package/deployment/docs/07-AUTO-DISCOVERY.md +236 -0
- package/deployment/docs/08-WSL-USAGE.md +363 -0
- package/deployment/docs/09-MULTI-INTERFACE.md +293 -0
- package/deployment/docs/10-CONTENT-MANAGEMENT.md +421 -0
- package/deployment/docs/11-MULTI-ACCOUNT.md +295 -0
- package/deployment/docs/README.md +207 -0
- package/deployment/scripts/README.md +564 -0
- package/deployment/scripts/install.ps1 +114 -0
- package/deployment/scripts/setup-auth.ps1 +217 -0
- package/deployment/scripts/start-server.ps1 +72 -0
- package/deployment/scripts/stop-server.ps1 +51 -0
- package/deployment/scripts/test-api.ps1 +651 -0
- package/deployment/scripts/test-auth.ps1 +323 -0
- package/deployment/scripts/test-auto-discovery.ps1 +295 -0
- package/deployment/scripts/test-cors.ps1 +398 -0
- package/deployment/scripts/test-errors.ps1 +581 -0
- package/deployment/scripts/test-server.ps1 +140 -0
- package/deployment/scripts/test-sessions.ps1 +426 -0
- package/deployment/scripts/test-validation.ps1 +299 -0
- package/dist/cli/accounts.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +15 -0
- package/dist/config.js.map +1 -1
- package/dist/content/content-manager.d.ts.map +1 -1
- package/dist/content/content-manager.js +113 -118
- package/dist/content/content-manager.js.map +1 -1
- package/dist/i18n/en.json +120 -0
- package/dist/i18n/fr.json +120 -0
- package/dist/i18n/index.d.ts +168 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +213 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/session/browser-session.d.ts.map +1 -1
- package/dist/session/browser-session.js +1 -0
- package/dist/session/browser-session.js.map +1 -1
- package/dist/session/shared-context-manager.d.ts.map +1 -1
- package/dist/session/shared-context-manager.js +2 -0
- package/dist/session/shared-context-manager.js.map +1 -1
- package/docs/ADDING_A_LANGUAGE.md +209 -0
- package/package.json +6 -3
- package/scripts/archive/add-and-activate-notebook.ps1 +31 -0
- package/scripts/archive/add-new-notebook.ps1 +25 -0
- package/scripts/archive/add-rom1pey.ps1 +2 -0
- package/scripts/archive/add-rpmonster.ps1 +2 -0
- package/scripts/archive/add-source-debug.ps1 +11 -0
- package/scripts/archive/add-source-e2e.ps1 +28 -0
- package/scripts/archive/add-source-visible.ps1 +11 -0
- package/scripts/archive/add-test-notebook.ps1 +13 -0
- package/scripts/archive/add-test-source.ps1 +50 -0
- package/scripts/archive/capture-screen.ps1 +11 -0
- package/scripts/archive/change-language.mjs +45 -0
- package/scripts/archive/change-language.ts +44 -0
- package/scripts/archive/check-account.ps1 +19 -0
- package/scripts/archive/check-notebook-2.ps1 +8 -0
- package/scripts/archive/check-test-notebook.ps1 +11 -0
- package/scripts/archive/create-notebook-auto.ps1 +31 -0
- package/scripts/archive/create-notebook.ps1 +8 -0
- package/scripts/archive/create-rom1pey-notebook.ps1 +19 -0
- package/scripts/archive/create-rom1pey.ps1 +8 -0
- package/scripts/archive/create-test-notebook-fresh.ps1 +21 -0
- package/scripts/archive/create-test-notebook.ps1 +16 -0
- package/scripts/archive/debug-add-source-auto.ps1 +29 -0
- package/scripts/archive/debug-add-source.ps1 +19 -0
- package/scripts/archive/debug-add-text-source.ps1 +47 -0
- package/scripts/archive/debug-home.ps1 +10 -0
- package/scripts/archive/debug-selectors.ps1 +55 -0
- package/scripts/archive/debug-sources-panel.ps1 +22 -0
- package/scripts/archive/debug-ui.ps1 +17 -0
- package/scripts/archive/discover-home.ps1 +26 -0
- package/scripts/archive/kill-automation-chrome.ps1 +37 -0
- package/scripts/archive/list-my-notebooks.ps1 +27 -0
- package/scripts/archive/navigate-home-visible.ps1 +23 -0
- package/scripts/archive/navigate-home.ps1 +15 -0
- package/scripts/archive/run-e2e-english.ps1 +111 -0
- package/scripts/archive/run-e2e-rom1pey-v2.ps1 +122 -0
- package/scripts/archive/run-e2e-rom1pey.ps1 +117 -0
- package/scripts/archive/setup-english-test.ps1 +36 -0
- package/scripts/archive/setup-test-notebook.ps1 +71 -0
- package/scripts/archive/simple-add-source.ps1 +14 -0
- package/scripts/archive/t10.ps1 +2 -0
- package/scripts/archive/t20.ps1 +4 -0
- package/scripts/archive/t30.ps1 +9 -0
- package/scripts/archive/t31.ps1 +11 -0
- package/scripts/archive/t32.ps1 +6 -0
- package/scripts/archive/t39.ps1 +5 -0
- package/scripts/archive/t40.ps1 +5 -0
- package/scripts/archive/t53.ps1 +12 -0
- package/scripts/archive/t54.ps1 +12 -0
- package/scripts/archive/t55.ps1 +11 -0
- package/scripts/archive/t9.ps1 +1 -0
- package/scripts/archive/test-access.ps1 +28 -0
- package/scripts/archive/test-add-delete-source.ps1 +64 -0
- package/scripts/archive/test-add-source-visible.ps1 +16 -0
- package/scripts/archive/test-add-source.ps1 +19 -0
- package/scripts/archive/test-add-text-debug.ps1 +28 -0
- package/scripts/archive/test-add-text-source.ps1 +8 -0
- package/scripts/archive/test-add-url-source.ps1 +7 -0
- package/scripts/archive/test-ask-ascii.ps1 +20 -0
- package/scripts/archive/test-ask-cnv.ps1 +20 -0
- package/scripts/archive/test-ask-headed.ps1 +51 -0
- package/scripts/archive/test-ask-ifs.ps1 +16 -0
- package/scripts/archive/test-ask-now.ps1 +24 -0
- package/scripts/archive/test-ask-real.ps1 +19 -0
- package/scripts/archive/test-ask-visible.ps1 +20 -0
- package/scripts/archive/test-create-notebook.ps1 +8 -0
- package/scripts/archive/test-create-then-add.ps1 +17 -0
- package/scripts/archive/test-delete-source.ps1 +41 -0
- package/scripts/archive/test-e2e-notebook.ps1 +21 -0
- package/scripts/archive/test-english-notebook.ps1 +20 -0
- package/scripts/archive/test-english.ps1 +7 -0
- package/scripts/archive/test-full-custom-instructions.ps1 +40 -0
- package/scripts/archive/test-full-infographic.ps1 +34 -0
- package/scripts/archive/test-full-language.ps1 +21 -0
- package/scripts/archive/test-full-presentation.ps1 +85 -0
- package/scripts/archive/test-full-report.ps1 +34 -0
- package/scripts/archive/test-full-source-selection.ps1 +35 -0
- package/scripts/archive/test-full-video-brief.ps1 +22 -0
- package/scripts/archive/test-full-video-explainer.ps1 +22 -0
- package/scripts/archive/test-full-video-styles.ps1 +37 -0
- package/scripts/archive/test-generate-report.ps1 +15 -0
- package/scripts/archive/test-generate-study-guide.ps1 +11 -0
- package/scripts/archive/test-headed-ask.ps1 +13 -0
- package/scripts/archive/test-headed-now.ps1 +9 -0
- package/scripts/archive/test-headed.ps1 +9 -0
- package/scripts/archive/test-hello.ps1 +7 -0
- package/scripts/archive/test-i18n-studio.ps1 +8 -0
- package/scripts/archive/test-i18n.ps1 +7 -0
- package/scripts/archive/test-manual-headed.ps1 +26 -0
- package/scripts/archive/test-mathieu-quota.ps1 +8 -0
- package/scripts/archive/test-notebook-1.ps1 +10 -0
- package/scripts/archive/test-notebook-2-sources.ps1 +12 -0
- package/scripts/archive/test-notebook1.ps1 +14 -0
- package/scripts/archive/test-personal-notebook.ps1 +14 -0
- package/scripts/archive/test-rate-limit.ps1 +19 -0
- package/scripts/archive/test-real-ask.ps1 +50 -0
- package/scripts/archive/test-real-ask2.ps1 +30 -0
- package/scripts/archive/test-rom1pey.ps1 +7 -0
- package/scripts/archive/test-rotation-complete.ps1 +14 -0
- package/scripts/archive/test-rotation.ps1 +8 -0
- package/scripts/archive/test-show-browser.ps1 +39 -0
- package/scripts/archive/test-update-notebook.ps1 +4 -0
- package/scripts/archive/verify-language-slow.ps1 +21 -0
- package/scripts/archive/verify-language.ps1 +15 -0
- package/scripts/check-server.ps1 +46 -0
- package/scripts/mcp-wsl-helper.sh +146 -0
- package/scripts/start-server.ps1 +94 -0
- package/scripts/stop-server.ps1 +30 -0
- package/scripts/switch-account-language.sh +191 -0
- package/scripts/test-account.ps1 +58 -0
|
@@ -0,0 +1,1691 @@
|
|
|
1
|
+
# API Documentation - NotebookLM MCP HTTP Server
|
|
2
|
+
|
|
3
|
+
> Complete reference for all REST endpoints
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🌐 Base URL
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
http://localhost:3000
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or for network access: `http://<SERVER-IP>:3000`
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Available Endpoints (31 total)
|
|
18
|
+
|
|
19
|
+
### Authentication
|
|
20
|
+
|
|
21
|
+
| Method | Endpoint | Description |
|
|
22
|
+
| ------ | --------------- | --------------------------------- |
|
|
23
|
+
| `POST` | `/setup-auth` | First-time authentication |
|
|
24
|
+
| `POST` | `/de-auth` | Logout (clear credentials) |
|
|
25
|
+
| `POST` | `/re-auth` | Re-authenticate / switch account |
|
|
26
|
+
| `POST` | `/cleanup-data` | Clean all data (requires confirm) |
|
|
27
|
+
|
|
28
|
+
### Queries
|
|
29
|
+
|
|
30
|
+
| Method | Endpoint | Description |
|
|
31
|
+
| ------ | --------- | ---------------------------- |
|
|
32
|
+
| `GET` | `/health` | Server health check |
|
|
33
|
+
| `POST` | `/ask` | Ask a question to NotebookLM |
|
|
34
|
+
|
|
35
|
+
### Notebooks
|
|
36
|
+
|
|
37
|
+
| Method | Endpoint | Description |
|
|
38
|
+
| -------- | -------------------------- | ------------------------------------ |
|
|
39
|
+
| `GET` | `/notebooks` | List all notebooks |
|
|
40
|
+
| `POST` | `/notebooks` | Add a notebook manually |
|
|
41
|
+
| `POST` | `/notebooks/create` | Create a new notebook in NotebookLM |
|
|
42
|
+
| `POST` | `/notebooks/auto-discover` | Auto-generate notebook metadata |
|
|
43
|
+
| `GET` | `/notebooks/search` | Search notebooks by query |
|
|
44
|
+
| `GET` | `/notebooks/stats` | Get library statistics |
|
|
45
|
+
| `GET` | `/notebooks/:id` | Get notebook details |
|
|
46
|
+
| `PUT` | `/notebooks/:id` | Update notebook metadata |
|
|
47
|
+
| `DELETE` | `/notebooks/:id` | Delete a notebook |
|
|
48
|
+
| `PUT` | `/notebooks/:id/activate` | Activate a notebook (set as default) |
|
|
49
|
+
|
|
50
|
+
### Sessions
|
|
51
|
+
|
|
52
|
+
| Method | Endpoint | Description |
|
|
53
|
+
| -------- | --------------------- | --------------------- |
|
|
54
|
+
| `GET` | `/sessions` | List active sessions |
|
|
55
|
+
| `POST` | `/sessions/:id/reset` | Reset session history |
|
|
56
|
+
| `DELETE` | `/sessions/:id` | Close a session |
|
|
57
|
+
|
|
58
|
+
### Content Management
|
|
59
|
+
|
|
60
|
+
| Method | Endpoint | Description |
|
|
61
|
+
| -------- | --------------------------------- | --------------------------------------------- |
|
|
62
|
+
| `POST` | `/content/sources` | Add source/document to notebook |
|
|
63
|
+
| `DELETE` | `/content/sources/:id` | Delete source by ID |
|
|
64
|
+
| `DELETE` | `/content/sources` | Delete source by name (query param) |
|
|
65
|
+
| `POST` | `/content/generate` | Generate content (audio, video, report, etc.) |
|
|
66
|
+
| `GET` | `/content/download` | Download/export content |
|
|
67
|
+
| `POST` | `/content/notes` | Create a note in the notebook |
|
|
68
|
+
| `POST` | `/content/chat-to-note` | Save chat discussion to a note |
|
|
69
|
+
| `POST` | `/content/notes/:title/to-source` | Convert note to source |
|
|
70
|
+
| `GET` | `/content` | List sources and generated content |
|
|
71
|
+
|
|
72
|
+
> **Note:** v1.5.0 consolidated content generation into `/content/generate` with all NotebookLM Studio features (audio_overview, video, infographic, report, presentation, data_table).
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 1. Health Check
|
|
77
|
+
|
|
78
|
+
### `GET /health`
|
|
79
|
+
|
|
80
|
+
Check server and authentication status.
|
|
81
|
+
|
|
82
|
+
**Request:**
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
curl http://localhost:3000/health
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Success Response (200):**
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"success": true,
|
|
93
|
+
"data": {
|
|
94
|
+
"authenticated": true,
|
|
95
|
+
"sessions": 2,
|
|
96
|
+
"library_notebooks": 3,
|
|
97
|
+
"context_age_hours": 0.25
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Error Response (500):**
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"success": false,
|
|
107
|
+
"error": "Error message here"
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Fields:**
|
|
112
|
+
|
|
113
|
+
- `authenticated` - Valid Google session
|
|
114
|
+
- `sessions` - Number of active sessions
|
|
115
|
+
- `library_notebooks` - Number of configured notebooks
|
|
116
|
+
- `context_age_hours` - Browser context age (hours)
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 2. Ask Question
|
|
121
|
+
|
|
122
|
+
### `POST /ask`
|
|
123
|
+
|
|
124
|
+
Ask a question to NotebookLM and get a response.
|
|
125
|
+
|
|
126
|
+
**Request:**
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
curl -X POST http://localhost:3000/ask \
|
|
130
|
+
-H "Content-Type: application/json" \
|
|
131
|
+
-d '{
|
|
132
|
+
"question": "What are the main tips for parents?",
|
|
133
|
+
"notebook_id": "parents-numerique"
|
|
134
|
+
}'
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Body Parameters:**
|
|
138
|
+
|
|
139
|
+
| Parameter | Type | Required | Description |
|
|
140
|
+
| --------------- | ------- | -------- | -------------------------------------- |
|
|
141
|
+
| `question` | string | ✅ Yes | The question to ask |
|
|
142
|
+
| `notebook_id` | string | ❌ No | Notebook ID (or URL) |
|
|
143
|
+
| `notebook_url` | string | ❌ No | Direct notebook URL |
|
|
144
|
+
| `session_id` | string | ❌ No | Reuse an existing session |
|
|
145
|
+
| `show_browser` | boolean | ❌ No | Show Chrome (debug) |
|
|
146
|
+
| `source_format` | string | ❌ No | Citation extraction format (see below) |
|
|
147
|
+
|
|
148
|
+
**Source Format Options:**
|
|
149
|
+
|
|
150
|
+
| Format | Description | Example Output |
|
|
151
|
+
| ----------- | ------------------------------------- | ------------------------------------------- |
|
|
152
|
+
| `none` | No extraction (default, fastest) | `"text[1]..."` |
|
|
153
|
+
| `inline` | Insert source text inline | `"text[1: "source excerpt..."]..."` |
|
|
154
|
+
| `footnotes` | Append sources at the end | Answer + `---\n**Sources:**\n[1] text...` |
|
|
155
|
+
| `json` | Return sources as separate object | `{ answer: "...", sources: { citations } }` |
|
|
156
|
+
| `expanded` | Replace markers with full quoted text | `"text "full source quote..."..."` |
|
|
157
|
+
|
|
158
|
+
**Success Response (200):**
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"success": true,
|
|
163
|
+
"data": {
|
|
164
|
+
"status": "success",
|
|
165
|
+
"question": "What advice for parents in the digital age?",
|
|
166
|
+
"answer": "Empathy is a fundamental concept...",
|
|
167
|
+
"session_id": "9a580eee",
|
|
168
|
+
"notebook_url": "https://notebooklm.google.com/notebook/xxx",
|
|
169
|
+
"session_info": {
|
|
170
|
+
"age_seconds": 44,
|
|
171
|
+
"message_count": 1,
|
|
172
|
+
"last_activity": 1763737756057
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**Success Response with Sources (200):**
|
|
179
|
+
|
|
180
|
+
When using `source_format` other than `none`:
|
|
181
|
+
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"success": true,
|
|
185
|
+
"data": {
|
|
186
|
+
"status": "success",
|
|
187
|
+
"question": "What is the main topic?",
|
|
188
|
+
"answer": "The Self is the core essence[1: \"The Self is the seat of consciousness...\"]...",
|
|
189
|
+
"session_id": "abc123",
|
|
190
|
+
"notebook_url": "https://notebooklm.google.com/notebook/xxx",
|
|
191
|
+
"session_info": { ... },
|
|
192
|
+
"sources": {
|
|
193
|
+
"format": "inline",
|
|
194
|
+
"citations": [
|
|
195
|
+
{
|
|
196
|
+
"marker": "[1]",
|
|
197
|
+
"number": 1,
|
|
198
|
+
"sourceText": "The Self is the seat of consciousness that possesses the 8 C's..."
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"extraction_success": true
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Error Response (400):**
|
|
208
|
+
|
|
209
|
+
```json
|
|
210
|
+
{
|
|
211
|
+
"success": false,
|
|
212
|
+
"error": "Missing required field: question"
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Error Response (500):**
|
|
217
|
+
|
|
218
|
+
```json
|
|
219
|
+
{
|
|
220
|
+
"success": false,
|
|
221
|
+
"error": "Timeout waiting for response from NotebookLM"
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
**Response Time:** 30-60 seconds
|
|
226
|
+
|
|
227
|
+
**PowerShell Examples:**
|
|
228
|
+
|
|
229
|
+
```powershell
|
|
230
|
+
# Simple question
|
|
231
|
+
$body = @{
|
|
232
|
+
question = "What are the main tips for parents?"
|
|
233
|
+
notebook_id = "parents-numerique"
|
|
234
|
+
} | ConvertTo-Json
|
|
235
|
+
|
|
236
|
+
Invoke-RestMethod -Uri "http://localhost:3000/ask" -Method Post -Body $body -ContentType "application/json"
|
|
237
|
+
|
|
238
|
+
# With existing session
|
|
239
|
+
$body = @{
|
|
240
|
+
question = "Follow-up question"
|
|
241
|
+
session_id = "9a580eee"
|
|
242
|
+
} | ConvertTo-Json
|
|
243
|
+
|
|
244
|
+
Invoke-RestMethod -Uri "http://localhost:3000/ask" -Method Post -Body $body -ContentType "application/json"
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 3. Setup Auth
|
|
250
|
+
|
|
251
|
+
### `POST /setup-auth`
|
|
252
|
+
|
|
253
|
+
Configure Google authentication (opens Chrome).
|
|
254
|
+
|
|
255
|
+
**Request:**
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
curl -X POST http://localhost:3000/setup-auth \
|
|
259
|
+
-H "Content-Type: application/json" \
|
|
260
|
+
-d '{
|
|
261
|
+
"show_browser": true
|
|
262
|
+
}'
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Body Parameters:**
|
|
266
|
+
|
|
267
|
+
| Parameter | Type | Required | Description |
|
|
268
|
+
| -------------- | ------- | -------- | --------------------------- |
|
|
269
|
+
| `show_browser` | boolean | ❌ No | Show Chrome (default: true) |
|
|
270
|
+
|
|
271
|
+
**Success Response (200):**
|
|
272
|
+
|
|
273
|
+
```json
|
|
274
|
+
{
|
|
275
|
+
"success": true,
|
|
276
|
+
"data": {
|
|
277
|
+
"status": "success",
|
|
278
|
+
"message": "Authentication setup completed successfully"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## 4. List Notebooks
|
|
286
|
+
|
|
287
|
+
### `GET /notebooks`
|
|
288
|
+
|
|
289
|
+
List all notebooks configured in the library.
|
|
290
|
+
|
|
291
|
+
**Request:**
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
curl http://localhost:3000/notebooks
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
**Success Response (200):**
|
|
298
|
+
|
|
299
|
+
```json
|
|
300
|
+
{
|
|
301
|
+
"success": true,
|
|
302
|
+
"data": {
|
|
303
|
+
"notebooks": [
|
|
304
|
+
{
|
|
305
|
+
"id": "parents-numerique",
|
|
306
|
+
"name": "Parents and Digital",
|
|
307
|
+
"description": "Advice for parents in the digital age",
|
|
308
|
+
"url": "https://notebooklm.google.com/notebook/505ee4b1-ad05-4673-a06b-1ec106c2b940",
|
|
309
|
+
"topics": ["parenting", "digital", "education"],
|
|
310
|
+
"use_cases": [
|
|
311
|
+
"Educational advice in the digital age",
|
|
312
|
+
"Questions about parenting and screens"
|
|
313
|
+
],
|
|
314
|
+
"active": true
|
|
315
|
+
}
|
|
316
|
+
],
|
|
317
|
+
"count": 1
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## 5. Add Notebook
|
|
325
|
+
|
|
326
|
+
### `POST /notebooks`
|
|
327
|
+
|
|
328
|
+
Add a new notebook to the library.
|
|
329
|
+
|
|
330
|
+
**⚠️ Automatic validations:**
|
|
331
|
+
|
|
332
|
+
- ✅ Checks NotebookLM URL format
|
|
333
|
+
- ✅ Validates that the notebook actually exists (live check)
|
|
334
|
+
- ✅ Blocks duplicate names
|
|
335
|
+
- ✅ Creates a temporary session to test access
|
|
336
|
+
|
|
337
|
+
**Request:**
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
curl -X POST http://localhost:3000/notebooks \
|
|
341
|
+
-H "Content-Type: application/json" \
|
|
342
|
+
-d '{
|
|
343
|
+
"url": "https://notebooklm.google.com/notebook/505ee4b1-ad05-4673-a06b-1ec106c2b940",
|
|
344
|
+
"name": "Parents and Digital",
|
|
345
|
+
"description": "Advice for parents in the digital age",
|
|
346
|
+
"topics": ["parenting", "digital", "education"]
|
|
347
|
+
}'
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
**Body Parameters:**
|
|
351
|
+
|
|
352
|
+
| Parameter | Type | Required | Description |
|
|
353
|
+
| --------------- | -------- | -------- | -------------------------------------------------------- |
|
|
354
|
+
| `url` | string | ✅ Yes | NotebookLM notebook URL |
|
|
355
|
+
| `name` | string | ✅ Yes | Notebook name (unique) |
|
|
356
|
+
| `description` | string | ✅ Yes | Description |
|
|
357
|
+
| `topics` | string[] | ✅ Yes | List of topics |
|
|
358
|
+
| `content_types` | string[] | ❌ No | Content types (default: `["documentation", "examples"]`) |
|
|
359
|
+
| `use_cases` | string[] | ❌ No | Use cases (auto-generated if absent) |
|
|
360
|
+
| `tags` | string[] | ❌ No | Tags |
|
|
361
|
+
|
|
362
|
+
**Success Response (200):**
|
|
363
|
+
|
|
364
|
+
```json
|
|
365
|
+
{
|
|
366
|
+
"success": true,
|
|
367
|
+
"data": {
|
|
368
|
+
"notebook": {
|
|
369
|
+
"id": "parents-numerique",
|
|
370
|
+
"name": "Parents and Digital",
|
|
371
|
+
"description": "Advice for parents in the digital age",
|
|
372
|
+
"url": "https://notebooklm.google.com/notebook/505ee4b1-ad05-4673-a06b-1ec106c2b940",
|
|
373
|
+
"topics": ["parenting", "digital", "education"],
|
|
374
|
+
"content_types": ["documentation", "examples"],
|
|
375
|
+
"use_cases": ["Educational advice", "Digital parenting"],
|
|
376
|
+
"added_at": "2025-11-22T08:49:16.735Z",
|
|
377
|
+
"last_used": "2025-11-22T08:49:16.735Z",
|
|
378
|
+
"use_count": 0,
|
|
379
|
+
"tags": [],
|
|
380
|
+
"active": false
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
**Possible Errors:**
|
|
387
|
+
|
|
388
|
+
**400 - Name already in use:**
|
|
389
|
+
|
|
390
|
+
```json
|
|
391
|
+
{
|
|
392
|
+
"success": false,
|
|
393
|
+
"error": "A notebook with the name 'Parents and Digital' already exists.\n\nExisting notebook ID: parents-numerique\nURL: https://notebooklm.google.com/notebook/505ee4b1-ad05-4673-a06b-1ec106c2b940\n\nPlease use a different name, or update the existing notebook instead.\nTo update: PUT /notebooks/parents-numerique with new data\nTo delete: DELETE /notebooks/parents-numerique"
|
|
394
|
+
}
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
**400 - Invalid URL:**
|
|
398
|
+
|
|
399
|
+
```json
|
|
400
|
+
{
|
|
401
|
+
"success": false,
|
|
402
|
+
"error": "Invalid NotebookLM URL: https://example.com\n\nExpected format: https://notebooklm.google.com/notebook/[notebook-id]\n\nExample: https://notebooklm.google.com/notebook/abc-123-def-456\n\nTo get the URL:\n1. Go to https://notebooklm.google.com\n2. Open your notebook\n3. Copy the URL from the address bar"
|
|
403
|
+
}
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
**400 - Notebook inaccessible:**
|
|
407
|
+
|
|
408
|
+
```json
|
|
409
|
+
{
|
|
410
|
+
"success": false,
|
|
411
|
+
"error": "Invalid or inaccessible notebook.\n\nURL: https://notebooklm.google.com/notebook/invalid-id\n\nThe notebook page loaded but the chat interface was not found.\nThis usually means:\n- The notebook doesn't exist\n- You don't have access to this notebook\n- The notebook ID in the URL is incorrect\n\nPlease verify the URL by:\n1. Go to https://notebooklm.google.com\n2. Open the notebook manually\n3. Copy the exact URL from the address bar"
|
|
412
|
+
}
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
**⏱️ Response Time:** 15-30 seconds (live validation)
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## 6. Auto-Discover Notebook
|
|
420
|
+
|
|
421
|
+
### `POST /notebooks/auto-discover`
|
|
422
|
+
|
|
423
|
+
Automatically generate notebook metadata by querying NotebookLM itself.
|
|
424
|
+
|
|
425
|
+
**Request:**
|
|
426
|
+
|
|
427
|
+
```json
|
|
428
|
+
{
|
|
429
|
+
"url": "https://notebooklm.google.com/notebook/abc123"
|
|
430
|
+
}
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
**Response (Success):**
|
|
434
|
+
|
|
435
|
+
```json
|
|
436
|
+
{
|
|
437
|
+
"success": true,
|
|
438
|
+
"notebook": {
|
|
439
|
+
"id": "generated-uuid",
|
|
440
|
+
"url": "https://notebooklm.google.com/notebook/abc123",
|
|
441
|
+
"name": "auto-generated-notebook",
|
|
442
|
+
"description": "Comprehensive guide covering key concepts. Includes practical exercises and examples.",
|
|
443
|
+
"tags": ["topic1", "topic2", "learning", "examples", "exercises"],
|
|
444
|
+
"auto_generated": true,
|
|
445
|
+
"created_at": "2025-01-23T10:00:00Z"
|
|
446
|
+
},
|
|
447
|
+
"message": "Notebook auto-discovered and added to library"
|
|
448
|
+
}
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
**Response (Error):**
|
|
452
|
+
|
|
453
|
+
```json
|
|
454
|
+
{
|
|
455
|
+
"error": "NotebookLM returned invalid metadata format",
|
|
456
|
+
"details": "Invalid name format: \"Invalid Name\". Must be kebab-case, 3 words max."
|
|
457
|
+
}
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
**Errors:**
|
|
461
|
+
|
|
462
|
+
- `400 Bad Request`: Invalid URL format
|
|
463
|
+
- `404 Not Found`: Notebook not accessible
|
|
464
|
+
- `500 Internal Server Error`: NotebookLM query failed or returned invalid format
|
|
465
|
+
- `504 Gateway Timeout`: NotebookLM query timeout (>30s)
|
|
466
|
+
|
|
467
|
+
**How it works:**
|
|
468
|
+
|
|
469
|
+
1. System opens the specified notebook
|
|
470
|
+
2. Sends prompt to NotebookLM asking it to analyze its own content
|
|
471
|
+
3. NotebookLM responds with JSON containing name, description, and tags
|
|
472
|
+
4. System validates the metadata format
|
|
473
|
+
5. Saves notebook to library with auto-generated metadata
|
|
474
|
+
|
|
475
|
+
**Progressive Disclosure Pattern:**
|
|
476
|
+
|
|
477
|
+
This endpoint enables the **Level 0** of progressive disclosure:
|
|
478
|
+
|
|
479
|
+
- Metadata stored locally (lightweight, ~100 bytes per notebook)
|
|
480
|
+
- Loaded at startup for instant matching
|
|
481
|
+
- Deep queries to NotebookLM only when notebook is selected
|
|
482
|
+
|
|
483
|
+
Orchestrators (Claude Code, n8n, Cursor) can scan all notebook metadata without rate limit concerns, then query NotebookLM only for the most relevant notebook.
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
## 6b. Create Notebook
|
|
488
|
+
|
|
489
|
+
### `POST /notebooks/create`
|
|
490
|
+
|
|
491
|
+
Create a new empty notebook directly in NotebookLM.
|
|
492
|
+
|
|
493
|
+
**Request:**
|
|
494
|
+
|
|
495
|
+
```bash
|
|
496
|
+
curl -X POST http://localhost:3000/notebooks/create \
|
|
497
|
+
-H "Content-Type: application/json" \
|
|
498
|
+
-d '{
|
|
499
|
+
"name": "My New Notebook"
|
|
500
|
+
}'
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
**Body Parameters:**
|
|
504
|
+
|
|
505
|
+
| Parameter | Type | Required | Description |
|
|
506
|
+
| -------------- | ------- | -------- | ---------------------------------------------- |
|
|
507
|
+
| `name` | string | ❌ No | Notebook name (auto-generated if not provided) |
|
|
508
|
+
| `show_browser` | boolean | ❌ No | Show browser during creation |
|
|
509
|
+
|
|
510
|
+
**Success Response (200):**
|
|
511
|
+
|
|
512
|
+
```json
|
|
513
|
+
{
|
|
514
|
+
"success": true,
|
|
515
|
+
"data": {
|
|
516
|
+
"notebook_url": "https://notebooklm.google.com/notebook/abc123-def456",
|
|
517
|
+
"name": "My New Notebook"
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
**Note:** This creates the notebook in NotebookLM but does NOT add it to the local library. Use `POST /notebooks` or `POST /notebooks/auto-discover` to add it to the library after creation.
|
|
523
|
+
|
|
524
|
+
---
|
|
525
|
+
|
|
526
|
+
## 7. Get Notebook
|
|
527
|
+
|
|
528
|
+
### `GET /notebooks/:id`
|
|
529
|
+
|
|
530
|
+
Get details of a specific notebook.
|
|
531
|
+
|
|
532
|
+
**Request:**
|
|
533
|
+
|
|
534
|
+
```bash
|
|
535
|
+
curl http://localhost:3000/notebooks/parents-numerique
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
**Success Response (200):**
|
|
539
|
+
|
|
540
|
+
```json
|
|
541
|
+
{
|
|
542
|
+
"success": true,
|
|
543
|
+
"data": {
|
|
544
|
+
"notebook": {
|
|
545
|
+
"id": "parents-numerique",
|
|
546
|
+
"name": "Parents and Digital",
|
|
547
|
+
"description": "Advice for parents in the digital age",
|
|
548
|
+
"url": "https://notebooklm.google.com/notebook/505ee4b1-ad05-4673-a06b-1ec106c2b940",
|
|
549
|
+
"topics": ["parenting", "digital", "education"],
|
|
550
|
+
"active": true
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
**Error Response (404):**
|
|
557
|
+
|
|
558
|
+
```json
|
|
559
|
+
{
|
|
560
|
+
"success": false,
|
|
561
|
+
"error": "Notebook not found: parents-numerique"
|
|
562
|
+
}
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
---
|
|
566
|
+
|
|
567
|
+
## 8. Delete Notebook
|
|
568
|
+
|
|
569
|
+
### `DELETE /notebooks/:id`
|
|
570
|
+
|
|
571
|
+
Delete a notebook from the library.
|
|
572
|
+
|
|
573
|
+
**Request:**
|
|
574
|
+
|
|
575
|
+
```bash
|
|
576
|
+
curl -X DELETE http://localhost:3000/notebooks/parents-numerique
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
**Success Response (200):**
|
|
580
|
+
|
|
581
|
+
```json
|
|
582
|
+
{
|
|
583
|
+
"success": true,
|
|
584
|
+
"data": {
|
|
585
|
+
"message": "Notebook removed successfully",
|
|
586
|
+
"id": "parents-numerique"
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
**Error Response (404):**
|
|
592
|
+
|
|
593
|
+
```json
|
|
594
|
+
{
|
|
595
|
+
"success": false,
|
|
596
|
+
"error": "Notebook not found: parents-numerique"
|
|
597
|
+
}
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
**Behavior:**
|
|
601
|
+
|
|
602
|
+
- If the deleted notebook was active, the first remaining notebook automatically becomes active
|
|
603
|
+
- If it was the last notebook, `active_notebook_id` becomes `null`
|
|
604
|
+
- Sessions using this notebook remain open but are no longer linked to a library notebook
|
|
605
|
+
|
|
606
|
+
---
|
|
607
|
+
|
|
608
|
+
## 9. Activate Notebook
|
|
609
|
+
|
|
610
|
+
### `PUT /notebooks/:id/activate`
|
|
611
|
+
|
|
612
|
+
Set a notebook as active (default notebook for requests without `notebook_id`).
|
|
613
|
+
|
|
614
|
+
**Request:**
|
|
615
|
+
|
|
616
|
+
```bash
|
|
617
|
+
curl -X PUT http://localhost:3000/notebooks/shakespeare/activate
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
**Success Response (200):**
|
|
621
|
+
|
|
622
|
+
```json
|
|
623
|
+
{
|
|
624
|
+
"success": true,
|
|
625
|
+
"data": {
|
|
626
|
+
"message": "Notebook activated successfully",
|
|
627
|
+
"notebook": {
|
|
628
|
+
"id": "shakespeare",
|
|
629
|
+
"name": "Shakespeare",
|
|
630
|
+
"description": "William Shakespeare - Complete Works",
|
|
631
|
+
"url": "https://notebooklm.google.com/notebook/19bde485-a9c1-4809-8884-e872b2b67b44",
|
|
632
|
+
"topics": ["literature", "theater", "Shakespeare"],
|
|
633
|
+
"active": true,
|
|
634
|
+
"last_used": "2025-11-22T10:30:45.123Z"
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
**Error Response (404):**
|
|
641
|
+
|
|
642
|
+
```json
|
|
643
|
+
{
|
|
644
|
+
"success": false,
|
|
645
|
+
"error": "Notebook not found: shakespeare"
|
|
646
|
+
}
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
**Behavior:**
|
|
650
|
+
|
|
651
|
+
- Updates `last_used` to current date/time
|
|
652
|
+
- Sets `active_notebook_id` in library.json
|
|
653
|
+
- Does not create a session (metadata only)
|
|
654
|
+
|
|
655
|
+
---
|
|
656
|
+
|
|
657
|
+
## 10. List Sessions
|
|
658
|
+
|
|
659
|
+
### `GET /sessions`
|
|
660
|
+
|
|
661
|
+
List all active browser sessions.
|
|
662
|
+
|
|
663
|
+
**Request:**
|
|
664
|
+
|
|
665
|
+
```bash
|
|
666
|
+
curl http://localhost:3000/sessions
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
**Success Response (200):**
|
|
670
|
+
|
|
671
|
+
```json
|
|
672
|
+
{
|
|
673
|
+
"success": true,
|
|
674
|
+
"data": {
|
|
675
|
+
"sessions": [
|
|
676
|
+
{
|
|
677
|
+
"id": "9a580eee",
|
|
678
|
+
"notebook_url": "https://notebooklm.google.com/notebook/xxx",
|
|
679
|
+
"message_count": 3,
|
|
680
|
+
"age_seconds": 245,
|
|
681
|
+
"inactive_seconds": 120,
|
|
682
|
+
"last_activity": 1763737756057
|
|
683
|
+
}
|
|
684
|
+
],
|
|
685
|
+
"count": 1,
|
|
686
|
+
"max_sessions": 10
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
---
|
|
692
|
+
|
|
693
|
+
## 11. Close Session
|
|
694
|
+
|
|
695
|
+
### `DELETE /sessions/:id`
|
|
696
|
+
|
|
697
|
+
Close a specific browser session.
|
|
698
|
+
|
|
699
|
+
**Request:**
|
|
700
|
+
|
|
701
|
+
```bash
|
|
702
|
+
curl -X DELETE http://localhost:3000/sessions/9a580eee
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
**Success Response (200):**
|
|
706
|
+
|
|
707
|
+
```json
|
|
708
|
+
{
|
|
709
|
+
"success": true,
|
|
710
|
+
"data": {
|
|
711
|
+
"message": "Session closed successfully",
|
|
712
|
+
"session_id": "9a580eee"
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
**Error Response (404):**
|
|
718
|
+
|
|
719
|
+
```json
|
|
720
|
+
{
|
|
721
|
+
"success": false,
|
|
722
|
+
"error": "Session not found: 9a580eee"
|
|
723
|
+
}
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
---
|
|
727
|
+
|
|
728
|
+
## 12. De-authenticate (Logout)
|
|
729
|
+
|
|
730
|
+
### `POST /de-auth`
|
|
731
|
+
|
|
732
|
+
Logout by clearing all authentication data. Preserves notebook library.
|
|
733
|
+
|
|
734
|
+
**Request:**
|
|
735
|
+
|
|
736
|
+
```bash
|
|
737
|
+
curl -X POST http://localhost:3000/de-auth
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
**Success Response (200):**
|
|
741
|
+
|
|
742
|
+
```json
|
|
743
|
+
{
|
|
744
|
+
"success": true,
|
|
745
|
+
"data": {
|
|
746
|
+
"status": "de-authenticated",
|
|
747
|
+
"message": "Successfully logged out. Use setup_auth or re_auth to authenticate again.",
|
|
748
|
+
"authenticated": false
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
**Use cases:**
|
|
754
|
+
|
|
755
|
+
- Security logout before shutting down
|
|
756
|
+
- Clearing credentials without re-authenticating
|
|
757
|
+
- Removing access temporarily
|
|
758
|
+
|
|
759
|
+
---
|
|
760
|
+
|
|
761
|
+
## 13. Re-authenticate
|
|
762
|
+
|
|
763
|
+
### `POST /re-auth`
|
|
764
|
+
|
|
765
|
+
Switch to a different Google account or re-authenticate after logout.
|
|
766
|
+
|
|
767
|
+
**Request:**
|
|
768
|
+
|
|
769
|
+
```bash
|
|
770
|
+
curl -X POST http://localhost:3000/re-auth \
|
|
771
|
+
-H "Content-Type: application/json" \
|
|
772
|
+
-d '{
|
|
773
|
+
"show_browser": true
|
|
774
|
+
}'
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
**Body Parameters:**
|
|
778
|
+
|
|
779
|
+
| Parameter | Type | Required | Description |
|
|
780
|
+
| -------------- | ------- | -------- | ----------------------------------- |
|
|
781
|
+
| `show_browser` | boolean | ❌ No | Show browser window (default: true) |
|
|
782
|
+
|
|
783
|
+
**Success Response (200):**
|
|
784
|
+
|
|
785
|
+
```json
|
|
786
|
+
{
|
|
787
|
+
"success": true,
|
|
788
|
+
"data": {
|
|
789
|
+
"status": "authenticated",
|
|
790
|
+
"message": "Successfully re-authenticated",
|
|
791
|
+
"authenticated": true,
|
|
792
|
+
"duration_seconds": 45.2
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
```
|
|
796
|
+
|
|
797
|
+
**Use cases:**
|
|
798
|
+
|
|
799
|
+
- Switching Google accounts
|
|
800
|
+
- Recovery from rate limits (50 queries/day on free accounts)
|
|
801
|
+
- Fresh authentication after errors
|
|
802
|
+
|
|
803
|
+
---
|
|
804
|
+
|
|
805
|
+
## 14. Cleanup Data
|
|
806
|
+
|
|
807
|
+
### `POST /cleanup-data`
|
|
808
|
+
|
|
809
|
+
Deep cleanup of all NotebookLM MCP data files across 8 categories.
|
|
810
|
+
|
|
811
|
+
**⚠️ CRITICAL:** Close ALL Chrome/Chromium instances BEFORE running this!
|
|
812
|
+
|
|
813
|
+
**Request:**
|
|
814
|
+
|
|
815
|
+
```bash
|
|
816
|
+
# Preview first (confirm=false)
|
|
817
|
+
curl -X POST http://localhost:3000/cleanup-data \
|
|
818
|
+
-H "Content-Type: application/json" \
|
|
819
|
+
-d '{
|
|
820
|
+
"confirm": false,
|
|
821
|
+
"preserve_library": true
|
|
822
|
+
}'
|
|
823
|
+
|
|
824
|
+
# Execute cleanup (confirm=true)
|
|
825
|
+
curl -X POST http://localhost:3000/cleanup-data \
|
|
826
|
+
-H "Content-Type: application/json" \
|
|
827
|
+
-d '{
|
|
828
|
+
"confirm": true,
|
|
829
|
+
"preserve_library": true
|
|
830
|
+
}'
|
|
831
|
+
```
|
|
832
|
+
|
|
833
|
+
**Body Parameters:**
|
|
834
|
+
|
|
835
|
+
| Parameter | Type | Required | Description |
|
|
836
|
+
| ------------------ | ------- | -------- | ------------------------------------------- |
|
|
837
|
+
| `confirm` | boolean | ✅ Yes | Must be true to execute (false for preview) |
|
|
838
|
+
| `preserve_library` | boolean | ❌ No | Keep library.json file (default: false) |
|
|
839
|
+
|
|
840
|
+
**Success Response (200):**
|
|
841
|
+
|
|
842
|
+
```json
|
|
843
|
+
{
|
|
844
|
+
"success": true,
|
|
845
|
+
"data": {
|
|
846
|
+
"message": "Cleanup completed successfully",
|
|
847
|
+
"files_deleted": 47,
|
|
848
|
+
"space_freed_mb": 156.8,
|
|
849
|
+
"library_preserved": true
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
```
|
|
853
|
+
|
|
854
|
+
---
|
|
855
|
+
|
|
856
|
+
## 15. Update Notebook
|
|
857
|
+
|
|
858
|
+
### `PUT /notebooks/:id`
|
|
859
|
+
|
|
860
|
+
Update notebook metadata (name, description, topics, etc.).
|
|
861
|
+
|
|
862
|
+
**Request:**
|
|
863
|
+
|
|
864
|
+
```bash
|
|
865
|
+
curl -X PUT http://localhost:3000/notebooks/n8n-workflows \
|
|
866
|
+
-H "Content-Type: application/json" \
|
|
867
|
+
-d '{
|
|
868
|
+
"name": "n8n Advanced Workflows",
|
|
869
|
+
"description": "Advanced n8n workflow patterns and best practices",
|
|
870
|
+
"topics": ["n8n", "automation", "workflows", "advanced"]
|
|
871
|
+
}'
|
|
872
|
+
```
|
|
873
|
+
|
|
874
|
+
**Body Parameters:**
|
|
875
|
+
|
|
876
|
+
| Parameter | Type | Required | Description |
|
|
877
|
+
| ------------- | -------- | -------- | ------------------- |
|
|
878
|
+
| `name` | string | ❌ No | New notebook name |
|
|
879
|
+
| `description` | string | ❌ No | New description |
|
|
880
|
+
| `topics` | string[] | ❌ No | New topics array |
|
|
881
|
+
| `use_cases` | string[] | ❌ No | New use cases array |
|
|
882
|
+
|
|
883
|
+
**Success Response (200):**
|
|
884
|
+
|
|
885
|
+
```json
|
|
886
|
+
{
|
|
887
|
+
"success": true,
|
|
888
|
+
"data": {
|
|
889
|
+
"notebook": {
|
|
890
|
+
"id": "n8n-workflows",
|
|
891
|
+
"name": "n8n Advanced Workflows",
|
|
892
|
+
"description": "Advanced n8n workflow patterns and best practices",
|
|
893
|
+
"topics": ["n8n", "automation", "workflows", "advanced"],
|
|
894
|
+
"last_modified": "2025-01-24T12:00:00.000Z"
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
---
|
|
901
|
+
|
|
902
|
+
## 16. Search Notebooks
|
|
903
|
+
|
|
904
|
+
### `GET /notebooks/search?query=keyword`
|
|
905
|
+
|
|
906
|
+
Search notebooks by keyword in name, description, or topics.
|
|
907
|
+
|
|
908
|
+
**Request:**
|
|
909
|
+
|
|
910
|
+
```bash
|
|
911
|
+
curl "http://localhost:3000/notebooks/search?query=automation"
|
|
912
|
+
```
|
|
913
|
+
|
|
914
|
+
**Query Parameters:**
|
|
915
|
+
|
|
916
|
+
| Parameter | Type | Required | Description |
|
|
917
|
+
| --------- | ------ | -------- | -------------- |
|
|
918
|
+
| `query` | string | ✅ Yes | Search keyword |
|
|
919
|
+
|
|
920
|
+
**Success Response (200):**
|
|
921
|
+
|
|
922
|
+
```json
|
|
923
|
+
{
|
|
924
|
+
"success": true,
|
|
925
|
+
"data": {
|
|
926
|
+
"notebooks": [
|
|
927
|
+
{
|
|
928
|
+
"id": "n8n-workflows",
|
|
929
|
+
"name": "n8n Advanced Workflows",
|
|
930
|
+
"description": "Advanced n8n workflow patterns",
|
|
931
|
+
"topics": ["n8n", "automation", "workflows"],
|
|
932
|
+
"score": 0.95
|
|
933
|
+
}
|
|
934
|
+
]
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
```
|
|
938
|
+
|
|
939
|
+
---
|
|
940
|
+
|
|
941
|
+
## 17. Get Library Stats
|
|
942
|
+
|
|
943
|
+
### `GET /notebooks/stats`
|
|
944
|
+
|
|
945
|
+
Get statistics about the notebook library.
|
|
946
|
+
|
|
947
|
+
**Request:**
|
|
948
|
+
|
|
949
|
+
```bash
|
|
950
|
+
curl http://localhost:3000/notebooks/stats
|
|
951
|
+
```
|
|
952
|
+
|
|
953
|
+
**Success Response (200):**
|
|
954
|
+
|
|
955
|
+
```json
|
|
956
|
+
{
|
|
957
|
+
"success": true,
|
|
958
|
+
"data": {
|
|
959
|
+
"total_notebooks": 5,
|
|
960
|
+
"active_notebook_id": "n8n-workflows",
|
|
961
|
+
"total_queries": 127,
|
|
962
|
+
"most_used_notebook": {
|
|
963
|
+
"id": "n8n-workflows",
|
|
964
|
+
"name": "n8n Advanced Workflows",
|
|
965
|
+
"use_count": 45
|
|
966
|
+
},
|
|
967
|
+
"recently_added": [
|
|
968
|
+
{
|
|
969
|
+
"id": "llm-dev",
|
|
970
|
+
"name": "LLM Development",
|
|
971
|
+
"added_at": "2025-01-24T10:00:00.000Z"
|
|
972
|
+
}
|
|
973
|
+
]
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
```
|
|
977
|
+
|
|
978
|
+
---
|
|
979
|
+
|
|
980
|
+
## 18. Reset Session
|
|
981
|
+
|
|
982
|
+
### `POST /sessions/:id/reset`
|
|
983
|
+
|
|
984
|
+
Reset a session's chat history while keeping the same session ID.
|
|
985
|
+
|
|
986
|
+
**Request:**
|
|
987
|
+
|
|
988
|
+
```bash
|
|
989
|
+
curl -X POST http://localhost:3000/sessions/9a580eee/reset
|
|
990
|
+
```
|
|
991
|
+
|
|
992
|
+
**Success Response (200):**
|
|
993
|
+
|
|
994
|
+
```json
|
|
995
|
+
{
|
|
996
|
+
"success": true,
|
|
997
|
+
"data": {
|
|
998
|
+
"message": "Session reset successfully",
|
|
999
|
+
"session_id": "9a580eee",
|
|
1000
|
+
"previous_message_count": 12
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
```
|
|
1004
|
+
|
|
1005
|
+
**Use cases:**
|
|
1006
|
+
|
|
1007
|
+
- Clean slate for new task without losing session context
|
|
1008
|
+
- Starting fresh conversation in same notebook
|
|
1009
|
+
|
|
1010
|
+
---
|
|
1011
|
+
|
|
1012
|
+
## 🔒 HTTP Error Codes
|
|
1013
|
+
|
|
1014
|
+
| Code | Meaning | Description |
|
|
1015
|
+
| ----- | --------------------- | -------------------------------------------- |
|
|
1016
|
+
| `200` | OK | Successful request |
|
|
1017
|
+
| `400` | Bad Request | Missing or invalid parameters |
|
|
1018
|
+
| `401` | Unauthorized | Authentication required (if API key enabled) |
|
|
1019
|
+
| `404` | Not Found | Resource not found |
|
|
1020
|
+
| `500` | Internal Server Error | Server error |
|
|
1021
|
+
| `503` | Service Unavailable | Server overloaded (too many sessions) |
|
|
1022
|
+
|
|
1023
|
+
---
|
|
1024
|
+
|
|
1025
|
+
## 15. Add Source to Notebook
|
|
1026
|
+
|
|
1027
|
+
### `POST /content/sources`
|
|
1028
|
+
|
|
1029
|
+
Add a document/source to a notebook. Supports multiple source types.
|
|
1030
|
+
|
|
1031
|
+
**Request:**
|
|
1032
|
+
|
|
1033
|
+
```bash
|
|
1034
|
+
# Add URL source
|
|
1035
|
+
curl -X POST http://localhost:3000/content/sources \
|
|
1036
|
+
-H "Content-Type: application/json" \
|
|
1037
|
+
-d '{
|
|
1038
|
+
"source_type": "url",
|
|
1039
|
+
"url": "https://example.com/article",
|
|
1040
|
+
"notebook_url": "https://notebooklm.google.com/notebook/abc123"
|
|
1041
|
+
}'
|
|
1042
|
+
|
|
1043
|
+
# Add text content
|
|
1044
|
+
curl -X POST http://localhost:3000/content/sources \
|
|
1045
|
+
-H "Content-Type: application/json" \
|
|
1046
|
+
-d '{
|
|
1047
|
+
"source_type": "text",
|
|
1048
|
+
"text": "Your document content here...",
|
|
1049
|
+
"title": "My Document"
|
|
1050
|
+
}'
|
|
1051
|
+
|
|
1052
|
+
# Add YouTube video
|
|
1053
|
+
curl -X POST http://localhost:3000/content/sources \
|
|
1054
|
+
-H "Content-Type: application/json" \
|
|
1055
|
+
-d '{
|
|
1056
|
+
"source_type": "youtube",
|
|
1057
|
+
"url": "https://www.youtube.com/watch?v=VIDEO_ID"
|
|
1058
|
+
}'
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
**Body Parameters:**
|
|
1062
|
+
|
|
1063
|
+
| Parameter | Type | Required | Description |
|
|
1064
|
+
| -------------- | ------ | -------- | ------------------------------------------------------ |
|
|
1065
|
+
| `source_type` | string | ✅ Yes | Type: `file`, `url`, `text`, `youtube`, `google_drive` |
|
|
1066
|
+
| `file_path` | string | ❌ No | Local file path (for `file` type) |
|
|
1067
|
+
| `url` | string | ❌ No | URL (for `url`, `youtube`, `google_drive` types) |
|
|
1068
|
+
| `text` | string | ❌ No | Text content (for `text` type) |
|
|
1069
|
+
| `title` | string | ❌ No | Optional title for the source |
|
|
1070
|
+
| `notebook_url` | string | ❌ No | Target notebook URL |
|
|
1071
|
+
| `session_id` | string | ❌ No | Reuse existing session |
|
|
1072
|
+
|
|
1073
|
+
**Success Response (200):**
|
|
1074
|
+
|
|
1075
|
+
```json
|
|
1076
|
+
{
|
|
1077
|
+
"success": true,
|
|
1078
|
+
"sourceName": "My Document",
|
|
1079
|
+
"status": "ready"
|
|
1080
|
+
}
|
|
1081
|
+
```
|
|
1082
|
+
|
|
1083
|
+
---
|
|
1084
|
+
|
|
1085
|
+
## 15b. Delete Source from Notebook
|
|
1086
|
+
|
|
1087
|
+
### `DELETE /content/sources/:id`
|
|
1088
|
+
|
|
1089
|
+
Delete a source from a notebook by its ID.
|
|
1090
|
+
|
|
1091
|
+
**Request:**
|
|
1092
|
+
|
|
1093
|
+
```bash
|
|
1094
|
+
curl -X DELETE "http://localhost:3000/content/sources/source-123?notebook_url=https://notebooklm.google.com/notebook/abc123"
|
|
1095
|
+
```
|
|
1096
|
+
|
|
1097
|
+
**Path Parameters:**
|
|
1098
|
+
|
|
1099
|
+
| Parameter | Type | Required | Description |
|
|
1100
|
+
| --------- | ------ | -------- | --------------------------- |
|
|
1101
|
+
| `id` | string | Yes | The unique ID of the source |
|
|
1102
|
+
|
|
1103
|
+
**Query Parameters:**
|
|
1104
|
+
|
|
1105
|
+
| Parameter | Type | Required | Description |
|
|
1106
|
+
| -------------- | ------ | -------- | ---------------------- |
|
|
1107
|
+
| `notebook_url` | string | No | Target notebook URL |
|
|
1108
|
+
| `session_id` | string | No | Reuse existing session |
|
|
1109
|
+
|
|
1110
|
+
**Success Response (200):**
|
|
1111
|
+
|
|
1112
|
+
```json
|
|
1113
|
+
{
|
|
1114
|
+
"success": true,
|
|
1115
|
+
"data": {
|
|
1116
|
+
"success": true,
|
|
1117
|
+
"sourceId": "source-123",
|
|
1118
|
+
"sourceName": "My Document"
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
```
|
|
1122
|
+
|
|
1123
|
+
**Error Response (404):**
|
|
1124
|
+
|
|
1125
|
+
```json
|
|
1126
|
+
{
|
|
1127
|
+
"success": false,
|
|
1128
|
+
"error": "Source not found: source-123"
|
|
1129
|
+
}
|
|
1130
|
+
```
|
|
1131
|
+
|
|
1132
|
+
### `DELETE /content/sources` (Alternative)
|
|
1133
|
+
|
|
1134
|
+
Delete a source by name using query parameters. Useful when you know the source name but not the ID.
|
|
1135
|
+
|
|
1136
|
+
**Request:**
|
|
1137
|
+
|
|
1138
|
+
```bash
|
|
1139
|
+
curl -X DELETE "http://localhost:3000/content/sources?source_name=My%20Document"
|
|
1140
|
+
```
|
|
1141
|
+
|
|
1142
|
+
**Query Parameters:**
|
|
1143
|
+
|
|
1144
|
+
| Parameter | Type | Required | Description |
|
|
1145
|
+
| -------------- | ------ | -------- | -------------------------------------- |
|
|
1146
|
+
| `source_id` | string | No\* | The unique ID of the source |
|
|
1147
|
+
| `source_name` | string | No\* | The name of the source (partial match) |
|
|
1148
|
+
| `notebook_url` | string | No | Target notebook URL |
|
|
1149
|
+
| `session_id` | string | No | Reuse existing session |
|
|
1150
|
+
|
|
1151
|
+
\*At least one of `source_id` or `source_name` is required.
|
|
1152
|
+
|
|
1153
|
+
**Success Response (200):**
|
|
1154
|
+
|
|
1155
|
+
```json
|
|
1156
|
+
{
|
|
1157
|
+
"success": true,
|
|
1158
|
+
"data": {
|
|
1159
|
+
"success": true,
|
|
1160
|
+
"sourceId": "source-123",
|
|
1161
|
+
"sourceName": "My Document"
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
```
|
|
1165
|
+
|
|
1166
|
+
**Notes:**
|
|
1167
|
+
|
|
1168
|
+
- The `source_name` parameter supports partial matching (case-insensitive)
|
|
1169
|
+
- Use `list_content` first to find source IDs and names
|
|
1170
|
+
- This action is irreversible - the source will be permanently removed
|
|
1171
|
+
|
|
1172
|
+
---
|
|
1173
|
+
|
|
1174
|
+
## 16. Generate Content
|
|
1175
|
+
|
|
1176
|
+
### `POST /content/generate`
|
|
1177
|
+
|
|
1178
|
+
Generate content using NotebookLM Studio features. Supports audio overview, video, infographic, report, presentation, and data table generation.
|
|
1179
|
+
|
|
1180
|
+
> **Note:** v1.5.0 consolidated all content generation into this single endpoint.
|
|
1181
|
+
|
|
1182
|
+
**Request:**
|
|
1183
|
+
|
|
1184
|
+
```bash
|
|
1185
|
+
# Generate a video (brief format)
|
|
1186
|
+
curl -X POST http://localhost:3000/content/generate \
|
|
1187
|
+
-H "Content-Type: application/json" \
|
|
1188
|
+
-d '{
|
|
1189
|
+
"content_type": "video",
|
|
1190
|
+
"video_format": "brief",
|
|
1191
|
+
"video_style": "documentary",
|
|
1192
|
+
"language": "French",
|
|
1193
|
+
"custom_instructions": "Focus on key takeaways"
|
|
1194
|
+
}'
|
|
1195
|
+
|
|
1196
|
+
# Generate a presentation (detailed slideshow, short length)
|
|
1197
|
+
curl -X POST http://localhost:3000/content/generate \
|
|
1198
|
+
-H "Content-Type: application/json" \
|
|
1199
|
+
-d '{
|
|
1200
|
+
"content_type": "presentation",
|
|
1201
|
+
"presentation_style": "detailed_slideshow",
|
|
1202
|
+
"presentation_length": "short",
|
|
1203
|
+
"language": "English"
|
|
1204
|
+
}'
|
|
1205
|
+
|
|
1206
|
+
# Generate a data table (exports to Google Sheets)
|
|
1207
|
+
curl -X POST http://localhost:3000/content/generate \
|
|
1208
|
+
-H "Content-Type: application/json" \
|
|
1209
|
+
-d '{
|
|
1210
|
+
"content_type": "data_table",
|
|
1211
|
+
"language": "English"
|
|
1212
|
+
}'
|
|
1213
|
+
```
|
|
1214
|
+
|
|
1215
|
+
**Body Parameters:**
|
|
1216
|
+
|
|
1217
|
+
| Parameter | Type | Required | Description |
|
|
1218
|
+
| --------------------- | ------ | -------- | -------------------------------------------------------------------------------------- |
|
|
1219
|
+
| `content_type` | string | ✅ Yes | Type: `audio_overview`, `video`, `infographic`, `report`, `presentation`, `data_table` |
|
|
1220
|
+
| `custom_instructions` | string | ❌ No | Custom focus/prompt (not available for `report`) |
|
|
1221
|
+
| `language` | string | ❌ No | Output language (80+ supported) |
|
|
1222
|
+
| `video_style` | string | ❌ No | Visual style for video (see below) |
|
|
1223
|
+
| `video_format` | string | ❌ No | Video format: `brief` (default), `explainer` |
|
|
1224
|
+
| `infographic_format` | string | ❌ No | Infographic format: `horizontal` (default), `vertical` |
|
|
1225
|
+
| `report_format` | string | ❌ No | Report format: `summary` (default), `detailed` |
|
|
1226
|
+
| `presentation_style` | string | ❌ No | Style: `detailed_slideshow` (default), `presenter_notes` |
|
|
1227
|
+
| `presentation_length` | string | ❌ No | Length: `short`, `default` |
|
|
1228
|
+
| `notebook_url` | string | ❌ No | Target notebook URL |
|
|
1229
|
+
| `session_id` | string | ❌ No | Reuse existing session |
|
|
1230
|
+
|
|
1231
|
+
**Content Types and Export Options:**
|
|
1232
|
+
|
|
1233
|
+
| Content Type | Options | Custom Prompt | Export Type |
|
|
1234
|
+
| ---------------- | ------------------------------------- | ------------- | ------------------ |
|
|
1235
|
+
| `audio_overview` | language only | ✅ Yes | WAV file |
|
|
1236
|
+
| `video` | `brief`/`explainer` + 6 visual styles | ✅ Yes | MP4 file |
|
|
1237
|
+
| `infographic` | `horizontal`/`vertical` | ✅ Yes | PNG file |
|
|
1238
|
+
| `report` | `summary`/`detailed` | ❌ No | Text (in response) |
|
|
1239
|
+
| `presentation` | style + length options | ✅ Yes | Google Slides |
|
|
1240
|
+
| `data_table` | language only | ✅ Yes | Google Sheets |
|
|
1241
|
+
|
|
1242
|
+
> **Note:** `report` does not support custom prompts - only format and language options are available.
|
|
1243
|
+
|
|
1244
|
+
**Presentation Style Options:**
|
|
1245
|
+
|
|
1246
|
+
| Style | Description |
|
|
1247
|
+
| -------------------- | ------------------------------------ |
|
|
1248
|
+
| `detailed_slideshow` | Full slides with visuals and content |
|
|
1249
|
+
| `presenter_notes` | Slides with speaker notes |
|
|
1250
|
+
|
|
1251
|
+
**Presentation Length Options:**
|
|
1252
|
+
|
|
1253
|
+
| Length | Description |
|
|
1254
|
+
| --------- | ----------------------- |
|
|
1255
|
+
| `short` | Condensed (5-8 slides) |
|
|
1256
|
+
| `default` | Standard length (10-15) |
|
|
1257
|
+
|
|
1258
|
+
**Video Visual Styles:**
|
|
1259
|
+
|
|
1260
|
+
| Style | Description |
|
|
1261
|
+
| ------------- | ------------------------------ |
|
|
1262
|
+
| `classroom` | Educational whiteboard style |
|
|
1263
|
+
| `documentary` | Professional documentary style |
|
|
1264
|
+
| `animated` | Motion graphics and animations |
|
|
1265
|
+
| `corporate` | Business presentation style |
|
|
1266
|
+
| `cinematic` | Film-quality dramatic style |
|
|
1267
|
+
| `minimalist` | Clean, simple visuals |
|
|
1268
|
+
|
|
1269
|
+
**Success Response (200):**
|
|
1270
|
+
|
|
1271
|
+
```json
|
|
1272
|
+
{
|
|
1273
|
+
"success": true,
|
|
1274
|
+
"data": {
|
|
1275
|
+
"success": true,
|
|
1276
|
+
"type": "video",
|
|
1277
|
+
"status": "ready",
|
|
1278
|
+
"message": "Video generated successfully"
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
```
|
|
1282
|
+
|
|
1283
|
+
**Note:** Media generation can take several minutes. Use `/content/download` to retrieve files or export URLs.
|
|
1284
|
+
|
|
1285
|
+
---
|
|
1286
|
+
|
|
1287
|
+
## 17b. Download/Export Content
|
|
1288
|
+
|
|
1289
|
+
### `GET /content/download`
|
|
1290
|
+
|
|
1291
|
+
Download or export generated content. Supports file downloads (audio, video, infographic) and Google exports (presentation, data_table).
|
|
1292
|
+
|
|
1293
|
+
**Request:**
|
|
1294
|
+
|
|
1295
|
+
```bash
|
|
1296
|
+
# Download video file
|
|
1297
|
+
curl "http://localhost:3000/content/download?content_type=video&output_path=/path/to/video.mp4"
|
|
1298
|
+
|
|
1299
|
+
# Download infographic
|
|
1300
|
+
curl "http://localhost:3000/content/download?content_type=infographic&output_path=/path/to/image.png"
|
|
1301
|
+
|
|
1302
|
+
# Export presentation to Google Slides (returns URL)
|
|
1303
|
+
curl "http://localhost:3000/content/download?content_type=presentation"
|
|
1304
|
+
|
|
1305
|
+
# Export data table to Google Sheets (returns URL)
|
|
1306
|
+
curl "http://localhost:3000/content/download?content_type=data_table"
|
|
1307
|
+
```
|
|
1308
|
+
|
|
1309
|
+
**Query Parameters:**
|
|
1310
|
+
|
|
1311
|
+
| Parameter | Type | Required | Description |
|
|
1312
|
+
| -------------- | ------ | -------- | ---------------------------------------------------------------------------- |
|
|
1313
|
+
| `content_type` | string | ✅ Yes | Type: `audio_overview`, `video`, `infographic`, `presentation`, `data_table` |
|
|
1314
|
+
| `output_path` | string | ❌ No | Local path to save file (for downloadable types) |
|
|
1315
|
+
| `notebook_url` | string | ❌ No | Target notebook URL |
|
|
1316
|
+
| `session_id` | string | ❌ No | Reuse existing session |
|
|
1317
|
+
|
|
1318
|
+
**Export Types:**
|
|
1319
|
+
|
|
1320
|
+
| Content Type | Export Type | Output |
|
|
1321
|
+
| ---------------- | ------------- | ----------------------------- |
|
|
1322
|
+
| `audio_overview` | File download | WAV file |
|
|
1323
|
+
| `video` | File download | MP4 file |
|
|
1324
|
+
| `infographic` | File download | PNG file |
|
|
1325
|
+
| `presentation` | Google Slides | `googleSlidesUrl` in response |
|
|
1326
|
+
| `data_table` | Google Sheets | `googleSheetsUrl` in response |
|
|
1327
|
+
|
|
1328
|
+
**Note:** `report` is text-only and returned in the `/content/generate` response (no export option).
|
|
1329
|
+
|
|
1330
|
+
**Success Response - File Download (200):**
|
|
1331
|
+
|
|
1332
|
+
```json
|
|
1333
|
+
{
|
|
1334
|
+
"success": true,
|
|
1335
|
+
"data": {
|
|
1336
|
+
"success": true,
|
|
1337
|
+
"filePath": "/path/to/video.mp4",
|
|
1338
|
+
"mimeType": "video/mp4"
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
```
|
|
1342
|
+
|
|
1343
|
+
**Success Response - Google Slides Export (200):**
|
|
1344
|
+
|
|
1345
|
+
```json
|
|
1346
|
+
{
|
|
1347
|
+
"success": true,
|
|
1348
|
+
"data": {
|
|
1349
|
+
"success": true,
|
|
1350
|
+
"googleSlidesUrl": "https://docs.google.com/presentation/d/abc123",
|
|
1351
|
+
"mimeType": "application/vnd.google-apps.presentation"
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
```
|
|
1355
|
+
|
|
1356
|
+
**Success Response - Google Sheets Export (200):**
|
|
1357
|
+
|
|
1358
|
+
```json
|
|
1359
|
+
{
|
|
1360
|
+
"success": true,
|
|
1361
|
+
"data": {
|
|
1362
|
+
"success": true,
|
|
1363
|
+
"googleSheetsUrl": "https://docs.google.com/spreadsheets/d/xyz789",
|
|
1364
|
+
"mimeType": "application/vnd.google-apps.spreadsheet"
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
```
|
|
1368
|
+
|
|
1369
|
+
**Error Response (400):**
|
|
1370
|
+
|
|
1371
|
+
```json
|
|
1372
|
+
{
|
|
1373
|
+
"success": false,
|
|
1374
|
+
"error": "Content type 'report' is not exportable. Report content is text-based and returned in the generation response."
|
|
1375
|
+
}
|
|
1376
|
+
```
|
|
1377
|
+
|
|
1378
|
+
---
|
|
1379
|
+
|
|
1380
|
+
## 18. List Content
|
|
1381
|
+
|
|
1382
|
+
### `GET /content`
|
|
1383
|
+
|
|
1384
|
+
List all sources and generated content in a notebook.
|
|
1385
|
+
|
|
1386
|
+
**Request:**
|
|
1387
|
+
|
|
1388
|
+
```bash
|
|
1389
|
+
curl "http://localhost:3000/content?notebook_url=https://notebooklm.google.com/notebook/abc123"
|
|
1390
|
+
```
|
|
1391
|
+
|
|
1392
|
+
**Query Parameters:**
|
|
1393
|
+
|
|
1394
|
+
| Parameter | Type | Required | Description |
|
|
1395
|
+
| -------------- | ------ | -------- | ---------------------- |
|
|
1396
|
+
| `notebook_url` | string | ❌ No | Target notebook URL |
|
|
1397
|
+
| `session_id` | string | ❌ No | Reuse existing session |
|
|
1398
|
+
|
|
1399
|
+
**Success Response (200):**
|
|
1400
|
+
|
|
1401
|
+
```json
|
|
1402
|
+
{
|
|
1403
|
+
"success": true,
|
|
1404
|
+
"sources": [
|
|
1405
|
+
{
|
|
1406
|
+
"id": "source-1",
|
|
1407
|
+
"name": "Introduction Document",
|
|
1408
|
+
"type": "document",
|
|
1409
|
+
"status": "ready"
|
|
1410
|
+
}
|
|
1411
|
+
],
|
|
1412
|
+
"generatedContent": [
|
|
1413
|
+
{
|
|
1414
|
+
"id": "audio-overview",
|
|
1415
|
+
"type": "audio_overview",
|
|
1416
|
+
"name": "Audio Overview",
|
|
1417
|
+
"status": "ready",
|
|
1418
|
+
"createdAt": "2025-12-24T10:30:00Z"
|
|
1419
|
+
}
|
|
1420
|
+
],
|
|
1421
|
+
"sourceCount": 3,
|
|
1422
|
+
"hasAudioOverview": true
|
|
1423
|
+
}
|
|
1424
|
+
```
|
|
1425
|
+
|
|
1426
|
+
---
|
|
1427
|
+
|
|
1428
|
+
## 19. Download/Export Content
|
|
1429
|
+
|
|
1430
|
+
### `GET /content/download`
|
|
1431
|
+
|
|
1432
|
+
Download or export generated content from NotebookLM.
|
|
1433
|
+
|
|
1434
|
+
**Request:**
|
|
1435
|
+
|
|
1436
|
+
```bash
|
|
1437
|
+
# Download audio
|
|
1438
|
+
curl "http://localhost:3000/content/download?content_type=audio_overview&output_path=/path/to/audio.mp3"
|
|
1439
|
+
|
|
1440
|
+
# Download video
|
|
1441
|
+
curl "http://localhost:3000/content/download?content_type=video&output_path=/path/to/video.mp4"
|
|
1442
|
+
|
|
1443
|
+
# Export presentation (returns Google Slides URL)
|
|
1444
|
+
curl "http://localhost:3000/content/download?content_type=presentation"
|
|
1445
|
+
|
|
1446
|
+
# Export data table (returns Google Sheets URL)
|
|
1447
|
+
curl "http://localhost:3000/content/download?content_type=data_table"
|
|
1448
|
+
```
|
|
1449
|
+
|
|
1450
|
+
**Query Parameters:**
|
|
1451
|
+
|
|
1452
|
+
| Parameter | Type | Required | Description |
|
|
1453
|
+
| -------------- | ------ | -------- | ---------------------------------------------------------------------------- |
|
|
1454
|
+
| `content_type` | string | ✅ Yes | Type: `audio_overview`, `video`, `infographic`, `presentation`, `data_table` |
|
|
1455
|
+
| `output_path` | string | ❌ No | Local path to save file (for audio, video, infographic) |
|
|
1456
|
+
| `notebook_url` | string | ❌ No | Target notebook URL |
|
|
1457
|
+
| `session_id` | string | ❌ No | Reuse existing session |
|
|
1458
|
+
|
|
1459
|
+
**Success Response - File Download (200):**
|
|
1460
|
+
|
|
1461
|
+
```json
|
|
1462
|
+
{
|
|
1463
|
+
"success": true,
|
|
1464
|
+
"filePath": "/path/to/audio.mp3",
|
|
1465
|
+
"mimeType": "audio/mpeg",
|
|
1466
|
+
"size": 1234567
|
|
1467
|
+
}
|
|
1468
|
+
```
|
|
1469
|
+
|
|
1470
|
+
**Success Response - Export (200):**
|
|
1471
|
+
|
|
1472
|
+
```json
|
|
1473
|
+
{
|
|
1474
|
+
"success": true,
|
|
1475
|
+
"googleSlidesUrl": "https://docs.google.com/presentation/d/...",
|
|
1476
|
+
"googleSheetsUrl": "https://docs.google.com/spreadsheets/d/..."
|
|
1477
|
+
}
|
|
1478
|
+
```
|
|
1479
|
+
|
|
1480
|
+
**Note:** Report content is text-based and returned directly in the `/content/generate` response.
|
|
1481
|
+
|
|
1482
|
+
---
|
|
1483
|
+
|
|
1484
|
+
## 20. Create Note
|
|
1485
|
+
|
|
1486
|
+
### `POST /content/notes`
|
|
1487
|
+
|
|
1488
|
+
Create a note in the NotebookLM Studio panel. Notes are user-created annotations that appear in your notebook alongside sources, allowing you to save research findings, summaries, key insights, or any custom content.
|
|
1489
|
+
|
|
1490
|
+
**Request:**
|
|
1491
|
+
|
|
1492
|
+
```bash
|
|
1493
|
+
curl -X POST http://localhost:3000/content/notes \
|
|
1494
|
+
-H "Content-Type: application/json" \
|
|
1495
|
+
-d '{
|
|
1496
|
+
"title": "Key Findings Summary",
|
|
1497
|
+
"content": "## Main Points\n\n1. First important finding\n2. Second key insight\n3. Conclusion and next steps"
|
|
1498
|
+
}'
|
|
1499
|
+
```
|
|
1500
|
+
|
|
1501
|
+
**Body Parameters:**
|
|
1502
|
+
|
|
1503
|
+
| Parameter | Type | Required | Description |
|
|
1504
|
+
| -------------- | ------ | -------- | -------------------------------------------- |
|
|
1505
|
+
| `title` | string | ✅ Yes | Title of the note |
|
|
1506
|
+
| `content` | string | ✅ Yes | Content/body of the note (supports markdown) |
|
|
1507
|
+
| `notebook_url` | string | ❌ No | Target notebook URL |
|
|
1508
|
+
| `session_id` | string | ❌ No | Reuse existing session |
|
|
1509
|
+
|
|
1510
|
+
**Success Response (200):**
|
|
1511
|
+
|
|
1512
|
+
```json
|
|
1513
|
+
{
|
|
1514
|
+
"success": true,
|
|
1515
|
+
"data": {
|
|
1516
|
+
"success": true,
|
|
1517
|
+
"noteTitle": "Key Findings Summary",
|
|
1518
|
+
"status": "created"
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
```
|
|
1522
|
+
|
|
1523
|
+
**Error Response (400):**
|
|
1524
|
+
|
|
1525
|
+
```json
|
|
1526
|
+
{
|
|
1527
|
+
"success": false,
|
|
1528
|
+
"error": "Missing required field: title"
|
|
1529
|
+
}
|
|
1530
|
+
```
|
|
1531
|
+
|
|
1532
|
+
**Use Cases:**
|
|
1533
|
+
|
|
1534
|
+
- Save research summaries from NotebookLM conversations
|
|
1535
|
+
- Create custom annotations for specific sections
|
|
1536
|
+
- Store key quotes and references
|
|
1537
|
+
- Build a structured outline from notebook content
|
|
1538
|
+
|
|
1539
|
+
---
|
|
1540
|
+
|
|
1541
|
+
## 21. Save Chat to Note
|
|
1542
|
+
|
|
1543
|
+
### `POST /content/chat-to-note`
|
|
1544
|
+
|
|
1545
|
+
Save the current chat discussion to a note. This captures the last response from NotebookLM and saves it as a note in the Studio panel.
|
|
1546
|
+
|
|
1547
|
+
**Request:**
|
|
1548
|
+
|
|
1549
|
+
```bash
|
|
1550
|
+
curl -X POST http://localhost:3000/content/chat-to-note \
|
|
1551
|
+
-H "Content-Type: application/json" \
|
|
1552
|
+
-d '{
|
|
1553
|
+
"title": "Summary of Key Points"
|
|
1554
|
+
}'
|
|
1555
|
+
```
|
|
1556
|
+
|
|
1557
|
+
**Body Parameters:**
|
|
1558
|
+
|
|
1559
|
+
| Parameter | Type | Required | Description |
|
|
1560
|
+
| -------------- | ------ | -------- | ------------------------ |
|
|
1561
|
+
| `title` | string | ✅ Yes | Title for the saved note |
|
|
1562
|
+
| `notebook_url` | string | ❌ No | Target notebook URL |
|
|
1563
|
+
| `session_id` | string | ❌ No | Reuse existing session |
|
|
1564
|
+
|
|
1565
|
+
**Success Response (200):**
|
|
1566
|
+
|
|
1567
|
+
```json
|
|
1568
|
+
{
|
|
1569
|
+
"success": true,
|
|
1570
|
+
"data": {
|
|
1571
|
+
"success": true,
|
|
1572
|
+
"noteTitle": "Summary of Key Points",
|
|
1573
|
+
"status": "saved"
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
```
|
|
1577
|
+
|
|
1578
|
+
**Use Cases:**
|
|
1579
|
+
|
|
1580
|
+
- Capture important NotebookLM responses for later reference
|
|
1581
|
+
- Build a collection of insights from multiple questions
|
|
1582
|
+
- Create study notes from Q&A sessions
|
|
1583
|
+
|
|
1584
|
+
---
|
|
1585
|
+
|
|
1586
|
+
## 22. Convert Note to Source
|
|
1587
|
+
|
|
1588
|
+
### `POST /content/notes/:noteTitle/to-source`
|
|
1589
|
+
|
|
1590
|
+
Convert an existing note into a source. This makes the note content available as a citable source in the notebook.
|
|
1591
|
+
|
|
1592
|
+
**Request:**
|
|
1593
|
+
|
|
1594
|
+
```bash
|
|
1595
|
+
curl -X POST "http://localhost:3000/content/notes/My%20Research%20Note/to-source" \
|
|
1596
|
+
-H "Content-Type: application/json" \
|
|
1597
|
+
-d '{}'
|
|
1598
|
+
```
|
|
1599
|
+
|
|
1600
|
+
**Path Parameters:**
|
|
1601
|
+
|
|
1602
|
+
| Parameter | Type | Required | Description |
|
|
1603
|
+
| ----------- | ------ | -------- | ----------------------------- |
|
|
1604
|
+
| `noteTitle` | string | ✅ Yes | URL-encoded title of the note |
|
|
1605
|
+
|
|
1606
|
+
**Body Parameters:**
|
|
1607
|
+
|
|
1608
|
+
| Parameter | Type | Required | Description |
|
|
1609
|
+
| -------------- | ------ | -------- | ---------------------- |
|
|
1610
|
+
| `notebook_url` | string | ❌ No | Target notebook URL |
|
|
1611
|
+
| `session_id` | string | ❌ No | Reuse existing session |
|
|
1612
|
+
|
|
1613
|
+
**Success Response (200):**
|
|
1614
|
+
|
|
1615
|
+
```json
|
|
1616
|
+
{
|
|
1617
|
+
"success": true,
|
|
1618
|
+
"data": {
|
|
1619
|
+
"success": true,
|
|
1620
|
+
"noteTitle": "My Research Note",
|
|
1621
|
+
"status": "converted"
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
```
|
|
1625
|
+
|
|
1626
|
+
**Error Response (404):**
|
|
1627
|
+
|
|
1628
|
+
```json
|
|
1629
|
+
{
|
|
1630
|
+
"success": false,
|
|
1631
|
+
"error": "Note not found: My Research Note"
|
|
1632
|
+
}
|
|
1633
|
+
```
|
|
1634
|
+
|
|
1635
|
+
**Use Cases:**
|
|
1636
|
+
|
|
1637
|
+
- Promote important notes to be citable sources
|
|
1638
|
+
- Include your own research as part of the notebook's knowledge base
|
|
1639
|
+
- Make aggregated insights available for citation in future responses
|
|
1640
|
+
|
|
1641
|
+
---
|
|
1642
|
+
|
|
1643
|
+
## 📊 Limits and Quotas
|
|
1644
|
+
|
|
1645
|
+
| Limit | Value | Configurable |
|
|
1646
|
+
| ------------------------- | --------- | -------------------------- |
|
|
1647
|
+
| **Concurrent sessions** | 10 | ✅ Yes (`MAX_SESSIONS`) |
|
|
1648
|
+
| **Session timeout** | 15 min | ✅ Yes (`SESSION_TIMEOUT`) |
|
|
1649
|
+
| **Request timeout** | 120 sec | ❌ No (hardcoded) |
|
|
1650
|
+
| **Max question size** | Unlimited | ❌ No |
|
|
1651
|
+
| **NotebookLM rate limit** | 50/day | ❌ No (Google limit) |
|
|
1652
|
+
|
|
1653
|
+
---
|
|
1654
|
+
|
|
1655
|
+
## 🧪 Postman Collection
|
|
1656
|
+
|
|
1657
|
+
**Import this collection:**
|
|
1658
|
+
|
|
1659
|
+
```json
|
|
1660
|
+
{
|
|
1661
|
+
"info": {
|
|
1662
|
+
"name": "NotebookLM MCP API",
|
|
1663
|
+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
|
1664
|
+
},
|
|
1665
|
+
"item": [
|
|
1666
|
+
{
|
|
1667
|
+
"name": "Health Check",
|
|
1668
|
+
"request": {
|
|
1669
|
+
"method": "GET",
|
|
1670
|
+
"url": "http://localhost:3000/health"
|
|
1671
|
+
}
|
|
1672
|
+
},
|
|
1673
|
+
{
|
|
1674
|
+
"name": "Ask Question",
|
|
1675
|
+
"request": {
|
|
1676
|
+
"method": "POST",
|
|
1677
|
+
"url": "http://localhost:3000/ask",
|
|
1678
|
+
"header": [{ "key": "Content-Type", "value": "application/json" }],
|
|
1679
|
+
"body": {
|
|
1680
|
+
"mode": "raw",
|
|
1681
|
+
"raw": "{\"question\":\"What advice for parents?\",\"notebook_id\":\"parents-numerique\"}"
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
]
|
|
1686
|
+
}
|
|
1687
|
+
```
|
|
1688
|
+
|
|
1689
|
+
---
|
|
1690
|
+
|
|
1691
|
+
**Complete API Documentation!** ✅
|