https://github.com/ix76y/urlscan-rs
Rust wrapper for URLScan.io API
https://github.com/ix76y/urlscan-rs
api rust rust-lang rust-library urlscan-api urlscan-io
Last synced: 3 months ago
JSON representation
Rust wrapper for URLScan.io API
- Host: GitHub
- URL: https://github.com/ix76y/urlscan-rs
- Owner: Ix76y
- License: mit
- Created: 2022-10-30T17:14:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-21T17:20:12.000Z (about 1 year ago)
- Last Synced: 2025-03-31T21:14:54.248Z (3 months ago)
- Topics: api, rust, rust-lang, rust-library, urlscan-api, urlscan-io
- Language: Rust
- Homepage:
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# urlscan-rs
[](https://github.com/Ix76y/urlscan-rs/actions/workflows/rust.yml)

[](https://github.com/Ix76y/urlscan-rs/blob/main/LICENSE)
## 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
- [x] Get Screenshot of page
- [x] 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."),
}
```### Searching Scans:
```rust
let client = UrlScanClient::new(API_KEY);
let response = client.search_scans("domain:urlscan.io", Some(2));
match response {
Ok(result) => println!("{}", result),
_ => println!("Something went wrong :("),
}
```## FAQs
- How do I get a URLScan.io API Key?
Create an URLScan.io account and then go to [Settings & API](https://urlscan.io/user/profile/) to get your API key.
- Is the URLScan.io API key free? Yes, URLScan.io has free API keys that are limited by time. If you reach the limit you can pay for unlimited requests.**License**: MIT