Getting Started
Why this exists
Every browser vendor has a different idea of what "get me this page" means. Steel does it in one POST. Kernel wants a live browser first and then runs Playwright inside it. Browserbase fetches without a session but hands you a CDP URL for anything else. Anchor doesn't scrape at all.
That's fine for you, you read the docs once. A model reads them never. So @agntn/browsers puts one scrape() over all of them, opens and closes the session when a vendor needs one, and lets every backend say what it can do through capabilities(). Same thing in TypeScript, in the terminal and in an agent.
Install
pnpm add @agntn/browsers
Node.js 26 or newer.
First call
Playwright runs Chromium on your machine, so it needs no key. It takes the Chrome or Chromium already on your PATH. Without one, npx playwright-core install chromium gets it.
import { create } from "@agntn/browsers";
const provider = await create("playwright");
const page = await provider.scrape("https://example.com");
page.title; // "Example Domain"
page.text; // "This domain is for use in documentation examples…"
create() is async on purpose. That's the moment the provider module gets imported, so importing the package costs nothing and a bundler splits every provider into its own chunk.
Who scrapes, and how
| Needs | ||||
|---|---|---|---|---|
| Steelsteel | one call | 4 / 14 | STEEL_API_KEY | 957 chars of markdown |
| Browserbasebrowserbase | one call | 3 / 14 | BROWSERBASE_API_KEY | 156 chars of text |
| Kernelkernel | in a session | 6 / 14 | KERNEL_API_KEY | 1,989 chars of html |
| Browserlessbrowserless | one call | 8 / 14 | BROWSERLESS_API_KEY | 1,990 chars of html |
| Hyperbrowserhyperbrowser | one call | 7 / 14 | HYPERBROWSER_API_KEY | 958 chars of markdown |
| Anchoranchor | no scrape | 3 / 14 | ANCHOR_API_KEY | refused, no page |
| Cloudflarecloudflare | one call | 11 / 14 | cf auth login or CLOUDFLARE_API_TOKEN | 991 chars of markdown |
| Playwrightplaywright | one call | 9 / 14 | no key | 917 chars of text |
| Lightpandalightpanda | one call | 6 / 14 | no key | 960 chars of markdown |
| Attachattach | one call | 6 / 14 | no key | 917 chars of text |
A cloud provider needs its key in the environment, STEEL_API_KEY for Steel and so on. Cloudflare can use your cf auth login instead, with no token to export. Providers has the full list and a page per vendor.
Let it pick
import { create, resolveProvider } from "@agntn/browsers";
const provider = await create(resolveProvider());
resolveProvider() walks the registry in order and takes the first provider whose key is set. Steel if you set STEEL_API_KEY. Playwright if you set nothing, because it's last and never needs a key. Pass a name and it checks that one instead, and throws AuthError when its key is missing, not something else quietly.
Where next
- Scrape for what comes back and why it isn't the same everywhere.
- CLI if you live in a terminal.
- Agent tools to hand all of this to a model.