tokio and reqwest, the SDK uses native Rust async/await throughout and returns Result<T, SpidraError> on every call.
Installation
Add the dependency to yourCargo.toml:
Get your API key from app.spidra.io under Settings → API Keys.
Keep your key out of source control — read it from an environment variable.
Getting started
All requests require an API key sent as thex-api-key header. Pass it to the client:
Quick start
run() submits the job and polls until it completes, then returns the result.
Scraping
Scrape a single page
AI extraction with a prompt
Submit and poll manually
If you need more control over polling (e.g. to show progress), submit and poll separately:waiting · active · completed · failed · cancelled
Custom polling options
Userun_with_options to override the default poll interval and timeout:
Batch scraping
Submit up to 50 URLs in a single request. All URLs are processed in parallel.pending · running · completed · failed
Batch statuses: pending · running · completed · failed · cancelled
Crawling
Give Spidra a starting URL and instructions for which links to follow. It discovers pages automatically and extracts structured data from each one.Logs
Every API scrape job is logged automatically.Usage statistics
Returns credit and request usage broken down by day or week.| Range | Description |
|---|---|
UsageRange::SevenDays | Last 7 days, one row per day |
UsageRange::ThirtyDays | Last 30 days, one row per day |
UsageRange::Weekly | Last 7 weeks, one row per week |
Error handling
All methods returnResult<T, SpidraError>. The error variants are:
| Variant | When |
|---|---|
SpidraError::Auth | 401 / 403 — invalid or missing API key |
SpidraError::RateLimit | 429 — rate limit exceeded |
SpidraError::InsufficientCredits | 402 — not enough credits |
SpidraError::Api { status, message } | Other 4xx errors |
SpidraError::ServerError { status, message } | 5xx server errors |
SpidraError::Timeout { seconds } | Polling timed out |
SpidraError::JobFailed { message } | Remote job reached failed state |
SpidraError::JobCancelled | Remote job was cancelled |
SpidraError::Http(e) | Underlying reqwest transport error |
SpidraError::Json(e) | JSON deserialisation error |
Java
Official Java SDK — CompletableFuture-based, builder pattern, no extra HTTP dependencies.

