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.