Official async Rust client for the public Crawlora API. It provides generated endpoint helpers, typed request parameters and response models, API-key and JWT authentication, configurable retries, and pagination helpers.
Website · API docs · Pricing · Create an account
- Rust: 1.88 or newer
- Async runtime: Tokio
- Authentication: API key (
x-api-key) or JWT (Authorization) - Default API URL:
https://api.crawlora.net/api/v1 - References: operations · recipes
Add the crate to your project:
cargo add crawloraOr pin a release in Cargo.toml:
[dependencies]
crawlora = "1.50.0"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }Create or sign in to your Crawlora account, then create an API key in your dashboard. Keep the key on the server and load it from an environment variable:
read -r CRAWLORA_API_KEY
export CRAWLORA_API_KEYuse crawlora::{BingSearchParams, CrawloraClient, ModelBingSearchResponseDoc};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = CrawloraClient::new(std::env::var("CRAWLORA_API_KEY")?)?;
let response = client
.bing
.search(BingSearchParams {
q: Some("coffee shops in Seattle".to_owned()),
..Default::default()
})
.await?;
let result: ModelBingSearchResponseDoc = response.into_json()?;
println!("{result:#?}");
Ok(())
}Use the builder to set a custom base URL, timeout, or retry limit:
use std::time::Duration;
use crawlora::CrawloraClient;
let client = CrawloraClient::builder()
.api_key(std::env::var("CRAWLORA_API_KEY")?)
.base_url("https://api.crawlora.net/api/v1")
.timeout(Duration::from_secs(45))
.max_retries(3)
.build()?;
# Ok::<(), Box<dyn std::error::Error>>(())For endpoints that use bearer authentication, configure .jwt_token(...).
RequestOptions can override headers, timeout, retry count, response mode, and
whether non-idempotent requests may be retried on server errors.
Endpoint helpers return ApiResponse, which preserves the HTTP status and
headers. Use into_json() to deserialize the body into a generated response
model or your own type. Non-2xx responses return Error::Api with the status,
response body, and request ID when provided by the API. Retries honor
Retry-After and use bounded exponential backoff for retryable responses.
- Browse the complete generated operation reference.
- See recipes for pagination, response modes, and common workflows.
- Read the hosted API documentation.
- Review plans at crawlora.net/pricing.
MIT. See LICENSE.