Page Screenshot API

Capture pixel-perfect screenshots of any web page via REST API. Single endpoint, zero infrastructure — just pass a URL and get back a high-quality image.

Start Free — 200/month

Page Screenshot API Overview

SnapAPI captures screenshots of any web page through a single REST endpoint. Send an HTTP GET request with the target page URL as a query parameter, include your API key in the Authorization header, and receive back a PNG or JPEG screenshot of the rendered page. The entire capture pipeline — launching a Chromium browser, loading the URL, waiting for the page to render, taking the screenshot, and encoding the output — happens server-side on SnapAPI infrastructure. Your application code contains no browser automation logic, no browser installation, and no browser process management. The result is a straightforward HTTP request that returns binary image data, integrating into any backend, serverless function, or automation script with minimal code. The simplicity of the interface belies the sophistication of the underlying rendering infrastructure: a full Chromium browser handles the page load, executing all JavaScript, loading all CSS and web fonts, and applying all layout rules to produce a screenshot that accurately reflects the page as a user would see it in their browser.

Configuring Page Screenshots

The page screenshot endpoint accepts several optional parameters that give precise control over the screenshot output. The full_page parameter captures the complete scrollable height of the page rather than just the visible viewport, producing a single tall image that contains all page content. This is essential for capturing complete blog posts, product pages, and documentation pages that require scrolling to see their full content. The width and height parameters set the browser viewport dimensions, with width determining how responsive CSS breakpoints are applied: set width to 375 for iPhone-sized mobile screenshots, 768 for tablet screenshots, and 1280 or 1920 for desktop screenshots. The delay parameter adds a wait time in milliseconds after page load before capturing, giving JavaScript-rendered content and lazy-loaded images time to appear. The format parameter selects PNG for lossless screenshots ideal for UI documentation, or JPEG with the quality parameter set for smaller file sizes suitable for thumbnail display in web interfaces.

// Node.js: capture page screenshots
const axios = require("axios");
const fs = require("fs");

const snap = axios.create({
  baseURL: "https://api.snapapi.pics",
  headers: { Authorization: `Bearer ${process.env.SNAP_API_KEY}` },
  responseType: "arraybuffer",
  timeout: 30000,
});

async function pageScreenshot(url, options = {}) {
  const { data } = await snap.get("/screenshot", {
    params: {
      url,
      format: options.format || "png",
      width: options.width || 1280,
      full_page: options.fullPage ? "true" : "false",
      delay: options.delay || 0,
    },
  });
  return data; // Buffer of image bytes
}

// Desktop full-page screenshot
const desktop = await pageScreenshot("https://example.com/page", { fullPage: true });
fs.writeFileSync("desktop-full.png", desktop);

// Mobile screenshot
const mobile = await pageScreenshot("https://example.com/page", { width: 375, format: "jpeg" });
fs.writeFileSync("mobile.jpg", mobile);

Page Screenshot API for Thumbnail Generation

Web applications display screenshot thumbnails alongside URL links to give users a visual preview of linked content. Implement thumbnail generation using the page screenshot API with JPEG format and a width of eight hundred to twelve hundred pixels, then resize the resulting image to the desired thumbnail dimensions using a server-side image processing library. Caching is essential for thumbnail applications: generate each thumbnail once, store it in cloud storage with the URL hash as the key, and serve it from a CDN for all subsequent requests. Set cache TTLs based on how frequently the target URLs change, using one to twenty-four hours for frequently updated content and seven to thirty days for stable pages. For applications with large URL collections, implement lazy thumbnail generation that creates thumbnails on first view rather than pre-generating all thumbnails at import time, conserving API credits for URLs that users actually view. Display a placeholder image or loading skeleton while the thumbnail generates asynchronously to avoid blocking the UI on screenshot generation latency.

Get Started with Page Screenshot API

