ScreenshotNeo

BlogHow-to

How to Name and Organize Files from Scheduled Website Screenshots

Use site folders, stable capture labels, and UTC timestamps to keep scheduled screenshots searchable and distinct from visual regression baselines.

By the ScreenshotNeo team4 October 20268 min read

Organize scheduled website screenshots by site, then page or capture purpose, and give each file a sortable timestamp in UTC. For example: screenshots/example-com/homepage/2026-10-03T22-00-00Z.png. Keep labels, viewport dimensions, capture scope, and format stable between runs. Treat a historical archive separately from visual regression baselines, which should stay tied to their test and rendering environment.

1. Choose a folder structure and filename

A site-first hierarchy makes it easy to find the history for one website. Use normalized, filename-safe site identifiers and descriptive page names rather than repeating a generic name such as screenshot.png.

screenshots/
  example-com/
    homepage/
      2026-10-03T22-00-00Z.png
    pricing/
      2026-10-03T22-00-00Z.png
    homepage-mobile/
      2026-10-03T22-00-00Z.png

If your workflow handles one flat directory more easily, put the same information in the filename:

example-com_homepage_desktop_2026-10-03T22-00-00Z.png
example-com_homepage_mobile_2026-10-03T22-00-00Z.png

Use year-month-day order so names sort chronologically as text. Include a timezone marker. UTC (Z) is a practical shared choice for scheduled jobs and distributed teams. Colons are valid in many environments but awkward in some portable filenames, so the examples use hyphens for the time portion.

2. Decide what each capture represents

A name is useful only if the capture definition stays consistent. Choose labels for the page or purpose and for any configuration that creates a meaningfully different image:

  • Page or purpose: homepage, pricing, header, or checkout.
  • Viewport or device: desktop, mobile, or a named device preset.
  • Capture scope: viewport or full-page if both are collected.
  • Environment: browser and platform or project when comparing visual output across environments.

Do not change viewport dimensions or switch between viewport and full-page capture without changing the capture definition or label. Otherwise, a changed image may reflect a different capture setup rather than a website change. Playwright supports saving screenshots to a chosen path and capturing the full scrollable page; make the scope choice stable for a collection. Playwright screenshot documentation

3. Build a scheduled archive with Playwright

The following runnable Node.js example uses Playwright to capture a page and save it under a site/page folder with a UTC timestamp. It retains each run rather than overwriting earlier captures.

import { chromium } from 'playwright';
import { mkdir } from 'node:fs/promises';

const target = new URL(process.argv[2] ?? 'https://example.com');
const site = target.hostname.toLowerCase().replaceAll('.', '-');
const pageLabel = 'homepage';
const outputDir = `screenshots/${site}/${pageLabel}`;
const stamp = new Date().toISOString().replaceAll(':', '-');
const outputPath = `${outputDir}/${stamp}.png`;

await mkdir(outputDir, { recursive: true });
const browser = await chromium.launch({ headless: true });
try {
  const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
  await page.goto(target.href, { waitUntil: 'networkidle', timeout: 60_000 });
  await page.screenshot({ path: outputPath, fullPage: true });
  console.log(outputPath);
} finally {
  await browser.close();
}

Install the dependencies and run it:

npm install playwright
npx playwright install chromium
node capture.mjs https://example.com

For scheduled use, run the script from a known working directory or resolve the output directory against an explicit archive root. The example uses networkidle; pages with persistent network activity may never reach that state, so choose an appropriate readiness condition for the site, such as waiting for a specific selector or using a bounded delay when justified.

Timestamp details and duplicate runs

toISOString() produces a UTC timestamp. Replacing colons makes the filename more portable. If the scheduler can start overlapping jobs or rerun the same scheduled instant, add a unique run identifier or milliseconds rather than silently reusing a path. Keep a separate latest.png pointer only if consumers need it; retain timestamped files as the archive.

4. Keep visual regression baselines separate

A scheduled archive records what a page looked like over time. A visual regression baseline is an expected image associated with a test. Store and name baselines according to the test runner’s snapshot structure, and record the browser and platform or project that produced them. Rendering can vary with operating system, browser version, settings, hardware, power source, and headless mode, so comparisons are most useful when the environment stays consistent. Playwright visual comparisons documentation

Playwright Test supports configuring snapshot paths and includes browser/platform information in its examples. Avoid mixing those expected snapshots into an undifferentiated historical archive; the archive answers “what did the page look like on this date?” while a baseline answers “what image does this test expect in this environment?”

5. Choose retention, format, and metadata

