Python SDK
The Python SDK provides synchronous and asynchronous clients for every webclaw endpoint. Built on httpx with typed dataclass responses.
Installation
Note
Requires Python 3.9 or later. The only runtime dependency is
httpx.Configuration
Create a client with your API key. All other options are optional.
Options
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | -- | Your webclaw API key (starts with wc_). |
base_url | str | https://api.webclaw.io | Override for self-hosted instances. |
timeout | float | 30.0 | Request timeout in seconds. |
Tip
Use a context manager to automatically close the underlying HTTP client when you're done.
Async client
AsyncWebclaw mirrors every method on the sync client but returns awaitables.
Scrape
Crawl
Starts an async crawl job. The returned handle lets you poll or wait.
Map
Batch
Extract
LLM-powered structured extraction. Pass a JSON schema or a plain-text prompt.
Summarize
Brand
Error handling
All errors inherit from WebclawError. Catch specific subclasses for fine-grained control.
| Exception | HTTP status | When |
|---|---|---|
AuthenticationError | 401 / 403 | Invalid or missing API key |
NotFoundError | 404 | Resource not found |
RateLimitError | 429 | Quota exceeded or too many requests |
TimeoutError | -- | Request or crawl poll timed out |