Skip to main content

Crate screenshotfreeapi

Crate screenshotfreeapi 

Source
Expand description

§screenshotfreeapi

Official Rust client for the ScreenshotFreeAPI — a production-grade Screenshot-as-a-Service platform.

§Quick start

Add to Cargo.toml:

[dependencies]
screenshotfreeapi = "1"
tokio = { version = "1", features = ["full"] }
use screenshotfreeapi::ScreenshotFreeAPIClient;

#[tokio::main]
async fn main() -> screenshotfreeapi::Result<()> {
    let client = ScreenshotFreeAPIClient::new("sfa_your_api_key");
    let result = client.capture("https://stripe.com").await?;
    println!("{}", result.screenshots[0].url);
    Ok(())
}

§Resources

Access each group of endpoints through the corresponding field on ScreenshotFreeAPIClient:

  • client.auth — account registration and JWT management
  • client.screenshots — enqueue web, mobile, and HTML captures
  • client.jobs — poll status, fetch results
  • client.billing — plans, usage, upgrades
  • client.workspaces — team workspaces and member management
  • client.monitors — scheduled app-capture monitors
  • client.integrations — Zapier REST Hooks

§Webhook verification

use screenshotfreeapi::verify_webhook_signature;

let body = br#"{"jobId":"abc","status":"completed"}"#;
let sig = "the-value-of-X-ScreenshotFree-Signature-header";
let secret = "your_webhook_secret";

if verify_webhook_signature(body, sig, secret).is_ok() {
    // safe to process
}

Re-exports§

pub use resources::screenshots::WaitOptions;

Modules§

resources

Structs§

AppMonitor
A scheduled app-capture monitor.
BillingUsage
Daily usage history from GET /billing/usage.
CancelResponse
Response from DELETE /billing/cancel.
CreateMonitorRequest
Request body for POST /monitors/app.
CreateWorkspaceRequest
Request body for POST /workspaces.
CurrentPlan
Current subscription and quota summary from GET /billing/plan.
DailyUsage
Usage count for a single calendar day.
Dimensions
Viewport dimensions in pixels.
EnqueueResponse
Response from any POST /screenshots/* endpoint (HTTP 202).
HealthResponse
Response from GET /health.
HtmlScreenshotOptions
Options for POST /screenshots/html.
InviteRequest
Request body for POST /workspaces/:id/invite.
JobResult
Full result returned by GET /jobs/:id/result once a job is completed.
JobStatusResponse
Response from GET /jobs/:id/status.
Metadata
Processing metadata attached to every JobResult.
MobileScreenshotOptions
Options for POST /screenshots/mobile.
MonitorHistory
An individual run entry in a monitor’s history.
Plan
A subscription plan tier returned by GET /billing/plans.
RefreshRequest
Request body for POST /auth/refresh.
RefreshResponse
Response from POST /auth/refresh.
RegisterRequest
Request body for POST /auth/register.
RegisterResponse
Response from POST /auth/register.
Screenshot
A single captured screenshot within a JobResult.
ScreenshotFreeAPIClient
The main entry point for the ScreenshotFreeAPI Rust client.
TokenRequest
Request body for POST /auth/token (password grant).
TokenResponse
Response from POST /auth/token.
UpdateRoleRequest
Request body for PUT /workspaces/:id/members/:userId.
UpgradeRequest
Request body for POST /billing/upgrade.
UpgradeResponse
Response from POST /billing/upgrade.
VerifyResponse
Response from POST /billing/verify.
WebScreenshotOptions
Options for POST /screenshots/web.
Workspace
A team workspace.
WorkspaceActionResponse
Generic success/message response for workspace mutations.
WorkspaceDetail
Response listing workspaces with their members.
WorkspaceMember
A member of a workspace.
ZapierSubscribeRequest
Request body for POST /integrations/zapier/subscribe.
ZapierSubscribeResponse
Response from POST /integrations/zapier/subscribe.
ZapierTriggerSample
Sample trigger payload returned by GET /integrations/zapier/triggers/:event.
ZapierUnsubscribeResponse
Response from DELETE /integrations/zapier/unsubscribe/:id.

Enums§

ScreenshotFreeAPIError
All errors that can be returned by the ScreenshotFreeAPI client.

Functions§

verify_webhook_signature
Verify the X-ScreenshotFree-Signature header value against a raw request body.

Type Aliases§

Result
Convenience alias used throughout this crate.