crawlora 1.49.0-sdk.2

Official async Rust client for the Crawlora public web data API
docs.rs failed to build crawlora-1.49.0-sdk.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

Crawlora Rust SDK

Crates.io Docs.rs License: MIT

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

Install

Add the crate to your project:

cargo add crawlora

Or pin a release in Cargo.toml:

[dependencies]
crawlora = "1.49.0-sdk.2"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

Get an API key

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_KEY

Quick start

use 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(())
}

Configuration

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.

Responses and 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.

More resources

License

MIT. See LICENSE.