notebooklm-api-client 0.1.292 → 0.1.294
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/package.json +1 -1
- package/readme.md +116 -125
- package/CLAUDE.md +0 -28
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "notebooklm-api-client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.294",
|
|
4
4
|
"description": "NotebookLM API via Cloudflare Containers — on-demand Python sandbox that sleeps when idle",
|
|
5
5
|
"author": "vtempest <grokthiscontact@gmail.com>",
|
|
6
6
|
"license": "rights.institute/PROSPER",
|
package/readme.md
CHANGED
|
@@ -1,129 +1,120 @@
|
|
|
1
|
+
<!-- template-git-repo:badges:start -->
|
|
1
2
|
<p align="center">
|
|
2
|
-
<
|
|
3
|
-
<a href="https://
|
|
4
|
-
<
|
|
5
|
-
<a href="https://
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
<a href="https://github.com/
|
|
13
|
-
<img alt="
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<a href="https://github.com/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<img src="https://img.shields.io/github/last-commit/vtempest/qwksearch-research-agent.svg" alt="GitHub last commit" />
|
|
20
|
-
<br />
|
|
21
|
-
<a href="https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request">
|
|
22
|
-
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"
|
|
23
|
-
alt="PRs Welcome" />
|
|
24
|
-
</a>
|
|
25
|
-
<a href="https://codespaces.new/vtempest/qwksearch-research-agent">
|
|
26
|
-
<img src="https://github.com/codespaces/badge.svg" width="150" height="20" />
|
|
27
|
-
</a>
|
|
28
|
-
<a href="https://codecov.io/gh/OpenSourceAGI/qwksearch-research-agent"><img src="https://codecov.io/gh/OpenSourceAGI/qwksearch-research-agent/graph/badge.svg?component=package-notebooklm-api-client" alt="Coverage" /></a>
|
|
3
|
+
<a href="https://qwksearch.com/api/docs"><img src="https://img.shields.io/badge/Docs-blue?logo=ReadTheDocs&logoColor=white" alt="Documentation" /></a>
|
|
4
|
+
<a href="https://stackblitz.com/github/OpenSourceAGI/qwksearch-research-agent/tree/master/packages/notebooklm-api-client"><img height="20px" src="https://developer.stackblitz.com/img/open_in_stackblitz.svg" alt="Open in StackBlitz" /></a>
|
|
5
|
+
<br />
|
|
6
|
+
<a href="https://www.npmjs.com/package/notebooklm-api-client"><img src="https://img.shields.io/npm/dm/notebooklm-api-client.svg" alt="NPM Monthly Downloads" /></a>
|
|
7
|
+
<a href="https://www.npmjs.com/package/notebooklm-api-client"><img src="https://img.shields.io/npm/v/notebooklm-api-client.svg" alt="npm version" /></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/notebooklm-api-client"><img src="https://img.shields.io/npm/dt/notebooklm-api-client.svg" alt="NPM Total Downloads" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/notebooklm-api-client"><img src="https://img.shields.io/npm/types/notebooklm-api-client" alt="TypeScript types" /></a>
|
|
10
|
+
<a href="https://packagephobia.com/result?p=notebooklm-api-client"><img src="https://packagephobia.com/badge?p=notebooklm-api-client" alt="Install size" /></a>
|
|
11
|
+
<br />
|
|
12
|
+
<a href="https://github.com/OpenSourceAGI/qwksearch-research-agent/stargazers"><img src="https://img.shields.io/github/stars/OpenSourceAGI/qwksearch-research-agent" alt="GitHub Stars" /></a>
|
|
13
|
+
<a href="https://github.com/OpenSourceAGI/qwksearch-research-agent/issues"><img src="https://img.shields.io/github/issues/OpenSourceAGI/qwksearch-research-agent?logo=github" alt="GitHub Issues" /></a>
|
|
14
|
+
<a href="https://github.com/OpenSourceAGI/qwksearch-research-agent/pulls"><img src="https://img.shields.io/github/issues-pr/OpenSourceAGI/qwksearch-research-agent?logo=github&label=PRs" alt="Open Pull Requests" /></a>
|
|
15
|
+
<a href="https://github.com/OpenSourceAGI/qwksearch-research-agent/pulls?q=is%3Apr+is%3Aclosed"><img src="https://img.shields.io/github/issues-pr-closed/OpenSourceAGI/qwksearch-research-agent?logo=github&label=PRs%20merged&color=8957e5" alt="Merged Pull Requests" /></a>
|
|
16
|
+
<a href="https://github.com/OpenSourceAGI/qwksearch-research-agent/discussions"><img src="https://img.shields.io/github/discussions/OpenSourceAGI/qwksearch-research-agent" alt="GitHub Discussions" /></a>
|
|
17
|
+
<a href="https://github.com/OpenSourceAGI/qwksearch-research-agent/commits/master/"><img src="https://img.shields.io/github/last-commit/OpenSourceAGI/qwksearch-research-agent.svg" alt="GitHub last commit" /></a>
|
|
18
|
+
<br />
|
|
19
|
+
<img src="https://img.shields.io/badge/Bun-14151A?logo=bun&logoColor=white" alt="Bun" /> <img src="https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=white" alt="TypeScript" /> <img src="https://img.shields.io/badge/Cloudflare%20Workers-F38020?logo=cloudflareworkers&logoColor=white" alt="Cloudflare Workers" /> <img src="https://img.shields.io/badge/Vitest-6E9F18?logo=vitest&logoColor=white" alt="Vitest" />
|
|
29
20
|
</p>
|
|
21
|
+
<!-- template-git-repo:badges:end -->
|
|
30
22
|
|
|
31
|
-
# notebooklm-api
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
- **
|
|
45
|
-
-
|
|
46
|
-
- Container
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-H "
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
-H "
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
wrangler secret put
|
|
100
|
-
wrangler secret put
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
- Idle = $0
|
|
23
|
+
# notebooklm-api
|
|
24
|
+
|
|
25
|
+
NotebookLM API powered by Cloudflare Containers. The Python sandbox runs on demand and sleeps after 5 minutes of inactivity to conserve costs.
|
|
26
|
+
|
|
27
|
+
## Architecture
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
Request → Worker (auth + routing) → Container (notebooklm-py) → Response
|
|
31
|
+
↕
|
|
32
|
+
sleeps when idle
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- **Worker** validates auth and routes requests to the container
|
|
36
|
+
- **Container** runs `notebooklm-py` CLI in a Python 3.12 sandbox
|
|
37
|
+
- Container auto-sleeps after `sleepAfter` (5m) — billing stops until next request
|
|
38
|
+
- Container wakes transparently on next incoming request
|
|
39
|
+
|
|
40
|
+
## API
|
|
41
|
+
|
|
42
|
+
All endpoints require `Authorization: Bearer <API_TOKEN>` header.
|
|
43
|
+
|
|
44
|
+
### POST /
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{ "action": "list" }
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{ "action": "create", "title": "My Notebook", "sourceUrls": ["https://..."] }
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{ "action": "ask", "notebookId": "abc123", "prompt": "Summarize the key points" }
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{ "action": "summarize", "sourceUrls": ["https://..."], "prompt": "What are the main findings?" }
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{ "action": "delete", "notebookId": "abc123" }
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Login via Browser Automation
|
|
67
|
+
|
|
68
|
+
The Worker uses Cloudflare Browser Rendering (Puppeteer) to automate Google login — no manual cookie export needed.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# First call — enters email + password, triggers 2FA
|
|
72
|
+
curl -X POST https://notebooklm-api.<you>.workers.dev \
|
|
73
|
+
-H "Authorization: Bearer $API_TOKEN" \
|
|
74
|
+
-H "Content-Type: application/json" \
|
|
75
|
+
-d '{"action": "login"}'
|
|
76
|
+
|
|
77
|
+
# If 2FA is required — pass the security code
|
|
78
|
+
curl -X POST https://notebooklm-api.<you>.workers.dev \
|
|
79
|
+
-H "Authorization: Bearer $API_TOKEN" \
|
|
80
|
+
-H "Content-Type: application/json" \
|
|
81
|
+
-d '{"action": "login", "securityCode": "123456"}'
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Auth cookies are stored in the container's Durable Object storage and injected on container start.
|
|
85
|
+
|
|
86
|
+
## Setup
|
|
87
|
+
|
|
88
|
+
1. Set secrets:
|
|
89
|
+
```bash
|
|
90
|
+
wrangler secret put API_TOKEN
|
|
91
|
+
wrangler secret put GOOGLE_EMAIL
|
|
92
|
+
wrangler secret put GOOGLE_PASSWORD
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
2. Deploy:
|
|
96
|
+
```bash
|
|
97
|
+
cd packages/notebooklm-api
|
|
98
|
+
wrangler deploy
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
3. Trigger login:
|
|
102
|
+
```bash
|
|
103
|
+
curl -X POST https://notebooklm-api.<you>.workers.dev \
|
|
104
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
105
|
+
-d '{"action": "login"}'
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Development
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
bun install
|
|
112
|
+
wrangler dev
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Cost
|
|
116
|
+
|
|
117
|
+
- Container only bills while awake (per 10ms granularity)
|
|
118
|
+
- `basic` instance: 1/4 vCPU, 1 GiB RAM — ~$0.000005/sec when active
|
|
119
|
+
- Idle = $0
|
|
129
120
|
- `max_instances = 3` caps concurrent cost
|
package/CLAUDE.md
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# CLAUDE.md — `notebooklm-api-client`
|
|
2
|
-
|
|
3
|
-
**Read [`skills/ask-notebooklm-client`](../../skills/ask-notebooklm-client/SKILL.md)
|
|
4
|
-
first.**
|
|
5
|
-
|
|
6
|
-
A NotebookLM API client: a Cloudflare **Worker** in front of an **on-demand
|
|
7
|
-
Python container** that drives NotebookLM. Published.
|
|
8
|
-
|
|
9
|
-
## Two runtimes, one package
|
|
10
|
-
|
|
11
|
-
The Worker is the front door; the container is a sleeping Python service that
|
|
12
|
-
wakes on demand. Consequences:
|
|
13
|
-
|
|
14
|
-
- **Cold starts are the normal case.** The first request after a sleep is slow.
|
|
15
|
-
Timeouts and retries have to assume it; don't tune them against a warm
|
|
16
|
-
container.
|
|
17
|
-
- Waking a container costs money. Don't wake one speculatively, and don't hold
|
|
18
|
-
one awake with keepalives that aren't needed.
|
|
19
|
-
- Worker-side code has Workers constraints (no Node builtins, no filesystem);
|
|
20
|
-
container-side code does not. Know which half you are editing.
|
|
21
|
-
|
|
22
|
-
## Rules
|
|
23
|
-
|
|
24
|
-
- It drives an **unofficial surface** of someone else's product. It will break
|
|
25
|
-
when NotebookLM changes; fail diagnosably and don't retry aggressively into a
|
|
26
|
-
changed API.
|
|
27
|
-
- Credentials belong in Worker secrets and container environment, never in
|
|
28
|
-
source.
|