Go SDK
The Go SDK provides a typed client for every webclaw endpoint. Zero dependencies beyond the standard library, context.Context on every method, and functional options for configuration.
Installation
Note
Requires Go 1.21 or later. No external dependencies.
Configuration
Create a client with your API key and optional functional options.
Options
| Function | Default | Description |
|---|---|---|
WithBaseURL(url) | https://api.webclaw.io | Override for self-hosted instances. |
WithTimeout(d) | 30s | HTTP client timeout. |
WithHTTPClient(hc) | default http.Client | Replace the underlying HTTP client entirely. |
Scrape
Crawl
Start an async crawl, then poll or wait for completion.
Tip
WaitForCrawl respects the context deadline -- pass a context with timeout for upper-bound control.Map
Batch
Extract
LLM-powered structured extraction. Pass a JSON schema or a plain-text prompt.
Summarize
Brand
Error handling
API errors are returned as *APIError with status code and message. Use errors.As to unwrap.
| Field | Type | Description |
|---|---|---|
StatusCode | int | HTTP status code (401, 404, 429, etc.) |
Message | string | Human-readable error message |
Types and constants
The SDK exports typed constants for formats and crawl statuses.