| Crates.io | screenshotbase-sdk |
| lib.rs | screenshotbase-sdk |
| version | 0.1.0 |
| created_at | 2025-11-10 11:05:33.107951+00 |
| updated_at | 2025-11-10 11:05:33.107951+00 |
| description | Rust client for the screenshotbase.com API (status and website rendering). |
| homepage | https://screenshotbase.com |
| repository | https://github.com/everapihq/screenshotbase-rust |
| max_upload_size | |
| id | 1925158 |
| size | 60,838 |
Rust client for the screenshotbase.com API to:
API docs: https://screenshotbase.com/docs/
Register API key: https://screenshotbase.com
reqwestblocking featurebase_url (defaults to https://api.screenshotbase.com)X-API-Key header and api_key query param[dependencies]
screenshotbase-sdk = "0.1.0"
Or from your own registry/workspace as desired.
Enable blocking client:
[dependencies]
screenshotbase-sdk = { version = "0.1.0", features = ["blocking"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let api_key = std::env::var("SCREENSHOTBASE_API_KEY")?;
let client = screenshotbase_sdk::client::ScreenshotbaseClient::new(api_key)?;
// Status
let status = client.get_status().await?;
println!("Plan: {:?}, Quota used: {:?}", status.plan, status.quota_used);
// Take website screenshot
let result = client
.take_screenshot(
"https://example.com",
screenshotbase_sdk::types::RenderOptions {
format: Some(screenshotbase_sdk::types::ImageFormat::Png),
full_page: Some(true),
width: Some(1280),
height: Some(800),
..Default::default()
},
)
.await?;
println!("Content-Type: {:?}", result.content_type);
println!("Received {} bytes", result.bytes.len());
Ok(())
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
#[cfg(feature = "blocking")]
{
let api_key = std::env::var("SCREENSHOTBASE_API_KEY")?;
let client = screenshotbase_sdk::client::ScreenshotbaseBlockingClient::new(api_key)?;
let status = client.get_status()?;
println!("Plan: {:?}", status.plan);
let _result = client.take_screenshot("https://example.com", screenshotbase_sdk::types::RenderOptions::default())?;
}
Ok(())
}
GET /v1/statusGET /v1/take?url=... with additional query parameters from RenderOptionshttps://api.screenshotbase.com; override with .with_base_url(...) if necessary.X-API-Key header and also appends api_key as a query parameter for compatibility.Refer to the official docs for details and the latest parameters: https://screenshotbase.com/docs/
MIT