Register at snapapi.pics/register for a free API key providing two hundred page screenshot requests per month at no cost and no credit card required. The page screenshot endpoint is the same REST endpoint used for all SnapAPI screenshot use cases, with no special configuration needed for specific page types. Full documentation at snapapi.pics/docs includes all parameter options and code examples. Official SDKs for JavaScript, Python, Go, PHP, Swift, and Kotlin simplify the integration to a single function call in your language of choice.

Page Screenshot API for Monitoring and Alerting

Website and application monitoring systems use the page screenshot API to capture visual evidence of page state at regular intervals and during incident events. A monitoring job calls the screenshot endpoint for each monitored page URL on a configured schedule, compares the new screenshot to the stored baseline using a pixel-difference algorithm, and triggers an alert when the visual difference exceeds a configured threshold indicating a significant page change. During a production incident, the monitoring system captures a screenshot of the affected pages at the moment the incident is detected, providing the on-call engineer with visual documentation of what the page displayed when the alert fired rather than requiring them to visit the page after conditions may have changed. Store monitoring screenshots in time-series object storage with the capture timestamp in the key, enabling retrieval of historical screenshots for any monitored URL at any past monitoring checkpoint. This visual monitoring history provides context for incident postmortems by showing exactly when and how the page appearance changed in the hours leading up to and during the incident.

Page Screenshot API Performance Tips

Optimizing page screenshot API usage for performance and cost involves several practical techniques. Use JPEG format with quality set to seventy to eighty instead of PNG for screenshots that will be displayed as thumbnails or used in email or social media contexts where lossless quality is not required, reducing response size by sixty to eighty percent compared to PNG for most web pages. Set viewport width to match your display use case: smaller widths like eight hundred pixels capture the mobile or tablet layout of responsive pages faster than large desktop widths because the page renders less content at smaller viewport sizes. Set the delay parameter only when your specific target pages require it — most pages render correctly with a delay of zero, and setting a delay of one or two seconds on every request adds that latency to every API call unnecessarily. For bulk processing jobs that capture many pages in sequence, use async HTTP clients to make concurrent requests up to your configured parallelism limit rather than sequential requests, reducing total job duration proportionally to the concurrency level. Cache screenshot results keyed by URL and configuration parameters to avoid recapturing pages that have not changed since the last capture, implementing cache invalidation through scheduled captures that update the cached screenshot on a TTL basis.

Register and Start Capturing Pages

Register at snapapi.pics/register for a free API key with two hundred page screenshot requests per month. No credit card required, no time limit on the free tier. Official SDKs for JavaScript, Python, Go, PHP, Swift, and Kotlin at github.com/Sleywill simplify integration to a single function call. The SnapAPI documentation at snapapi.pics/docs provides complete parameter reference, error handling guidance, and integration examples for the most common page screenshot use cases including monitoring, thumbnail generation, CI testing, and report automation.

Page Screenshot API Frequently Asked Questions

Several common questions arise when integrating a page screenshot API into production applications. How long does a screenshot take? Most pages render and capture in two to eight seconds depending on the page complexity, number of external resources, and configured delay. Simple static pages capture in under two seconds and complex JavaScript applications may take five to ten seconds. Does the API support capturing authenticated pages? Yes — pass session cookies or Authorization headers in the API request to capture pages that require authentication for access. What happens if the target page returns a 404 or 500 error? SnapAPI renders whatever Chromium displays for the URL, including error pages, so the screenshot will show the 404 or 500 error page displayed by the server. Your application should validate URLs before sending them to the API to filter out known broken links. Can I capture pages on private networks or localhost? No — SnapAPI runs on external infrastructure that cannot reach private network addresses, local development servers, or intranet URLs. Use a public staging or preview URL for testing screenshot capture of pages under development. Is there a file size limit on screenshots? PNG screenshots of large full-page captures can reach several megabytes — use JPEG format with quality set to 80 for smaller output when exact pixel fidelity is not required. Register at snapapi.pics/register for a free key to explore these capabilities today.