| Crates.io | crawl4ai-client |
| lib.rs | crawl4ai-client |
| version | 0.1.0 |
| created_at | 2025-12-11 11:35:02.27688+00 |
| updated_at | 2025-12-11 11:35:02.27688+00 |
| description | Rust SDK for the Crawl4AI API |
| homepage | https://github.com/nurokhq/crawl4ai-client-rust |
| repository | https://github.com/nurokhq/crawl4ai-client-rust |
| max_upload_size | |
| id | 1979539 |
| size | 331,317 |
Rust API Client SDK for Crawl4AI API, providing type-safe bindings to interact with Crawl4AI.
This client is auto-generated from api/crawl4ai-openapi.json. It targets teams that want a lightweight, async-first Rust interface to Crawl4AI for crawling, enrichment, and downstream LLM workflows.
reqwestrustls-tls (default) or native-tls/crawl and /crawl/stream endpointsAdd this to your Cargo.toml:
[dependencies]
crawl4ai-client = { version = "0.1.0", features = ["rustls-tls"] }
Or with native TLS:
[dependencies]
crawl4ai-client = { version = "0.1.0", features = ["native-tls"] }
If the crate is not yet published on crates.io, use the Git dependency:
[dependencies]
crawl4ai-client = { git = "https://github.com/nurokhq/crawl4ai-client-rust", features = ["rustls-tls"] }
The client tracks the Crawl4AI OpenAPI version shipped in this repo.
| Client Version | Crawl4AI API Version |
|---|---|
| 0.1.0 | 0.7.8 |
Please ensure you use a compatible client version for your Crawl4AI deployment.
use crawl4ai_client::apis::{configuration::{ApiKey, Configuration}, default_api};
use crawl4ai_client::models::CrawlRequestWithHooks;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Configure the client
let mut config = Configuration::default();
config.base_path = "https://api.crawl4ai.com".to_string(); // set to your deployment
config.api_key = Some(ApiKey { prefix: None, key: "YOUR_API_KEY".into() });
// Build a crawl request
let request = CrawlRequestWithHooks::new(vec![
"https://example.com".to_string(),
]);
// Fire the crawl
let response = default_api::crawl_crawl_post(&config, request).await?;
println!("{response}");
Ok(())
}
default: Enables rustls-tls featurerustls-tls: Use rustls for TLS (default, recommended)native-tls: Use native TLS implementationThis SDK is generated from the OpenAPI specification using OpenAPI Generator.
To regenerate the SDK:
./scripts/generate_api_sdk.sh
This script:
api/crawl4ai-openapi.jsonsrc/generated/cargo fmtSee LICENSE file for details.
Contributions are welcome! Please ensure that:
cargo fmtcargo testcargo clippy