https://github.com/safelyx/safelyx-rust
Rust Client for Safelyx's API. 💪
https://github.com/safelyx/safelyx-rust
content-moderation moderation rust rust-crate security security-tools
Last synced: 7 months ago
JSON representation
Rust Client for Safelyx's API. 💪
- Host: GitHub
- URL: https://github.com/safelyx/safelyx-rust
- Owner: safelyx
- License: mit
- Created: 2025-03-07T09:28:38.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-07T09:39:42.000Z (7 months ago)
- Last Synced: 2025-03-07T09:45:20.364Z (7 months ago)
- Topics: content-moderation, moderation, rust, rust-crate, security, security-tools
- Language: Rust
- Homepage: https://safelyx.com/safe-api
- Size: 0 Bytes
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Safelyx API
[](https://github.com/safelyx/safelyx-rust/actions?workflow=Run+Tests) [](https://crates.io/crates/safelyx)
> Safelyx API client
Safelyx API client for Rust.
You can find the API documentation at https://safelyx.com/safe-api.
### Some things to note:
1. It's simply making an HTTP request to the Safelyx API.
2. It's using the `reqwest` library to make the HTTP request.
3. If the request to the API fails, it will return a `Result` with an error, so you can handle it using Rust's error handling patterns.
## Usage
It has a method per API endpoint.
### Rust
```rust
use safelyx;fn main() {
let check_result = safelyx::check_link("https://example.com", "your-key-code")
.expect("Failed to check link");println!("{}", check_result.result); // Outputs a safety score between 0 (unsafe) and 10 (safe). -1 if there was an error, -2 if there are no checks remaining.
}
```### Installation
Add this to your `Cargo.toml`:
```toml
[dependencies]
safelyx = "0.1"
```## Development
Requires [Rust](https://rust-lang.org) 1.70+.
```bash
make install
make format
make test
```## Publishing
After committing and pushing with a new version in `Cargo.toml`, just run:
```bash
make publish
```