Skip to content
2 min read · 382 words

@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

InterfaceDescription
ScrapperArticleA normalised Scrapper article (loose/nullable upstream).
ScrapperArticleParamsModel-facing params for /api/article.
ScrapperCommonParamsModel-facing params common to both verbs (snake_case; mapped to kebab on the wire).
ScrapperLinkA single link from /api/links (verified live: { url, text }).
ScrapperLinksA normalised Scrapper links payload.
ScrapperLinksParamsModel-facing params for /api/links.

Type Aliases

Type AliasDescription
ScrapperArticleConfigAsync-factory config for /api/article (full artifact resolver, incl. dynamic import).
ScrapperArticleConfigSyncSync-factory config for /api/article (artifact narrowed to the sync subset).
ScrapperLinksConfigAsync-factory config for /api/links.
ScrapperLinksConfigSyncSync-factory config for /api/links.

Functions

FunctionDescription
createScrapperArticleToolCreate a configured Scrapper article Tool (async — accepts a dynamic-import artifact).
createScrapperArticleToolSyncSynchronous createScrapperArticleToolartifact narrowed to the sync subset.
createScrapperLinksToolCreate a configured Scrapper links Tool (async — accepts a dynamic-import artifact).
createScrapperLinksToolSyncSynchronous createScrapperLinksToolartifact 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