Decision Practical default When to vary it
Folder order Site, then page or purpose Date-first can suit run-based audits across many sites.
History Keep a timestamped file per run Maintain a separate latest copy for workflows that need a stable path.
Image format PNG is a straightforward default Choose another supported format when storage or downstream requirements call for it, and keep it consistent.
Scope Choose viewport or full page per collection Use separate labels and stable settings if both are needed.
Environment Omit from archive names when it adds no value Include browser/platform/project for comparisons sensitive to rendering.

Playwright CLI documents PNG as the default screenshot format and also supports JPEG and WebP. It uses a timestamp-based default name when no explicit filename is given, and accepts a custom filename. For reproducible archives, explicit paths make the intended naming scheme visible in the automation. Playwright CLI documentation

Do not encode every property in a long filename. Keep stable fields in directories, changing fields such as time in the filename, and put additional metadata in a sidecar manifest or index if your workflow needs it. A manifest is a practical convention rather than a Playwright-prescribed format.

6. Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One GET request returns an image or PDF. See the API documentation for parameters, including cache controls and the usage API.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await import('node:fs/promises').then(({ writeFile }) => writeFile('shot.webp', Buffer.from(await res.arrayBuffer())));

These examples show a single capture; your scheduler still needs to choose a destination path and timestamp each output. ScreenshotNeo can return PNG, JPEG, WebP, or PDF, and supports full-page screenshots, custom viewport/device settings, and cache TTL configuration. Cookie banners, newsletter popups, and chat widgets are removed before the shot; each cleanup step can be disabled. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents.

The free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 screenshots; yearly billing gives two months free, and every feature is on every plan. Sign up for 1,000 free screenshots a month, with no card required.

7. Troubleshooting scheduled screenshot archives

Symptom Likely cause Fix
A capture overwrites an earlier file The output path is fixed or two runs share the same timestamp precision. Include a timestamp and, for overlapping or retried jobs, a unique run identifier or finer timestamp precision.
Files are difficult to sort Names use locale dates such as month/day/year or omit timezone. Use year-month-day and one documented timezone, preferably UTC for a shared archive.
Images differ unexpectedly Viewport, page scope, browser, platform, or rendering settings changed. Keep capture configuration stable; include environment labels when comparing across environments.
Capture script cannot create files The scheduler runs from a different working directory or its account lacks write access. Use an explicit archive root, create directories recursively, and ensure the scheduled process can write there.
Navigation times out waiting for network idle The site keeps network requests open or does not settle. Use a site-specific readiness selector or a bounded wait strategy, and keep the chosen rule consistent across runs.
Archive grows without bound Every run is retained without a retention policy. Choose a retention period or storage lifecycle policy appropriate to the archive; keep any required baselines separately.

8. Reliability, performance, and cost considerations

  • Reliability: Create the destination directory before capture, close the browser in a finally block, use explicit paths, and make failures visible to the scheduler. Avoid treating a timed-out or failed navigation as a valid archive image.
  • Performance: Full-page captures can require more page rendering and produce larger files than viewport captures. Capture only the scope and variants that answer the archive’s purpose. Avoid unnecessary duplicate desktop/mobile or environment combinations.
  • Storage cost: PNG, JPEG, and WebP have different characteristics, but the cited documentation does not establish a universal best archival format. Choose based on fidelity, file size, and downstream use, then keep it stable.
  • Service cost: A self-hosted Playwright archive uses your own compute and storage. For ScreenshotNeo, the stated plans are 1,000 free captures monthly with no card, then $5 for 3,000, $15 for 15,000, $39 for 60,000, $99 for 250,000, and $249 for 1,000,000; yearly billing gives two months free. Every feature is on every plan.

9. Quick checklist

  • Normalize each site identifier and choose stable page/purpose labels.
  • Use sortable year-month-day timestamps with an explicit timezone.
  • Choose whether to keep every run or maintain a separate latest copy.
  • Keep format, viewport, and viewport/full-page scope consistent within a collection.
  • Record browser and platform/project for visual comparisons when rendering differences matter.
  • Check the scheduler’s working directory, write permissions, and behavior on retries or overlapping runs.
  • Set a retention policy if the archive is long-running.

10. FAQ

Should the date go in the folder or the filename?

For a site history, keep the site and page in folders and put the changing capture time in the filename. A date-first structure can be useful when each scheduled run is reviewed as a batch.

Should I save a “latest” screenshot?

Only if a consumer needs a stable path. Keep it separate from timestamped history so updating it does not erase the archive.

Do I need browser and operating system in every archive filename?

No. Include environment identity when rendering comparisons depend on it, especially for test baselines. For a simple historical record from one fixed capture environment, a stable folder or manifest may be enough.

Is full-page capture always better?

No. Viewport captures are often a better fit for a fixed visual checkpoint; full-page captures cover more content. Decide based on what the archive is meant to show and keep that choice consistent.