Rust SDK for the antidetect browser
The Rust library ships the browser engine and the fingerprint library and runs without the desktop app. Use it inside a scraper, a CI job or a server-side worker.
Install
cargo add shardxQuick start
// cargo add shardx (illustrative; see the crate readme)
use shardx::{LaunchOptions, ShardX, ShardXOptions};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let sdk = ShardX::new(ShardXOptions::default())?;
let profile = sdk.create_profile(Some("win-rtx4060")).await?;
let session = sdk.session(profile, LaunchOptions {
proxy: Some("socks5://user:pass@host:1080".into()),
..Default::default()
}).await?;
let page = session
.new_page("https://browserleaks.com/quic")
.await?;
println!("{:?}", page.get_title().await?);
session.close().await
}What the SDK does for you
- Downloads the engine and the 220-profile library on first use and caches them by ETag.
- Probes the proxy for UDP support and turns QUIC on or off accordingly.
- Resolves timezone, locale and geolocation from the proxy exit country before launch.
- Randomizes CPU, RAM and platform version once per saved profile so hardware stays coherent.
The Rust crate has the same surface as the Python and Node SDKs: on first use it downloads the engine, the Widevine CDM and the bundled fingerprint library into a per-user cache, then launches isolated profiles with the same spoofing flags the desktop app uses.
With the default control feature, session() launches the engine and attaches a chromiumoxide CDP browser in one call. Disable the feature for a lighter build and use launch_cdp to get a cdp_url for your own client. Supported hosts are macOS arm64, Windows x64 and Linux x64.