Welcome to the Scwrap documentation.
Scwrap ("scraper wrapper") gives every scraper the same shape. You describe what a Scraper takes, returns and how it can fail. You write the scraping code as an Effect Layer, usually with an AI agent. You deploy it as a Release into your own Scwrap instance in your Cloudflare account, and any program or agent with the instance's run token can run it.
The Scwrap repository is what you deploy: the instance's Stack, the SDKs, the scwrap CLI and one example Scraper. You install the instance once from your copy of the repository (Setting up a new instance). Your own Scrapers live in a separate repository of your own, which installs the SDKs and deploys its Releases to the instance with the scwrap CLI (Installation). Several repositories can deploy to one instance, and upgrading the instance keeps every installed Release. Scwrap is not hosted and has no scheduler (Non-goals), and choosing sources you are allowed to scrape is up to you. Known gaps lists what an instance does not do yet.
| Feature | Description |
|---|---|
| Typed contracts | A Definition holds the input, output and error schemas. Client types, JSON Schemas and MCP tool schemas are derived from it. |
| Checked output | Every item a caller sees has passed the Definition's output schema. An item that does not match fails the Run instead of reaching the caller. |
| Declared errors | Each Scraper lists the failures it can end with, such as Blocked or RateLimited. Code that can fail with anything else does not compile. |
| Capabilities | A Scraper asks for what it needs, such as an HTTP client, a proxy route or a browser, in its type. Tests pass a fake, a Release passes the real one. |
| One way to deploy | A Release is a few lines. A Worker release runs in the instance's Worker, with a proxy route or a browser when it needs one. |
| Callable from anywhere | Run a Scraper with the typed client, plain HTTPS or the instance's MCP server. |
How to use these docs
Start with Getting Started. It builds one Scraper from nothing and grows it step by step:
- How Scwrap works names the parts.
- Installation sets up your Scraper repository.
- Your first Scraper reads a JSON API with a plain HTTP client.
- Testing your Scraper proves it without the network.
- Deploying to a Worker releases it into an instance.
- Calling your Scraper runs it from code, HTTPS and MCP.
- Adding a proxy sends its requests through a proxy route.
- Adding a browser reads pages that only render with JavaScript.
The steps use the same Definition from start to finish. Only the Implementation and its Release change, which is the point: a Scraper that starts as one HTTP request can grow to proxies, browsers and captchas without changing what its callers see.
After that, each package has its own section in the sidebar:
| Section | Package | Read it for |
|---|---|---|
| Domain | @scwrap/domain | Definitions, Scraper.run, Shared errors, HTTP helpers and the Capability ports. |
| Browser | @scwrap/domain, @scwrap/browser | The Browser Capability, how to write browser Implementations, and its providers. |
| Deploy | @scwrap/deploy | Releases, the scwrap CLI and how releases are built. |
| Client | @scwrap/client | The typed client for an instance. |
| Instance | @scwrap/platform-cloudflare | The instance's HTTP API, MCP server, tracing, deployment service, credentials, infrastructure and known gaps. |
| Capability providers | @scwrap/platform-apify, @scwrap/captcha-templates, @scwrap/ai-cloudflare | Proxies, captcha solving and Workers AI. |
| Example Scraper | @scwrap/earthquakes | The example Scraper in the Scwrap repository and what it returns. |
New to Effect? Read Effect essentials first. It covers the few ideas these docs rely on.
Already running scrapers in TypeScript or Python? Porting an existing scraper moves one onto Scwrap.
Project
| Status | In active development, before 1.0. The SDKs are at 0.4 on npm, and a minor version such as 0.5 may break them (Compatibility). The maintainer's production instance runs at https://scwrap.j4k4.dev and is deployed from main on every push. |
| Licence | MIT (LICENSE). Borrowed code keeps its own notice (PROVENANCE.md). |
| Maintainer | Jakob Kruse. Report problems and ask questions in J4K4-Dev/scwrap. |
Coding with agents
People and AI agents write Scrapers the same way.
- AGENTS.md holds the rules the checks enforce in the Scwrap repository. An agent reads it before changing anything there, and your Scraper repository can keep its own.
pnpm vendor:agent-sourcesin the Scwrap repository fetches the pinned Effect and Alchemy sources into.agent_sources/, so an agent reads the real API instead of guessing.- The instance's MCP server lets an agent list Scrapers, read their schemas, run them and read the items.
- The glossary defines every term these docs use.