https://github.com/myomikron/dehashed-rs
A rust library for the dehashed API
https://github.com/myomikron/dehashed-rs
api async dehashed dehashed-api rust sdk
Last synced: 3 months ago
JSON representation
A rust library for the dehashed API
- Host: GitHub
- URL: https://github.com/myomikron/dehashed-rs
- Owner: myOmikron
- License: mpl-2.0
- Created: 2023-08-01T18:14:50.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-14T00:56:13.000Z (about 1 year ago)
- Last Synced: 2025-10-04T08:29:05.211Z (8 months ago)
- Topics: api, async, dehashed, dehashed-api, rust, sdk
- Language: Rust
- Homepage:
- Size: 61.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# dehashed-rs
[](LICENSE)
[](https://deps.rs/repo/github/myOmikron/dehashed-rs)
[](https://github.com/myOmikron/dehashed-rs/actions/workflows/linux.yml)
[](https://docs.rs/dehashed-rs/latest/)
This is an SDK for the [dehashed](https://dehashed.com/) api.
## Usage
```rs
use dehashed_rs::*;
let email = "test@example.com".to_string();
let api_key = "".to_string();
// Create an api instance
let api = DehashedApi::new(email, api_key).unwrap();
// Query for the domain example.com
if let Ok(res) = api
.search(Query::Domain(SearchType::Simple("example.com".to_string())))
.await
{
println!("{res:?}");
}
```
or if you enable the `tokio` feature, you can utilize the scheduler to abstract
away the need to manage get past the rate limit:
```rs
use dehashed_rs::*;
use tokio::sync::oneshot;
let email = "test@example.com".to_string();
let api_key = "".to_string();
// Create an api instance
let api = DehashedApi::new(email, api_key).unwrap();
// Create the scheduler
let scheduler = api.start_scheduler();
let tx = scheduler.retrieve_sender();
let (ret_tx, ret_rx) = oneshot::channel();
// Schedule a query for the email "test@example.com"
tx.send(ScheduledRequest::new(
Query::Email(SearchType::Simple("test@example.com".to_string())),
ret_tx,
))
.await
.unwrap();
// Retrieve the result
if let Ok(res) = ret_rx.await {
println!("{res:?}");
}
```
If you need type definitions for utoipa, there available under the feature flag `utoipa`.
## Note
**This is not an official API**