urlscan-rs

Build Status Crates.io GitHub license Release

Rust wrapper for URLScan.io API

Provides an abstraction over the URLScan.io API. This library supports the following tasks: - [x] Get Quota - [x] Submit URL to be scanned - [x] Get JSON Result of scan as String - [x] Get DOM of previously scanner URL by UUID - [ ] Get Screenshot of page - [ ] Search functionality

Examples

Get your current quota with limits:

rust let client = UrlScanClient::new("YOUR-API-KEY-HERE"); let response = client.get_quota(); match response { Ok(quota) => println!("{}", quota), _ => println!("We got an error..."), }

Submitting a URL to be scanned:

rust let client = UrlScanClient::new(API_KEY); let response = client.scan_url("www.url-you-want-to-check.rust", "public", vec![]); match response { Ok(submission) => println!("{}", submission), _ => println!("We got an error..."), }

Example Output: Submission successful. UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx View Result: https://urlscan.io/result/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/

Getting the DOM:

```rust let client = UrlScanClient::new(API_KEY); // submit a URL to get a "submission" back or directly add the UUID: let uuid = submission.uuid;

let response = client.get_dom(uuid); match response { Ok(dom) => println!("{}", dom), _ => println!("There was an error, maybe scan is still running."), } ```

FAQs

License: MIT