2 stable releases

Uses new Rust 2024

new 1.0.1 May 6, 2025

#94 in #api-client

MIT license

14KB
63 lines

πŸ” shodan-rust

An async-native Rust client for the Shodan.io API.

License Rust Build

shodan-rust is a lightweight and modern Rust crate for accessing Shodan's powerful search capabilities over the internet of things.


✨ Features

  • βœ… Native async support using reqwest and tokio
  • πŸ” Easy API key integration
  • 🌍 Search IP addresses, services, ports
  • 🧠 Clean and extensible design for future Shodan endpoints
  • πŸ“ Includes examples in /examples directory

πŸš€ Usage

Add to your Cargo.toml

[dependencies]
shodan = { git = "https://github.com/YOUR_USERNAME/shodan-rust" }
tokio = { version = "1", features = ["full"] }

Example

use shodan::ShodanClient;

#[tokio::main]
async fn main() {
    let client = ShodanClient::new("YOUR_SHODAN_API_KEY");

    match client.host_info("8.8.8.8").await {
        Ok(info) => println!("{:#?}", info),
        Err(e) => eprintln!("Error: {}", e),
    }
}

πŸ“Ž Check the examples/ folder for more real-world usage.


πŸ§ͺ Testing

export SHODAN_API_KEY=your_key_here
cargo test

πŸ“Œ Roadmap

  • IP Lookup
  • Honeyscore (Shodan Addon)
  • Search Query
  • Hostnames & DNS Resolve
  • Error handling improvements

🀝 Contributing

PRs, ideas and bug reports are welcome.
Want to extend the library or implement more endpoints? Let’s build it together!


πŸ“„ License

Licensed under the MIT License.
Not affiliated with Shodan.io β€” this is a community-built Rust library.

Dependencies

~6–20MB
~255K SLoC