openclaw-smart-fetch 0.2.22 โ 0.2.24
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 +59 -161
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,52 +1,31 @@
|
|
|
1
1
|
# openclaw-smart-fetch
|
|
2
2
|
|
|
3
|
-
`openclaw-smart-fetch` adds smarter fetching tools
|
|
3
|
+
`openclaw-smart-fetch` adds smarter web fetching tools to OpenClaw.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- `smart_fetch`
|
|
7
|
-
- `batch_smart_fetch`
|
|
8
|
-
|
|
9
|
-
It combines:
|
|
10
|
-
- `@thinkscape/wreq-js` for browser-like transport fingerprints
|
|
11
|
-
- `Defuddle` for readable content extraction
|
|
12
|
-
|
|
13
|
-
## Why use this instead of OpenClaw's built-in `web_fetch`
|
|
14
|
-
|
|
15
|
-
Use this package when the built-in `web_fetch` is not enough.
|
|
5
|
+
## Features
|
|
16
6
|
|
|
17
|
-
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
- **
|
|
22
|
-
-
|
|
23
|
-
- **batch fan-out support** when you want to fetch multiple URLs in one tool call
|
|
24
|
-
- **attachment and binary download support** when a server returns `Content-Disposition: attachment` or a non-text content type
|
|
25
|
-
- **temp-file output** with sanitized filenames and file metadata instead of trying to render binary bytes as page text
|
|
7
|
+
- ๐ **Browser-like TLS/SSL + HTTP fingerprints** โ better success on bot-defended pages
|
|
8
|
+
- ๐งน **Defuddle extraction** โ clean readable content instead of noisy HTML
|
|
9
|
+
- ๐ง **Useful metadata** โ title, author, site, language, published date when available
|
|
10
|
+
- ๐ฆ **Downloads + large file support** โ stream attachments and binaries to temp files
|
|
11
|
+
- โก **Batch fetch** โ fetch many URLs with bounded concurrency
|
|
12
|
+
- ๐ **Multiple output formats** โ `markdown`, `html`, `text`, `json`
|
|
26
13
|
|
|
27
|
-
|
|
28
|
-
- use built-in `web_fetch` for simple pages
|
|
29
|
-
- use `smart_fetch` when pages are blocked, noisy, or extraction quality matters
|
|
30
|
-
- use `batch_smart_fetch` when you need the same smarter fetch behavior over many URLs at once
|
|
14
|
+
## Site optimisations
|
|
31
15
|
|
|
32
|
-
|
|
16
|
+
This package works on general web pages, but some site types benefit especially from Defuddle's extractors and cleanup:
|
|
33
17
|
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
18
|
+
- YouTube pages and transcripts
|
|
19
|
+
- Reddit posts and comment threads
|
|
20
|
+
- X / Twitter posts
|
|
21
|
+
- GitHub pages, issues, PRs, and discussions
|
|
22
|
+
- Hacker News threads
|
|
23
|
+
- Substack posts
|
|
24
|
+
- Pages with code blocks, footnotes, math, and callouts
|
|
38
25
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
## What tools it exposes
|
|
44
|
-
|
|
45
|
-
This package registers:
|
|
46
|
-
- `smart_fetch`
|
|
47
|
-
- `batch_smart_fetch`
|
|
48
|
-
|
|
49
|
-
OpenClaw keeps separate tool names because overriding/hoisting built-in `web_fetch` is not the desired path here.
|
|
26
|
+
Notes:
|
|
27
|
+
- Defuddle is the cleanup layer: it strips common page chrome like nav, sidebars, related links, share widgets, and footers
|
|
28
|
+
- It does **not** execute JavaScript or solve interactive anti-bot/login flows
|
|
50
29
|
|
|
51
30
|
## Install
|
|
52
31
|
|
|
@@ -62,139 +41,58 @@ From a local checkout:
|
|
|
62
41
|
openclaw plugins install -l /absolute/path/to/agent-smart-fetch/packages/openclaw-smart-fetch
|
|
63
42
|
```
|
|
64
43
|
|
|
65
|
-
##
|
|
44
|
+
## OpenClaw tools
|
|
66
45
|
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
- reduce noise before passing content to an agent
|
|
71
|
-
- preserve page metadata for summarization or research
|
|
72
|
-
- use browser-like fetching without paying the cost of full browser automation
|
|
73
|
-
|
|
74
|
-
Use `batch_smart_fetch` when you want to:
|
|
75
|
-
- fetch multiple URLs in one tool call
|
|
76
|
-
- preserve a clear mapping between each input URL and its result
|
|
77
|
-
- keep full content for successes while retaining per-item error strings for failures
|
|
78
|
-
- run bounded-concurrency fetches instead of firing everything at once
|
|
46
|
+
Registers:
|
|
47
|
+
- `smart_fetch`
|
|
48
|
+
- `batch_smart_fetch`
|
|
79
49
|
|
|
80
|
-
|
|
50
|
+
Synopsis:
|
|
81
51
|
|
|
82
52
|
```text
|
|
83
|
-
smart_fetch(url, browser?, os?, headers?, maxChars?, format?, removeImages?, includeReplies?, proxy?)
|
|
53
|
+
smart_fetch(url, browser?, os?, headers?, maxChars?, timeoutMs?, format?, removeImages?, includeReplies?, proxy?)
|
|
84
54
|
batch_smart_fetch(requests)
|
|
85
55
|
```
|
|
86
56
|
|
|
87
|
-
For `batch_smart_fetch`, `requests`
|
|
57
|
+
For `batch_smart_fetch`, each item in `requests` accepts the same parameters as `smart_fetch`.
|
|
88
58
|
|
|
89
|
-
##
|
|
59
|
+
## Output formats
|
|
90
60
|
|
|
91
|
-
|
|
61
|
+
| Format | What you get |
|
|
62
|
+
|---|---|
|
|
63
|
+
| `markdown` | Best default for readable page content |
|
|
64
|
+
| `html` | Cleaned HTML output |
|
|
65
|
+
| `text` | Plain text with markdown stripped |
|
|
66
|
+
| `json` | Structured JSON for metadata-heavy workflows |
|
|
92
67
|
|
|
93
|
-
|
|
94
|
-
> URL: https://example.com/blog/some-article
|
|
95
|
-
> Title: Some Article
|
|
96
|
-
> Author: Jane Doe
|
|
97
|
-
> Published: 2026-03-12
|
|
98
|
-
> Site: Example Blog
|
|
99
|
-
> Language: en
|
|
100
|
-
> Words: 1284
|
|
101
|
-
> Browser: chrome_145/windows
|
|
102
|
-
|
|
103
|
-
# Some Article
|
|
104
|
-
|
|
105
|
-
This is the cleaned readable content extracted from the page.
|
|
106
|
-
```
|
|
68
|
+
## Plugin defaults
|
|
107
69
|
|
|
108
|
-
|
|
70
|
+
See `openclaw.plugin.json` for the schema. The effective defaults are:
|
|
109
71
|
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"maxChars": 50000,
|
|
75
|
+
"timeoutMs": 15000,
|
|
76
|
+
"browser": "chrome_145",
|
|
77
|
+
"os": "windows",
|
|
78
|
+
"removeImages": false,
|
|
79
|
+
"includeReplies": "extractors",
|
|
80
|
+
"batchConcurrency": 8,
|
|
81
|
+
"tempDir": "/tmp/openclaw-smart-fetch"
|
|
82
|
+
}
|
|
115
83
|
```
|
|
116
84
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
> Title: Some Article
|
|
128
|
-
> Author: Jane Doe
|
|
129
|
-
> Published: 2026-03-12
|
|
130
|
-
> Site: Example Blog
|
|
131
|
-
> Language: en
|
|
132
|
-
> Words: 1284
|
|
133
|
-
> Browser: chrome_145/windows
|
|
134
|
-
|
|
135
|
-
# Some Article
|
|
136
|
-
|
|
137
|
-
This is the cleaned readable content extracted from the page.
|
|
138
|
-
|
|
139
|
-
## [2/2] https://blocked.example/post
|
|
140
|
-
> URL: https://blocked.example/post
|
|
141
|
-
> Status: error
|
|
142
|
-
> Error: HTTP 403 Forbidden for https://blocked.example/post
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
## Parameters
|
|
146
|
-
|
|
147
|
-
### `smart_fetch`
|
|
148
|
-
|
|
149
|
-
| Parameter | Type | Default | Description |
|
|
150
|
-
|-------------------|-------------------------------|-----------------|-----------------------------------------------------------|
|
|
151
|
-
| `url` | string | required | URL to fetch |
|
|
152
|
-
| `browser` | string | `chrome_145` | Browser profile used for transport fingerprinting |
|
|
153
|
-
| `os` | string | `windows` | OS profile: `windows`, `macos`, `linux`, `android`, `ios` |
|
|
154
|
-
| `headers` | object | auto | Extra request headers |
|
|
155
|
-
| `maxChars` | number | `50000` | Maximum returned characters |
|
|
156
|
-
| `format` | `markdown` \| `html` \| `text` \| `json` | `markdown` | Output format |
|
|
157
|
-
| `removeImages` | boolean | `false` | Strip image references from output |
|
|
158
|
-
| `includeReplies` | boolean \| `extractors` | `extractors` | Include replies/comments |
|
|
159
|
-
| `proxy` | string | none | Proxy URL |
|
|
160
|
-
|
|
161
|
-
### `batch_smart_fetch`
|
|
162
|
-
|
|
163
|
-
| Parameter | Type | Default | Description |
|
|
164
|
-
|-------------|------------------|-----------|-------------|
|
|
165
|
-
| `requests` | array of objects | required | Array of fetch requests. Each item accepts the same parameters as `smart_fetch` |
|
|
166
|
-
|
|
167
|
-
## OpenClaw config
|
|
168
|
-
|
|
169
|
-
See `openclaw.plugin.json` for plugin config defaults and schema.
|
|
170
|
-
|
|
171
|
-
Configurable defaults include:
|
|
172
|
-
- `maxChars`
|
|
173
|
-
- `timeoutMs`
|
|
174
|
-
- `browser`
|
|
175
|
-
- `os`
|
|
176
|
-
- `removeImages`
|
|
177
|
-
- `includeReplies`
|
|
178
|
-
- `batchConcurrency`
|
|
179
|
-
- `tempDir`
|
|
180
|
-
|
|
181
|
-
`batchConcurrency` defaults to `8` and controls how many `batch_smart_fetch` requests run concurrently.
|
|
182
|
-
|
|
183
|
-
`tempDir` lets the OpenClaw consumer choose where attachment/binary downloads are written before the tool returns their absolute file paths.
|
|
184
|
-
|
|
185
|
-
## When not to use it
|
|
186
|
-
|
|
187
|
-
Do not use these tools when:
|
|
188
|
-
- the page requires JS rendering
|
|
189
|
-
- you need login/session flows
|
|
190
|
-
- you need clicks, scrolling, or form submission
|
|
191
|
-
- a full browser session is required
|
|
192
|
-
|
|
193
|
-
In those cases, use browser automation instead.
|
|
85
|
+
| Setting | Default | Description |
|
|
86
|
+
|---|---:|---|
|
|
87
|
+
| `maxChars` | `50000` | Default maximum returned characters |
|
|
88
|
+
| `timeoutMs` | `15000` | Default request timeout in milliseconds |
|
|
89
|
+
| `browser` | `chrome_145` | Default browser fingerprint profile |
|
|
90
|
+
| `os` | `windows` | Default OS fingerprint profile |
|
|
91
|
+
| `removeImages` | `false` | Strip image references by default |
|
|
92
|
+
| `includeReplies` | `extractors` | Include replies/comments only when site extractors support them |
|
|
93
|
+
| `batchConcurrency` | `8` | Default bounded concurrency for `batch_smart_fetch` |
|
|
94
|
+
| `tempDir` | OS temp dir | Directory for attachment and binary downloads |
|
|
194
95
|
|
|
195
|
-
##
|
|
96
|
+
## Dev and publishing note
|
|
196
97
|
|
|
197
|
-
|
|
198
|
-
- publish-ready TS/test/build packaging workflow across the monorepo
|
|
199
|
-
- richer animated batch progress behavior in pi-facing consumers
|
|
200
|
-
- attachment and binary download streaming with sanitized temp-file output
|
|
98
|
+
This repo uses Bun for local development, tests, and workspace scripts. Package publishing still goes through `npm publish` in CI so npm Trusted Publishing can be used.
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "smart-fetch",
|
|
3
3
|
"name": "Smart Fetch",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.24",
|
|
5
5
|
"description": "Clean web content extraction with browser-grade TLS fingerprinting. Uses wreq-js (Rust native bindings) for anti-bot bypass and Defuddle for superior content extraction.",
|
|
6
6
|
"configSchema": {
|
|
7
7
|
"type": "object",
|