HTML Screenshot API

Render HTML to a high-quality image or PDF via REST API. Pass raw HTML or a URL — Chromium renders it accurately with full CSS, JavaScript, and web font support.

Start Free — 200/month

Render HTML to Image via API

SnapAPI renders web pages to screenshots using a full Chromium browser, capturing any URL with complete CSS, JavaScript, and web font rendering. The screenshot endpoint accepts a URL parameter pointing to any publicly accessible web page, renders it in Chromium, and returns the screenshot as a PNG or JPEG image. For developers who need to render HTML that is not hosted at a public URL — locally generated HTML, template-rendered HTML, or HTML built at request time — host the HTML content on a temporary URL or your own internal endpoint and pass that URL to the SnapAPI screenshot endpoint. SnapAPI renders the HTML by loading the URL in Chromium just as a browser would, executing any JavaScript in the HTML, applying all CSS including external stylesheets and web fonts, and capturing the rendered visual output. This approach produces accurate screenshots of HTML content that includes modern CSS features, JavaScript-rendered dynamic content, and external resources like images and fonts loaded from CDN URLs.

HTML to Image Use Cases

Dynamic image generation renders HTML templates to images for use in email campaigns, social media posts, certificates, and badges. Marketing teams create personalized email banner images by rendering an HTML template with user-specific data such as the user name and progress metric, capturing the rendered HTML as a JPEG, and including the image in the email as a personalized visual element. Certificate generation renders HTML certificate templates with the recipient name and completion date as a full-page PNG or PDF for download after completing a course or certification program. Social media card generation renders an HTML card template for each piece of content and captures it as an image for use as the og:image or Twitter card image, providing branded visual previews for all shared links without manual design work. Report generation renders HTML report templates with dynamic data from a database into PDF documents for automated report distribution, combining the flexibility of HTML layout with the portability of PDF output.

HTML Screenshot API JavaScript Support

SnapAPI executes JavaScript in the rendered page before capturing the screenshot, ensuring that JavaScript-rendered content is present in the output. Single-page applications built with React, Vue, Angular, and Svelte render their initial content via JavaScript after the page load event, and SnapAPI waits for JavaScript execution to complete before capturing the screenshot so the rendered output reflects the fully initialized component state. For HTML pages that rely on JavaScript animations, data fetching, or timers to render their final visual state, use the delay parameter to specify how many milliseconds to wait after the page load event before capturing, giving JavaScript-triggered rendering processes time to complete before the screenshot is taken. Set the delay to one thousand milliseconds for most JavaScript-animated templates and increase it to two or three thousand for templates that include data fetch calls that must complete before the content is visible in the rendered output. Test the appropriate delay value by experimenting with different delay settings and inspecting the resulting screenshots to confirm that all content is visible and correctly rendered before finalizing the integration configuration.

HTML to PDF via Screenshot API

For HTML-to-PDF conversion, use the SnapAPI PDF endpoint instead of the screenshot endpoint. The PDF endpoint renders the target URL in Chromium using the print rendering mode and returns a multi-page PDF document rather than a single image. The print rendering mode uses the CSS print media stylesheet if one is defined, applies the configured paper dimensions and margins, and generates a multi-page PDF that flows the page content across pages according to the page break rules in the CSS. The PDF endpoint parameters include format for paper size, margin settings in millimeters, landscape orientation toggle, and print_background for preserving background colors in the PDF output. Use the PDF endpoint for documents intended for printing, downloading, or archiving, and use the screenshot endpoint for images intended for display in web interfaces, email, or social media where a single-image output is more appropriate than a multi-page document.

Get Started with HTML Screenshot API

Register at snapapi.pics/register for a free API key with two hundred requests per month. No credit card required. Host your HTML content at any accessible URL and pass it to the SnapAPI screenshot or PDF endpoint. Full documentation at snapapi.pics/docs with code examples in JavaScript, Python, Go, PHP, Swift, and Kotlin covers both the screenshot and PDF endpoints for HTML rendering use cases.

HTML Screenshot API for Email Image Generation

Email marketing tools generate personalized images for email campaigns by rendering HTML templates to JPEG images via screenshot API and embedding the results as inline images or hosted image URLs in the email body. Personalized HTML templates include recipient-specific variables such as the user name, account data, usage statistics, or custom messages, and the screenshot API renders each personalized template instance to a JPEG image at email-appropriate dimensions such as six hundred pixels wide. The personalized images are uploaded to cloud storage and referenced by the image URL in the email HTML, so the email client displays the personalized image without requiring the email renderer to support complex HTML layouts that vary between email clients. This pattern enables rich visual personalization in email using standard img tags with CDN-hosted screenshot images, working reliably across all major email clients that handle plain image tags consistently without the HTML rendering inconsistencies that affect complex email HTML layouts.

HTML Screenshot API for Certificate and Badge Generation

Learning management systems and certification platforms generate achievement certificates and badges by rendering HTML certificate templates to PNG images via screenshot API. The certificate template is an HTML page with CSS styling that produces a professional certificate design when rendered in Chromium, including the recipient name, course title, completion date, and certificate number as data injected into the template. After the user completes a course or assessment, the platform renders the certificate template URL with the completion data as query parameters, calls the screenshot API to capture the full-page PNG at certificate dimensions, stores the certificate image in cloud storage, and notifies the user with the download link. The HTML and CSS template approach enables designers to create sophisticated certificate designs using standard web design tools and preview them in a browser before deploying to production, without requiring knowledge of PDF generation libraries or certificate-specific design tools. The same template-plus-screenshot approach works for digital badges, completion thumbnails, and achievement cards that are shared on LinkedIn and displayed in user profile pages within the learning platform.

HTML Screenshot API Rendering Accuracy

SnapAPI renders HTML pages using Chromium, the same browser engine underlying Google Chrome, ensuring that the screenshot output matches what a Chrome user would see in their browser. Web fonts from Google Fonts, Typekit, and other CDN-hosted font services load correctly in the rendered output because Chromium makes the HTTP requests to fetch the fonts during page load just as it would in a user-facing browser session. CSS variables, the clamp function, grid and flexbox layouts, and other modern CSS features all render correctly in Chromium, producing screenshots that match the design intent without the layout degradation that affects older screenshot tools using outdated browser engines. External images from CDN URLs load in the rendered output if they are publicly accessible, so HTML templates that reference images from your CDN or image hosting service will include those images in the screenshot. The only cases where the rendered screenshot may differ from browser preview are pages that require user authentication, pages that block headless browser user agents, and pages that use browser APIs not available in headless mode such as getUserMedia for camera access.

HTML Screenshot API Free Tier and Getting Started

SnapAPI provides a permanently free tier with two hundred HTML screenshot and rendering requests per month at no cost, no credit card, and no expiry. All four endpoints — screenshot, scrape, extract, and PDF — share the two hundred monthly request allocation on the free tier, allowing complete integration testing of HTML rendering, PDF generation, and other use cases before upgrading. The Starter plan at nineteen dollars per month provides five thousand requests for production HTML rendering workloads. The Pro plan at seventy-nine dollars per month provides fifty thousand requests for high-volume certificate generation, personalized image pipelines, and large-scale report automation. Register at snapapi.pics/register to receive your free API key immediately and start rendering HTML to images and PDFs in minutes. The SnapAPI documentation at snapapi.pics/docs includes integration examples for all six SDK languages covering the most common HTML rendering use cases including certificate generation, email image creation, and dynamic og:image generation.