4 releases (2 breaking)
Uses new Rust 2024
0.3.0 | Mar 25, 2025 |
---|---|
0.2.1 | Mar 24, 2025 |
0.2.0 | Mar 24, 2025 |
0.1.0 | Mar 23, 2025 |
#212 in Authentication
270 downloads per month
28KB
414 lines
Kagi Search 🔍
A Rust library that allows you to perform Kagi searches programmatically using chromiumoxide, without consuming additional API credits.
✨ Features
- 💳 No additional API credits required
- 🔐 Supports token-based, F2A-based and cookie-based authentication
- 🕵️ Incognito mode allows you to perform searches without saving your authentication.
📦 Installation
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 }
🚀 Quick Start
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(())
}
📖 Documentation
For more detailed examples and usage instructions, check out:
🤝 Contributing
Contributions are welcome! Feel free to:
- Fork the repository
- Create a new branch for your feature
- Submit a Pull Request
Please make sure to update tests as appropriate.
Credits
⚖️ License
This project is licensed under the Apache License.
📝 Note
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.
Dependencies
~15–30MB
~499K SLoC