@nhtio/adk/batteries/tools/scrapper
Factories for configured Scrapper web-extraction tools (article + links).
Remarks
Scrapper is a self-hosted service that loads a page in a real headless browser and extracts either the readable article (/api/article) or the page's links (/api/links). It gives an agent browser-grade reading power — JS-rendered pages a renderless fetcher can't see — but as a stateless HTTP call: each request runs in a fresh incognito context, stores no session or credentials, and shares nothing with any other call.
Like the SearXNG battery, this exports factories (not ready-made Tool constants), because a scrape tool needs per-deployment config (instance URL + custom auth headers). Two verbs, each with an async factory (createScrapperArticleTool / createScrapperLinksTool, accepting a dynamic-import artifact resolver) and a sync variant (createScrapperArticleToolSync / createScrapperLinksToolSync). Because these are factories, they MUST NOT be bulk-registered via Object.values(batteries) — call one, then register the returned tool.
See
https://github.com/amerkurev/scrapper
Interfaces
| Interface | Description |
|---|---|
| ScrapperArticle | A normalised Scrapper article (loose/nullable upstream). |
| ScrapperArticleParams | Model-facing params for /api/article. |
| ScrapperCommonParams | Model-facing params common to both verbs (snake_case; mapped to kebab on the wire). |
| ScrapperLink | A single link from /api/links (verified live: { url, text }). |
| ScrapperLinks | A normalised Scrapper links payload. |
| ScrapperLinksParams | Model-facing params for /api/links. |
Type Aliases
| Type Alias | Description |
|---|---|
| ScrapperArticleConfig | Async-factory config for /api/article (full artifact resolver, incl. dynamic import). |
| ScrapperArticleConfigSync | Sync-factory config for /api/article (artifact narrowed to the sync subset). |
| ScrapperLinksConfig | Async-factory config for /api/links. |
| ScrapperLinksConfigSync | Sync-factory config for /api/links. |
Functions
| Function | Description |
|---|---|
| createScrapperArticleTool | Create a configured Scrapper article Tool (async — accepts a dynamic-import artifact). |
| createScrapperArticleToolSync | Synchronous createScrapperArticleTool — artifact narrowed to the sync subset. |
| createScrapperLinksTool | Create a configured Scrapper links Tool (async — accepts a dynamic-import artifact). |
| createScrapperLinksToolSync | Synchronous createScrapperLinksTool — artifact narrowed to the sync subset. |
References
E_INVALID_SCRAPPER_CONFIG
Re-exports E_INVALID_SCRAPPER_CONFIG
ScrapperInputMiddlewareFn
Re-exports ScrapperInputMiddlewareFn
ScrapperOutputMiddlewareFn
Re-exports ScrapperOutputMiddlewareFn
ScrapperRequestContext
Re-exports ScrapperRequestContext
ScrapperResponseContext
Re-exports ScrapperResponseContext