Add the Maven dependency
com.snapshotflow:snapshotflow-java:1.0.0 supports Java 11+, works with Maven and Gradle, and needs no Selenium, WebDriver, or local browser.
com.snapshotflow:snapshotflow-java:1.0.0
What shipped
The Java SDK brings the full SnapshotFlow API to Java 11+ with typed builders and result objects. It works with Maven or Gradle from Java, Kotlin, Scala, and Groovy, while browser rendering stays on the SnapshotFlow backend.
- Capture output: PNG, JPEG, WebP, PDF, JSON with extracted content, or a hosted URL.
- Production workflows: batches, visual regression diffs, async jobs, polling, and signed webhooks.
- No browser dependency: no Selenium, ChromeDriver, Playwright, or local Chromium process to manage.
Main methods
| Method | What it does |
|---|---|
take, takeJson, takeUrl | Return binary output, structured JSON, or a hosted download URL. |
batch | Capture up to 10 URLs with shared settings. |
diff | Compare two URLs and return change statistics with a diff image. |
takeAsync, getJob, waitForJob | Run long captures without blocking and poll their status. |
health, verifyWebhook | Check service health and verify webhook signatures. |
Minimal screenshot
SnapshotFlow client = SnapshotFlow.builder()
.apiKey(System.getenv("SNAPSHOTFLOW_API_KEY"))
.build();
ScreenshotResult shot = client.take(
TakeOptions.url("https://example.com")
.fullPage(true)
);
shot.save(Path.of("example.png"));