Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Direct answer: You can capture a rendered website from a terminal in three ways: call a hosted screenshot API with curl, use a vendor CLI such as Urlbox, or run a browser you control with Playwright. Choose the capture mode first—viewport, full page, or one element—then configure authentication, page-loading waits, output format, and CI secret storage. For a managed workflow, ScreenshotNeo is the first service to try because it removes consent banners, popups and chat widgets before capture, bills only clean shots, and has a free tier.

Choose the command-line approach

A shell script only needs an executable command and a file on disk, but the work behind that command differs substantially.

Approach What you operate Best fit Important trade-off
Managed API called with curl or an SDK An HTTPS request; the provider runs the browser Scheduled jobs, CI, batch captures and applications in any language You depend on the provider’s regions, browser version, limits and pricing
Vendor CLI A command that wraps a hosted API Readable scripts and local experimentation CLI syntax and authentication can change independently of your script
Playwright CLI or code Your browser binaries, runtime and automation environment Workflows requiring login, clicks, assertions or custom browser logic You maintain browsers, dependencies, sandboxing and resource usage

There is no documented universal winner for speed, cost or reliability. Measure the pages, volume, geography and service plans that matter to you.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Define the screenshot you actually need

Viewport capture

A viewport image records the visible area at a chosen width, height and device scale. It is suitable for visual smoke tests, social previews and monitoring a fixed responsive breakpoint.

Full-page capture

Full-page mode renders the entire scrollable document. Long pages and pages that load content only after scrolling may require explicit scroll behavior. Browserless documents scrollPage: true to trigger lazy-loaded content before a full-page capture.

Element or clipped capture

Capture one CSS-selected element when a page contains a chart, invoice, card or component you need without surrounding navigation. APIs may call this a selector or a clip rectangle; verify whether the selector is top-level and whether the element must be visible first.

Output and rendering controls

  • Format: PNG preserves lossless detail; JPEG is smaller for photographic pages; WebP often provides a useful size/quality balance.
  • Viewport and device scale: Set both explicitly for reproducible results. A retina scale increases pixel dimensions and file size.
  • Quality: JPEG and WebP quality settings affect storage and visual diffs.
  • Waiting: Wait for a selector, a fixed delay or network idle when fonts, charts or client-rendered content are not ready at first paint.
  • Page state: Cookies, headers, user agents, timezone, geolocation, JavaScript and custom CSS can change what is rendered.

Managed option #1: ScreenshotNeo

ScreenshotNeo is a website screenshot API and MCP server. A GET request returns PNG, JPEG, WebP or PDF. Before capture it accepts cookie/consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers report the page verdict and billing result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

It supports full-page captures with lazy images loaded, CSS-selector element shots, dark mode, 12 device presets plus custom viewports, retina scale, PDF paper and page controls, HTML/CSS rendering, custom JavaScript and CSS, pre-capture clicks, hidden selectors, selector/delay/network-idle waits, request and resource blocking, headers, cookies, user agents, Authorization, timezone, geolocation, transparent backgrounds, resizing, selectable-TTL caching, signed links, asynchronous jobs with signed webhooks, 100-URL bulk calls, a usage API and an OpenAPI specification. Common parameter names used by other screenshot APIs also work.

Every feature is included on every plan: Free allows 1,000 shots per month with no card; Starter is $5 for 3,000; Growth $15 for 15,000; Pro $39 for 60,000; Scale $99 for 250,000; and Business $249 for 1,000,000. Yearly billing gives two months free.

One-call terminal example

Get an API key, replace the target URL, and save the binary response. The complete parameter reference is in the ScreenshotNeo documentation.

curl -G "https://api.screenshotneo.com/v1/shot" 
  -d access_key=YOUR_API_KEY 
  --data-urlencode url=https://stripe.com 
  -o shot.webp

For a production script, keep the key in an environment variable rather than committing it:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
export SCREENSHOTNEO_KEY='replace-me'
curl -f -G "https://api.screenshotneo.com/v1/shot" 
  -d access_key="$SCREENSHOTNEO_KEY" 
  --data-urlencode url="https://example.com" 
  -o shot.webp

Urlbox CLI

Urlbox documents an npm-installed CLI that authenticates with urlbox login and captures a page with:

npm install -g @urlbox/cli
urlbox login
urlbox screenshot https://urlbox.com --output hello.png

Use --full-page for the whole scrolling page. The rendering documentation also describes format options, --dry-run for inspecting a request, and --curl for generating a curl equivalent. Authentication and exact flags are volatile, so consult the current CLI overview, quickstart and rendering reference before pinning commands in CI.

For CI, Urlbox documents the URLBOX_API_SECRET environment variable. Store it in your CI secret manager and expose it only to the capture job.

Browserless Screenshot API

Browserless exposes a hosted POST /screenshot endpoint authenticated with an account token. The request includes the URL and screenshot options; the response is an image. Its documented controls include PNG, JPEG and WebP, full-page mode, viewport and device scale, clipping, a top-level element selector and scrollPage: true for lazy-loaded content.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -X POST "https://chrome.browserless.io/screenshot?token=YOUR_TOKEN" 
  -H "Content-Type: application/json" 
  --data '{"url":"https://example.com","options":{"fullPage":true,"scrollPage":true}}' 
  -o page.png

