https://github.com/marirs/phishtank-rs
Phishtank API
https://github.com/marirs/phishtank-rs
phishtank phishtank-api rust rust-crate rust-lang rust-library
Last synced: 8 months ago
JSON representation
Phishtank API
- Host: GitHub
- URL: https://github.com/marirs/phishtank-rs
- Owner: marirs
- License: mit
- Created: 2021-06-20T11:07:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-06-20T16:29:31.000Z (over 4 years ago)
- Last Synced: 2025-02-02T11:33:49.014Z (8 months ago)
- Topics: phishtank, phishtank-api, rust, rust-crate, rust-lang, rust-library
- Language: Rust
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Phishtank API


[](https://travis-ci.com/marirs/phishtank-rs)Phishtank API gives access to phishtank to download the phishtank database or lookup for a url in phishtank database.
## Usage
```toml
[dependencies]
phishtank = "0.1.0"
```
and then
```rust
use phishtank::PhishtankClient;// Download the Phishtank Database
fn main() {
let api_key = match std::env::args().nth(1).ok_or("Please provide the api key!") {
Ok(api_key) => api_key,
Err(e) => {
println!("{:?}", e);
std::process::exit(1)
}
};let limit = 5;
let res = PhishtankClient::new(&api_key)
.user_agent("phishtank/[username]")
.download_db();
match res {
Ok(data) => {
for d in data.iter().take(limit) {
println!("{:#?}", d)
}
println!("Showing {} out of {}", limit, data.len())
}
Err(e) => println!("Error: {:?}", e.to_string()),
}
}
```## Examples
- To download the database: `cargo run --example get_database `
- To check url in phishtank database: `cargo run --example lookup `## Developer reference
- https://www.phishtank.com/developer_info.php
---
License: MIT