webpeel 0.3.0 → 0.3.2

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/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.6-blue.svg)](https://www.typescriptlang.org/)
8
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
9
9
 
10
- Turn any web page into clean markdown. **Stealth mode. Crawl mode. Zero config. Free forever.**
10
+ Turn any web page into clean markdown. **Smart escalation. Stealth mode. Crawl mode. Free to start.**
11
11
 
12
12
  ```bash
13
13
  npx webpeel https://news.ycombinator.com
@@ -35,27 +35,37 @@ npx webpeel https://news.ycombinator.com
35
35
 
36
36
  | | **WebPeel** | Firecrawl | Jina Reader | MCP Fetch |
37
37
  |---|:---:|:---:|:---:|:---:|
38
- | **Local execution** | ✅ Free forever | ❌ Cloud only | ❌ Cloud only | ✅ Free |
38
+ | **Free tier** | ✅ 125/week | ❌ Cloud only | ❌ Cloud only | ✅ Unlimited |
39
39
  | **JS rendering** | ✅ Auto-escalates | ✅ Always | ❌ No | ❌ No |
40
- | **Stealth mode** | ✅ Built-in | ✅ Yes | ⚠️ Limited | ❌ No |
41
- | **Crawl mode** | ✅ Built-in | ✅ Yes | ❌ No | ❌ No |
40
+ | **Stealth mode** | ✅ Pro plan | ✅ Yes | ⚠️ Limited | ❌ No |
41
+ | **Crawl mode** | ✅ Pro plan | ✅ Yes | ❌ No | ❌ No |
42
42
  | **MCP Server** | ✅ Built-in | ✅ Separate repo | ❌ No | ✅ Yes |
43
43
  | **Zero config** | ✅ `npx webpeel` | ❌ API key required | ❌ API key required | ✅ Yes |
44
- | **Free tier** | ∞ Unlimited local | 500 pages (one-time) | 1000 req/month | ∞ Local only |
45
44
  | **Hosted API** | $9/mo (1,250/wk) | $16/mo (3K/mo) | $200/mo (Starter) | N/A |
46
- | **Weekly reset** | N/A | ❌ Monthly only | ❌ Monthly only | N/A |
47
- | **Extra usage** | N/A | Pay-as-you-go | ❌ Upgrade only | N/A |
48
- | **Rollover** | N/A | ✅ 1 week | ❌ Expire monthly | ❌ N/A |
49
- | **Soft limits** | ✅ Never blocked | ❌ Hard cut-off | ❌ Rate limited | ❌ N/A |
45
+ | **Weekly reset** | Every Monday | ❌ Monthly only | ❌ Monthly only | N/A |
46
+ | **Soft limits** | Never blocked | Hard cut-off | ❌ Rate limited | N/A |
50
47
  | **Markdown output** | ✅ Optimized for AI | ✅ Yes | ✅ Yes | ⚠️ Basic |
51
48
 
52
- **WebPeel gives you Firecrawl's power without the price tag.** Run locally for free, or use our hosted API when you need scale.
49
+ **WebPeel gives you Firecrawl's power with a generous free tier.** Like Claude Code pay only when you need more.
50
+
51
+ ### Usage Model
52
+
53
+ WebPeel uses a **weekly usage budget** for all users (CLI and API):
54
+
55
+ - **First 25 fetches**: No account needed — try it instantly
56
+ - **Free tier**: 125 fetches/week (resets every Monday)
57
+ - **Pro tier**: 1,250 fetches/week ($9/mo)
58
+ - **Max tier**: 6,250 fetches/week ($29/mo)
59
+
60
+ **Credit costs**: Basic fetch = 1 credit, Stealth mode = 5 credits, Search = 1 credit, Crawl = 1 credit/page
61
+
62
+ **Open source**: The CLI is MIT licensed — you can self-host if needed. But the hosted API requires authentication after 25 fetches.
53
63
 
54
64
  ### Highlights
55
65
 
56
- 1. **🎭 Stealth Mode** — Bypass bot detection with playwright-extra stealth plugin. Works on sites that block regular scrapers.
57
- 2. **🕷️ Crawl Mode** — Follow links and extract entire sites. Respects robots.txt and rate limits automatically.
58
- 3. **💰 Actually Free** — Run unlimited requests locally. No API keys, no credit cards, no surprises. Open source MIT.
66
+ 1. **🎭 Stealth Mode** *(Pro)* — Bypass bot detection with playwright-extra stealth plugin. Works on sites that block regular scrapers.
67
+ 2. **🕷️ Crawl Mode** *(Pro)* — Follow links and extract entire sites. Respects robots.txt and rate limits automatically.
68
+ 3. **💰 Generous Free Tier** — 125 free fetches every week. First 25 work instantly with no signup. Basic fetch + JS rendering included free.
59
69
 
60
70
  ---
61
71
 
@@ -64,9 +74,15 @@ npx webpeel https://news.ycombinator.com
64
74
  ### CLI (Zero Install)
65
75
 
66
76
  ```bash
67
- # Basic usage
77
+ # First 25 fetches work instantly, no signup
68
78
  npx webpeel https://example.com
69
79
 
80
+ # After 25 fetches, sign up for free (125/week)
81
+ webpeel login
82
+
83
+ # Check your usage
84
+ webpeel usage
85
+
70
86
  # Stealth mode (bypass bot detection)
71
87
  npx webpeel https://protected-site.com --stealth
72
88
 
@@ -304,16 +320,16 @@ await cleanup(); // Close browser instances
304
320
 
305
321
  ## Hosted API
306
322
 
307
- Live at `https://webpeel-api.onrender.com` — or use the CLI locally for free.
323
+ Live at `https://api.webpeel.dev` — authentication required after first 25 fetches.
308
324
 
309
325
  ```bash
310
326
  # Register and get your API key
311
- curl -X POST https://webpeel-api.onrender.com/v1/auth/register \
327
+ curl -X POST https://api.webpeel.dev/v1/auth/register \
312
328
  -H "Content-Type: application/json" \
313
329
  -d '{"email":"you@example.com","password":"your-password"}'
314
330
 
315
331
  # Fetch a page
316
- curl "https://webpeel-api.onrender.com/v1/fetch?url=https://example.com" \
332
+ curl "https://api.webpeel.dev/v1/fetch?url=https://example.com" \
317
333
  -H "Authorization: Bearer wp_live_your_api_key"
318
334
  ```
319
335
 
@@ -323,10 +339,9 @@ Usage resets every **Monday at 00:00 UTC**, just like Claude Code.
323
339
 
324
340
  | Plan | Price | Weekly Fetches | Burst Limit | Stealth Mode | Extra Usage |
325
341
  |------|------:|---------------:|:-----------:|:------------:|:-----------:|
326
- | **Local CLI** | $0 | Unlimited | N/A | | N/A |
327
- | **Cloud Free** | $0 | 125/wk (~500/mo) | 25/hr | | |
328
- | **Cloud Pro** | $9/mo | 1,250/wk (~5K/mo) | 100/hr | ✅ | ✅ |
329
- | **Cloud Max** | $29/mo | 6,250/wk (~25K/mo) | 500/hr | ✅ | ✅ |
342
+ | **Free** | $0 | 125/wk (~500/mo) | 25/hr | | |
343
+ | **Pro** | $9/mo | 1,250/wk (~5K/mo) | 100/hr | | |
344
+ | **Max** | $29/mo | 6,250/wk (~25K/mo) | 500/hr | ✅ | ✅ |
330
345
 
331
346
  **Three layers of usage control:**
332
347
  1. **Burst limit** — Per-hour cap (25/hr free, 100/hr Pro, 500/hr Max) prevents hammering
@@ -342,21 +357,22 @@ Usage resets every **Monday at 00:00 UTC**, just like Claude Code.
342
357
 
343
358
  ### Why WebPeel Beats Firecrawl
344
359
 
345
- | Feature | WebPeel Local | WebPeel Pro | Firecrawl Hobby |
360
+ | Feature | WebPeel Free | WebPeel Pro | Firecrawl Hobby |
346
361
  |---------|:-------------:|:-----------:|:---------------:|
347
362
  | **Price** | $0 | $9/mo | $16/mo |
348
- | **Weekly Fetches** | | 1,250/wk | ~750/wk |
349
- | **Rollover** | N/A | ✅ 1 week | ❌ Expire monthly |
350
- | **Soft Limits** | ✅ Always | ✅ Never locked out | ❌ Hard cut-off |
351
- | **Extra Usage** | N/A | ✅ Pay-as-you-go | ❌ Upgrade only |
352
- | **Self-Host** | ✅ MIT | N/A | ❌ AGPL |
363
+ | **Weekly Fetches** | 125/wk | 1,250/wk | ~750/wk |
364
+ | **Rollover** | | ✅ 1 week | ❌ Expire monthly |
365
+ | **Soft Limits** | ✅ Degrades | ✅ Never locked out | ❌ Hard cut-off |
366
+ | **Extra Usage** | | ✅ Pay-as-you-go | ❌ Upgrade only |
367
+ | **Self-Host** | ✅ MIT | MIT | ❌ AGPL |
353
368
 
354
369
  **Key differentiators:**
370
+ - **Like Claude Code** — Generous free tier (125/week), pay when you need more
355
371
  - **Weekly resets** — Your usage refreshes every Monday, not once a month
356
- - **Soft limits on every tier** — At 100%, we degrade to HTTP-only instead of blocking you
372
+ - **Soft limits on every tier** — At 100%, we degrade gracefully instead of blocking you
357
373
  - **Extra usage** — Pro/Max users can toggle on pay-as-you-go with spending caps (no surprise bills)
358
- - **Rollover** — Unused fetches carry forward 1 week
359
- - **CLI is always free** — No vendor lock-in. Run unlimited locally forever
374
+ - **First 25 free** — Try it instantly, no signup required
375
+ - **Open source** — MIT licensed, self-host if you want full control
360
376
 
361
377
  See pricing at [webpeel.dev](https://webpeel.dev/#pricing)
362
378
 
@@ -477,7 +493,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
477
493
  - [x] Crawl mode (follow links, respect robots.txt)
478
494
  - [ ] PDF extraction
479
495
  - [ ] Webhook notifications for monitoring
480
- - [ ] AI CAPTCHA solving (planned)
496
+ - [ ] Structured data extraction (JSON output)
481
497
 
482
498
  Vote on features and roadmap at [GitHub Discussions](https://github.com/JakeLiuMe/webpeel/discussions).
483
499
 
@@ -486,7 +502,7 @@ Vote on features and roadmap at [GitHub Discussions](https://github.com/JakeLiuM
486
502
  ## FAQ
487
503
 
488
504
  **Q: How is this different from Firecrawl?**
489
- A: WebPeel runs locally for free (Firecrawl is cloud-only). We also have smart escalation to avoid burning resources on simple pages.
505
+ A: WebPeel has a more generous free tier (125/week vs Firecrawl's 500 one-time credits) and uses weekly resets like Claude Code. We also have smart escalation to avoid burning resources on simple pages.
490
506
 
491
507
  **Q: Can I self-host the API server?**
492
508
  A: Yes! Run `npm run serve` to start the API server. See [docs/self-hosting.md](docs/self-hosting.md) (coming soon).
@@ -494,11 +510,11 @@ A: Yes! Run `npm run serve` to start the API server. See [docs/self-hosting.md](
494
510
  **Q: Does this violate websites' Terms of Service?**
495
511
  A: WebPeel is a tool — how you use it is up to you. Always check a site's ToS before fetching at scale. We recommend respecting `robots.txt` in your own workflows.
496
512
 
497
- **Q: What about CAPTCHA and Cloudflare?**
498
- A: WebPeel handles most Cloudflare challenges automatically via stealth mode. AI-powered CAPTCHA solving is on our roadmap.
513
+ **Q: What about Cloudflare and bot protection?**
514
+ A: WebPeel handles most Cloudflare challenges automatically via stealth mode (Pro plan). For heavily protected sites, stealth mode uses browser fingerprint randomization to bypass detection.
499
515
 
500
516
  **Q: Can I use this in production?**
501
- A: Yes! The hosted API at `https://webpeel-api.onrender.com` is production-ready with authentication, rate limiting, and usage tracking.
517
+ A: Yes! The hosted API at `https://api.webpeel.dev` is production-ready with authentication, rate limiting, and usage tracking.
502
518
 
503
519
  ---
504
520
 
@@ -0,0 +1,84 @@
1
+ /**
2
+ * CLI Authentication & Usage Tracking
3
+ *
4
+ * Handles:
5
+ * - Anonymous usage (25 free fetches)
6
+ * - API key authentication
7
+ * - Usage checking against API
8
+ * - Config file management (~/.webpeel/config.json)
9
+ */
10
+ interface CLIConfig {
11
+ apiKey?: string;
12
+ anonymousUsage: number;
13
+ lastReset: string;
14
+ planTier?: string;
15
+ planCachedAt?: string;
16
+ }
17
+ interface UsageCheckResult {
18
+ allowed: boolean;
19
+ message?: string;
20
+ isAnonymous?: boolean;
21
+ usageInfo?: {
22
+ used: number;
23
+ limit: number;
24
+ remaining: number;
25
+ };
26
+ }
27
+ /**
28
+ * Load config from ~/.webpeel/config.json
29
+ */
30
+ export declare function loadConfig(): CLIConfig;
31
+ /**
32
+ * Save config to ~/.webpeel/config.json
33
+ */
34
+ export declare function saveConfig(config: CLIConfig): void;
35
+ /**
36
+ * Delete config file
37
+ */
38
+ export declare function deleteConfig(): void;
39
+ /**
40
+ * Check usage quota before making a request
41
+ */
42
+ export declare function checkUsage(): Promise<UsageCheckResult>;
43
+ export type PremiumFeature = 'stealth' | 'crawl' | 'batch';
44
+ /**
45
+ * Check if user has access to a premium feature.
46
+ * Returns { allowed: true } for paid users, or a helpful upgrade message.
47
+ *
48
+ * Priority:
49
+ * 1. No API key → blocked (must sign up)
50
+ * 2. Has API key + cached plan → check plan tier
51
+ * 3. Has API key + no cache → check API, then cache
52
+ * 4. API unreachable + cached plan within 7 days → use cache
53
+ * 5. API unreachable + stale cache → allow gracefully (trust the user)
54
+ */
55
+ export declare function checkFeatureAccess(feature: PremiumFeature): Promise<{
56
+ allowed: boolean;
57
+ message?: string;
58
+ }>;
59
+ /**
60
+ * Show usage footer after successful fetch (for free/anonymous users only)
61
+ */
62
+ export declare function showUsageFooter(usageInfo: {
63
+ used: number;
64
+ limit: number;
65
+ remaining: number;
66
+ } | undefined, isAnonymous: boolean, stealth?: boolean): void;
67
+ /**
68
+ * Prompt user for API key via stdin
69
+ */
70
+ export declare function promptForApiKey(): Promise<string>;
71
+ /**
72
+ * Login command - save API key to config
73
+ */
74
+ export declare function handleLogin(): Promise<void>;
75
+ /**
76
+ * Logout command - remove API key from config
77
+ */
78
+ export declare function handleLogout(): void;
79
+ /**
80
+ * Usage command - show current quota
81
+ */
82
+ export declare function handleUsage(): Promise<void>;
83
+ export {};
84
+ //# sourceMappingURL=cli-auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-auth.d.ts","sourceRoot":"","sources":["../src/cli-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH,UAAU,SAAS;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,gBAAgB;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAwBD;;GAEG;AACH,wBAAgB,UAAU,IAAI,SAAS,CAyBtC;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAWlD;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAQnC;AAwBD;;GAEG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC,CA+F5D;AAGD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAQ3D;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAmEjH;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,EACzE,WAAW,EAAE,OAAO,EACpB,OAAO,GAAE,OAAe,GACvB,IAAI,CAaN;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CAYvD;AAED;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAgEjD;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAUnC;AAED;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAoEjD"}