Skip to main content
reader-py is the official Python SDK for the Reader API. It wraps the HTTP contract, parses responses into Pydantic models, polls async jobs to completion, raises typed exceptions, and retries transient failures.

Installation

Current version: 0.2.0. Requires Python 3.9+.

Quick start

Async client

Every method on ReaderClient has an awaitable equivalent on AsyncReaderClient.

Configuration

Scraping

Single URL, synchronous

Single-URL requests return immediately with ReadResult(kind="scrape", data=ScrapeResult).

Screenshots

Request a screenshot alongside content:

Multiple URLs (batch)

Passing urls creates an async job. The SDK auto-polls until the job terminates and returns ReadResult(kind="job", data=Job) with all results collected across pagination.

Crawl

Same shape as batch, but with max_depth or max_pages:

Proxy mode

Control how aggressively Reader bypasses bot walls with proxy_mode:
See Proxy modes for the full picture.

Job management

The SDK’s read() method auto-polls batches and crawls, so most callers never need to touch job APIs directly. When you do:

Streaming

For real-time progress updates on a job, use reader.stream(job_id), a generator that yields StreamEvent instances as the job makes progress.
AsyncReaderClient.stream() returns an async generator. Use async for with it.

Credits

Error handling

Every error response from the API is parsed into a specific ReaderApiError subclass. Catch the specific class rather than checking HTTP status codes.
Every error has:
  • code: one of 11 stable codes (e.g. "insufficient_credits", "rate_limited")
  • http_status: the HTTP status code
  • details: dict with error-specific fields
  • docs_url: deep link to the error’s documentation
  • request_id: the x-request-id header from the response, for support tickets
The full catalog is at Errors.

Backwards compatibility

ReaderError is re-exported as an alias for ReaderApiError so code written against the 0.1 SDK continues to work. New code should use ReaderApiError directly.

Automatic retries

The SDK retries these codes automatically with exponential backoff before raising: rate_limited (honors Retry-After), concurrency_limited, internal_error, upstream_unavailable, scrape_timeout. All other codes raise immediately.

Webhooks per request

Every read() call can include an inline webhook config that fires on job lifecycle events, useful for fire-and-forget batches.
See Webhooks for the full delivery contract and signature verification.

Types

All public types are re-exported from the package root:
All models are Pydantic BaseModel subclasses with snake_case field names. The SDK internally translates to/from the API’s camelCase.

Browser Sessions

Create stealthed browser sessions for Playwright automation:

Sync Client

Async Client

Sessions API

Next