Skip to main content
ReaderClient is the high-level API you’ll use for 99% of self-hosted Reader workloads. It owns the Playwright pool and the browser instances, exposes scrape() and crawl(), and handles lazy initialization.

Constructor

The constructor does not touch the browser. It only stores configuration. Initialization happens lazily on the first scrape() or crawl() call.

ReaderClientOptions

See BrowserPoolConfig and ProxyConfig for the nested types.

Methods

Pre-warm the client. Initializes the Playwright pool and browser instances without running a scrape. Optional - scrape() and crawl() will initialize automatically if you haven’t called start().
Scrape one or more URLs. See ScrapeOptions and ScrapeResult.
Discover and optionally scrape pages on a site. See CrawlOptions and CrawlResult.
Returns true if the client has been initialized (via start() or a prior scrape()/crawl() call).
Shut down browsers and release resources. Auto-runs on process exit - call explicitly for fast cleanup.
Helpers for checking proxy pool availability. Useful when you want to gate behavior on whether a residential pool is configured.

Lifecycle

ReaderClient is lazy by design:
  1. new ReaderClient() - constructor does nothing expensive
  2. First call to scrape() or crawl() - triggers Playwright pool startup and browser initialization (1-2 seconds)
  3. Subsequent calls - reuse the warm pool
  4. Auto cleanup on SIGTERM/SIGINT/process exit
  5. Explicit close() - tears down browsers immediately
Reuse a single client instance for the lifetime of your process. Don’t create-and-close per request.

Server pattern

Where to go next

scrape()

Signature, options, and return type.

crawl()

Signature, options, and return type.