Use this file to discover all available pages before exploring further.
The official Rust SDK for Spidra lets you extract structured data from any website by describing what you want in plain English. It handles JavaScript rendering, anti-bot bypass, and CAPTCHA solving as a managed API, so your Rust code stays focused on the data.Built on tokio and reqwest, the SDK uses native Rust async/await throughout and returns Result<T, SpidraError> on every call.
use spidra::{SpidraClient, types::{ScrapeParams, OutputFormat}};#[tokio::main]async fn main() -> Result<(), spidra::SpidraError> { let client = SpidraClient::new("your-api-key"); let mut params = ScrapeParams::new("https://news.ycombinator.com"); params.output_format = Some(OutputFormat::Markdown); params.render_js = Some(true); // run() polls until complete; submit() returns immediately with a job ID. let result = client.scrape().run(¶ms).await?; if let Some(content) = result.content { println!("{content}"); } Ok(())}
use spidra::{SpidraClient, types::{ScrapeParams, OutputFormat}};#[tokio::main]async fn main() -> Result<(), spidra::SpidraError> { let client = SpidraClient::new("your-api-key"); let mut params = ScrapeParams::new("https://news.ycombinator.com"); params.output_format = Some(OutputFormat::Json); params.prompt = Some("Extract the top 5 story titles and their URLs".to_string()); let result = client.scrape().run(¶ms).await?; if let Some(data) = result.data { println!("{}", serde_json::to_string_pretty(&data).unwrap()); } Ok(())}
All methods return Result<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
match client.scrape().run(¶ms).await { Ok(result) => println!("{}", result.content.unwrap_or_default()), Err(spidra::SpidraError::Auth) => eprintln!("Invalid or missing API key"), Err(spidra::SpidraError::RateLimit) => eprintln!("Rate limited — back off and retry"), Err(spidra::SpidraError::InsufficientCredits) => eprintln!("Out of credits"), Err(spidra::SpidraError::Timeout { seconds }) => { eprintln!("Timed out after {}s", seconds) } Err(e) => eprintln!("Error: {e}"),}
Java
Official Java SDK — CompletableFuture-based, builder pattern, no extra HTTP dependencies.