Installation
Quick start
Configuration
Scrape, crawl, search
await oc.crawl(url) gives you a crawl to iterate: it streams every page as it is fetched, rather than waiting for the whole site. oc.crawl.job(id) reaches a crawl by id if the stream drops.
Live browsers, TypeScript only
The one thing that does not exist in the Python SDK.oc.browser() allocates a session on the fleet and connects to it over CDP, nothing launches locally, and every request already leaves from a residential exit. You bring no infrastructure of your own to run.
BrowserOptions is exactly { profile, proxy, record }. See browsers and human input for what click, fill, type, hover, press and selectOption actually do by default, and why it matters.
Agents
caps.budget is required, both at the type level and at runtime, a hard ceiling on what the run is billed. caps.steps and caps.duration are optional. A budget at or below the price of one page (1 credit) is refused before the run starts.
Give agent a JSON Schema and result.data comes back shaped to it instead of free text:
AgentJob also carries status(), results(), events(), cancel(), control('take' | 'release', who?), answer(answer, answeredBy?), addFile({ name, bytes, contentType? }) and downloads({ cursor?, limit? }). See agents for what each one is for.
Downloads
oc.agent.downloads(runId, { cursor?, limit? }) and job.downloads() list the files a run downloaded. oc.sessions.downloads(sessionId), session.downloads() and browser.downloads() do the same for a browser you drive. Each answers an array of Download with cursor set when there is another page. saveDownload(download, dir) writes one file into a folder that already exists, never overwrites, and answers the path. See downloads.
Platform primitives
oc.sessions, oc.profiles, oc.monitors, oc.secrets, oc.rules, oc.integrations and oc.credits() all follow the shapes documented under account and billing.
Errors
Every error classerrorFromWire can produce is exported: OutcrawlError, BadRequestError, CapExceededError, CapabilityUnavailableError, ConcurrencyLimitError, NoCapacityError, NotFoundError, PlanRequiredError, ProfileInUseError, ProfileNotFoundError, QuotaExceededError, UnauthorizedError and more, plus isOutcrawlError and isKnownErrorCode. Branch on error.code, never on error.message. See errors for the full 31-code table.
Testing an unmodified Playwright script
The SDK is ergonomics, never the only door. A plain Playwright script pointed at the CDP endpointoc.browser() opens keeps working without it.