Batch Automation
Generate multiple screenshots from files, scripts, manifests, or CI jobs.
Batch automation is for image sets: docs refreshes, directory thumbnails, changelog images, store screenshots, and social campaigns.
CLI batch
Create a URL file:
txthttps://example.comhttps://example.com/pricinghttps://example.com/docs
Run:
bashscreenframed batch urls.txt \ --device browser-macos \ --background midnight \ --format webp \ --out-dir screenshots
API manifest loop
javascriptconst jobs = [ { name: "home", url: "https://example.com" }, { name: "pricing", url: "https://example.com/pricing" }, { name: "docs", url: "https://example.com/docs" },];for (const job of jobs) { const response = await fetch("https://screenframed.com/v1/capture", { method: "POST", headers: { Authorization: `Bearer ${process.env.SCREENFRAMED_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ url: job.url, device: "browser-macos", background_preset: "midnight", shadow: "soft", async: true, }), }); const queued = await response.json(); console.log(job.name, queued.job_id);}
CI guidance
Do
Use manifests
Keep capture inputs in versioned JSON so changes are reviewable.
Avoid
Scrape links from production blindly
Curated screenshot sets produce more stable assets than crawling arbitrary pages.
Retry and backoff
For batch jobs:
- Queue with
async: true. - Persist each
job_id. - Poll
/v1/jobs/{id}with backoff. - Retry only failed jobs after inspecting the error.
- Store the final CDN URLs in your asset manifest.
Local watch mode
Use watch mode while developing a page:
bashscreenframed watch http://localhost:3000 \ --device browser-macos \ --background arctic \ --output preview.png \ --interval 5