npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

notebooklm-api-client

v0.1.107

Published

NotebookLM API via Cloudflare Containers — on-demand Python sandbox that sleeps when idle

Downloads

15,791

Readme

notebooklm-api

NotebookLM API powered by Cloudflare Containers. The Python sandbox runs on demand and sleeps after 5 minutes of inactivity to conserve costs.

Architecture

Request → Worker (auth + routing) → Container (notebooklm-py) → Response
                                         ↕
                                    sleeps when idle
  • Worker validates auth and routes requests to the container
  • Container runs notebooklm-py CLI in a Python 3.12 sandbox
  • Container auto-sleeps after sleepAfter (5m) — billing stops until next request
  • Container wakes transparently on next incoming request

API

All endpoints require Authorization: Bearer <API_TOKEN> header.

POST /

{ "action": "list" }
{ "action": "create", "title": "My Notebook", "sourceUrls": ["https://..."] }
{ "action": "ask", "notebookId": "abc123", "prompt": "Summarize the key points" }
{ "action": "summarize", "sourceUrls": ["https://..."], "prompt": "What are the main findings?" }
{ "action": "delete", "notebookId": "abc123" }

Login via Browser Automation

The Worker uses Cloudflare Browser Rendering (Puppeteer) to automate Google login — no manual cookie export needed.

# First call — enters email + password, triggers 2FA
curl -X POST https://notebooklm-api.<you>.workers.dev \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action": "login"}'

# If 2FA is required — pass the security code
curl -X POST https://notebooklm-api.<you>.workers.dev \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action": "login", "securityCode": "123456"}'

Auth cookies are stored in the container's Durable Object storage and injected on container start.

Setup

  1. Set secrets:

    wrangler secret put API_TOKEN
    wrangler secret put GOOGLE_EMAIL
    wrangler secret put GOOGLE_PASSWORD
  2. Deploy:

    cd packages/notebooklm-api
    wrangler deploy
  3. Trigger login:

    curl -X POST https://notebooklm-api.<you>.workers.dev \
      -H "Authorization: Bearer $TOKEN" \
      -d '{"action": "login"}'

Development

bun install
wrangler dev

Cost

  • Container only bills while awake (per 10ms granularity)
  • basic instance: 1/4 vCPU, 1 GiB RAM — ~$0.000005/sec when active
  • Idle = $0
  • max_instances = 3 caps concurrent cost