LinkShieldAI Rust SDK
Rust SDK for the LinkShieldAI API at https://api.linkshieldai.com.
The SDK supports basic URL safety checks, detailed checks with screenshot URL and detected tag, screenshot download, NSFW site checks, Chimera AI classification, retry/backoff for transient API failures, and a small command-line tool.
Install
[]
= "0.1"
Authentication
The API uses a query parameter named key.
use LinkShieldAI;
async
Or set LINKSHIELDAI_API_KEY and pass an empty string:
let client = new?;
Methods
let basic = client.basic_check.await?;
let detailed = client.detailed_check.await?;
let nsfw = client.nsfw_check.await?;
let chimera = client.chimera.await?;
let is_malicious = client.is_malicious.await?;
let is_nsfw = client.is_nsfw.await?;
let bytes = client.get_screenshot.await?;
The API field "screenshot url" is normalized to screenshot_url.
Options
use Duration;
use LinkShieldAI;
let client = builder
.api_key
.base_url
.timeout
.max_retries
.backoff_factor
.build?;
By default the SDK uses:
timeout: 10 secondsmax_retries: 2backoff_factor: 500 ms
Retries are applied to temporary connection failures and HTTP 429, 502, 503, and 504.
CLI
You can omit --api-key if LINKSHIELDAI_API_KEY is set.
Errors
match error
Raw API payloads are preserved on result structs through raw.
Keep API keys server-side.