kagisearch

Crates.iokagisearch
lib.rskagisearch
version0.3.0
created_at2025-03-23 15:20:03.446366+00
updated_at2025-03-25 15:13:51.167675+00
descriptionA Rust library that allows you to perform Kagi searches programmatically using chromiumoxide, without consuming additional API credits.
homepage
repositoryhttps://github.com/the-alchemists-of-arland/kagisearch
max_upload_size
id1602754
size99,065
Hanchin Hsieh (yuchanns)

documentation

README

Kagi Search 🔍

Behavior Test Crates.io Documentation License

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:

  1. Fork the repository
  2. Create a new branch for your feature
  3. 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.

Commit count: 14

cargo fmt