| Crates.io | kagisearch |
| lib.rs | kagisearch |
| version | 0.3.0 |
| created_at | 2025-03-23 15:20:03.446366+00 |
| updated_at | 2025-03-25 15:13:51.167675+00 |
| description | A Rust library that allows you to perform Kagi searches programmatically using chromiumoxide, without consuming additional API credits. |
| homepage | |
| repository | https://github.com/the-alchemists-of-arland/kagisearch |
| max_upload_size | |
| id | 1602754 |
| size | 99,065 |
A Rust library that allows you to perform Kagi searches programmatically using chromiumoxide, without consuming additional API credits.
Add kagisearch to your Cargo.toml:
[dependencies]
kagisearch = "0.3"
async-std users should use the async-std-runtime feature:
[dependencies]
kagisearch = { version = "0.3", features = ["async-std-runtime"], default-features = false }
use kagisearch::{AuthType, Kagi};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Initialize the browser with your Kagi token
let kagi = Kagi::new(AuthType::Token("your_token_here".to_string())).await?;
// Perform a search and get up to 5 results
let results = kagi.search("Rust programming language", 5, None).await?;
let Some(results) = results else {
return Err(anyhow::anyhow!("No search results found"));
};
// Print the results
for result in results {
println!("{:?}", result);
}
kagi.close().await?;
Ok(())
}
For more detailed examples and usage instructions, check out:
Contributions are welcome! Feel free to:
Please make sure to update tests as appropriate.
This project is licensed under the Apache License.
While Kagi is an excellent search engine, their API pricing can be cost-prohibitive. This library provides a way to integrate Kagi search functionality into your applications without incurring additional API costs beyond your Professional subscription.