A synchronous, type-safe Rust SDK for the S.EE API, including short URLs, text and file sharing, QR codes, bio pages, tags, domains, token validation, and usage statistics.
see-sdk provides blocking APIs built on reqwest. Requests and responses follow the public Swagger schema, including paginated histories and resumable TUS uploads for files up to 5 GB.
- 🚀 Clean & Intuitive - Fluent API design that's easy to understand and use
- 🔒 Type-Safe - Complete type checking and error handling
- ⚙️ Flexible Configuration - Custom API endpoint, timeout, API key, and user agent
- 📁 Multi-Format Support - URL, text, regular file, large file, QR code, and bio page operations
- 🏷️ API Coverage - Histories, tags, domains, usage, private downloads, and token validation
- 📦 Lightweight Dependencies - Minimal dependencies for fast compilation
- ✅ Well-Tested - Comprehensive unit tests and documentation
Add this to your Cargo.toml:
[dependencies]
see-sdk = "1.4.0"And then run cargo build to download and compile the crate. For the latest version, check out the crates.io page.
For comprehensive usage examples covering all features, please refer to the examples/ directory in this repository.
Available examples include:
- basic.rs: Basic URL shortening operations
- advanced.rs: Advanced features like custom aliases and expiration
- files.rs: File upload and management operations
- text.rs: Text sharing and pastebin functionality
- batch.rs: Batch processing capabilities
You can run any example using cargo:
# Export your API key first
export SEE_API_KEY="your-api-key"
# Run a specific example
cargo run --example basicImport the trait for the API group you want to call:
| API group | Trait | Module |
|---|---|---|
| Short URLs, history, visit statistics, usage | ShortenService |
see_sdk::url |
| Text sharing and history | TextService |
see_sdk::text |
| Files, private downloads, large files, TUS | FileService |
see_sdk::file |
| QR codes and history | QrcodeService |
see_sdk::qrcode |
| Bio pages and history | BioPageService |
see_sdk::bio |
| Token validation | TokenService |
see_sdk::token |
| Tags | TagService |
see_sdk::tag |
| Short URL domains | DomainService |
see_sdk::domain |
use see_sdk::client::Client;
use see_sdk::config::Config;
use see_sdk::qrcode::{CreateQrcodeRequest, QrcodeService};
let client = Client::new(Config::default().with_api_key("your-api-key"))?;
let response = client.create_qrcode(CreateQrcodeRequest {
target_url: "https://example.com".into(),
title: "Example".into(),
custom_slug: None,
domain: None,
})?;
println!("{}", response.data.png_url);
# Ok::<(), see_sdk::error::Error>(())Large files use the TUS 1.0 workflow exposed by FileService:
- Call
create_large_file_uploadwith the filename and byte size. - If
fast_uploadistrue, useexisting_file; no bytes need to be sent. - Otherwise call
get_tus_upload_offset, then send chunks withupload_tus_chunk. - Call
complete_large_file_uploadafter the server offset reaches the file size. - Use
cancel_large_file_uploadordelete_tus_uploadto abandon an upload.
The SDK supplies Tus-Resumable, Upload-Offset, and the TUS content type. Chunk sizing and file reading remain under application control.
Run the test suite:
# Run deterministic unit tests and compile all targets
cargo test --all-targets --all-features --locked
# Run ignored integration tests against the live API
export SEE_API_KEY="your-api-key"
cargo test --lib --locked -- --ignored --test-threads=1Live API tests create and delete remote resources. They are ignored by default and run only
through the manually dispatched CI workflow when live-api-tests is enabled.
Build examples:
cargo build --examplesThis project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! If you find bugs or have feature suggestions, please submit an Issue or Pull Request.