Check the current endpoint and JSON shape in the Browserless screenshot API documentation; hosted API contracts can change.

ScreenshotOne over HTTPS

ScreenshotOne accepts GET or POST requests, authenticates with an access key and documents additional capture options. A GET request is convenient from a shell:

curl -G "https://api.screenshotone.com/take" 
  -d access_key=YOUR_ACCESS_KEY 
  --data-urlencode url=https://example.com 
  -d full_page=true 
  -o page.png

Use HTTPS. ScreenshotOne explicitly warns that HTTP does not encrypt credentials or other sensitive request data. Verify the current endpoint and option names in Getting started and the options reference.

Self-managed capture with Playwright

Playwright is the better fit when a screenshot is one step in a browser workflow. You install and maintain the browser runtime, then can navigate, authenticate, click, wait and capture in one process. The Microsoft project provides a command-line tool; its screenshot documentation covers viewport, element and full-scrollable-page captures.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npm install -D playwright
npx playwright install chromium
npx playwright screenshot --device="Desktop Chrome" --full-page https://example.com page.png

Command names and flags vary by Playwright release. Confirm installation and syntax in the Playwright CLI repository and screenshot documentation. For repeatable builds, pin the package and browser version, cache the browser binaries in CI, and run with the sandboxing policy required by your runner.

Python and Node.js API calls

Python with ScreenshotNeo

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Node.js with ScreenshotNeo

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

Use a timeout, check the HTTP status, and write the response as binary. Do not parse an image response as text.

Authentication and CI hygiene

  • Put API keys and tokens in environment variables or your CI secret store; never in a repository, shell history committed to logs, or a public URL.
  • Restrict secret visibility to the job that needs it and rotate keys after accidental exposure.
  • Use HTTPS endpoints and redact query strings from verbose logs.
  • For private pages, supply cookies or authorization headers only when the service documents how they are protected and retained.
  • Set deterministic viewport, timezone, locale and user-agent values when pixel comparisons run across machines.

Reliability, performance and cost planning

Make loading deterministic

Wait for a meaningful selector or network idle instead of guessing a long delay. For lazy content, use a provider’s documented scrolling option or a Playwright scroll routine. Block advertising and analytics requests when they are irrelevant, but do not block fonts, scripts or API calls that the page needs.

Control file size

Choose WebP or JPEG for large batches, lower quality when visual fidelity permits, and resize after capture only if your comparison does not depend on native pixels. Retina output multiplies dimensions and storage.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Plan retries safely

Retry transient network failures with exponential backoff and a maximum attempt count. Do not blindly retry authentication failures, invalid URLs or bot challenges. Record URL, viewport, format, timestamp, HTTP status and provider verdict so a failed image can be diagnosed.

Compare real workloads

Pricing, quotas and latency depend on page complexity, capture mode, region and plan. Run a representative sample that includes long pages, JavaScript-heavy pages, private pages and failure cases. Compare successful captures and billed requests—not only average response time.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting command-line captures

The output file is HTML or JSON, not an image

The request probably failed while the command still wrote the response. Use curl -f, inspect the HTTP status and save headers separately. API error bodies usually identify authentication, validation or quota problems.

The image is blank or incomplete

Increase the wait condition, wait for a page-specific selector, enable full-page scrolling for lazy content, and check whether a bot challenge or login screen is being returned. A self-managed browser may also lack required fonts or system dependencies.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Only the visible portion was captured

Enable the provider’s full-page option. If a fixed-height container scrolls internally, select that element or use browser automation to scroll the container; full-document capture alone will not reveal content hidden inside it.

Selectors fail intermittently

Prefer stable data attributes over generated class names, wait for the selector before capture, and account for iframes. A selector inside a cross-origin iframe may not be addressable by a top-level API.

CI works locally but fails in the runner

Check that the secret is available to the job, the browser binaries are installed, outbound HTTPS is allowed, and the runner has enough memory. Pin versions and log sanitized request metadata. For hosted services, verify the account token, allowed domains and current quota.

Results differ between runs

Dynamic ads, rotating content, animations, timezones and fonts are common causes. Freeze the viewport and locale, disable animations with custom CSS where supported, wait for stable content, and use caching only when stale output is acceptable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Or skip the browser setup

Use ScreenshotNeo’s one-call API when you want a managed browser without installing Chromium:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Cookie banners, popups and chat widgets are removed before the shot; bot checks, blank pages and failed loads are never billed. Its MCP server lets AI agents take screenshots through take_screenshot, get_page_info and capture_pdf. You get 1,000 screenshots a month free with no card, and paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Frequently Asked Questions

Can a screenshot API capture a page behind a login?

Usually, only when the service supports supplying the required cookies, headers or authorization and the target site permits automated access. Otherwise use Playwright to perform the login in your own controlled browser.

How should I store screenshots from a CI job?

Write the binary response to a workspace artifact or object-storage upload, retain the request metadata needed to reproduce it, and set an explicit retention period for potentially sensitive pages.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Is a full-page screenshot the same as printing a page to PDF?

No. Full-page capture produces one image of the rendered document; PDF generation uses paginated print layout, paper dimensions and margins, so the visual result can differ.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.