To turn markup you already have into an image, use a screenshot API that explicitly accepts raw HTML and send the snippet in the format its endpoint requires. To capture an element that is already on a website, send the page URL and a CSS selector instead. These are different workflows: a URL-only API cannot necessarily render HTML you supply.
Choose between raw HTML and a live page
Start by identifying where the content exists:
- Raw HTML: Your application has the markup and needs to render it as an image. Choose an endpoint that accepts an
htmlinput. - Live webpage: The content is already served at a URL. Choose an endpoint that accepts a URL; add a CSS selector if you want only one rendered element.
For example, Screenshot API documents an endpoint that requires exactly one of url or html, and returns successful screenshots as raw image bytes. Cloudflare Browser Run also documents both HTML and URL input, including selector captures. Check the specific endpoint contract before writing an integration: accepting URLs does not imply accepting supplied markup. Screenshot API documentation · Cloudflare Browser Run screenshot documentation.
As an Amazon Associate I earn from qualifying purchases.
Render supplied HTML as an image
For raw markup, Screenshot API’s documented request shape is a POST with an API key in the X-Api-Key header and JSON containing the html field. Its guide documents PNG, JPEG and WebP output, viewport width and height, and a quality setting for JPEG and WebP. Quality does not apply to PNG. The successful response is image bytes, so save the response body as a file rather than trying to parse it as JSON.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →curl -X POST https://screenshotapis.org/v1/screenshot
-H "X-Api-Key: YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{"html":"<div>Hello</div>","viewport_width":600,"viewport_height":300,"format":"png"}'
--output snippet.png
This is an example adapted from the provider’s documented request format, not a tested request. Screenshot API’s guide documents a 5 MB limit for raw HTML and viewport ranges; consult its current documentation to confirm limits and permitted values before relying on them. Keep the API key in a server-side secret store or environment variable, not in public page markup or browser-delivered code. See the Screenshot API guide.
#1 Best Overall
- PORTABLE SCANNER FOR USE ON-THE-GO — The fastest and lightest mobile single-sheet-fed compact document scanner in its class¹
- QUICK DOCUMENT SCANNING ― This Epson ultra-fast scanner scans a single page as quickly as 5.5 seconds²; Windows and Mac compatible
- VERSATILE PAPER HANDLING ― Portable scanner scans documents up to 8.5 x 72 in; Also easily digitizes receipts and ID cards to make accounting, bookkeeping, and organizing simpler
- INTUITIVE, HIGH-SPEED SOFTWARE — Epson ScanSmart Software³ is a smart tool allowing you to easily scan, review, and save; Stay organized easily with the help of this Epson scanner
- EASY SETUP — USB-powered connect to your computer for quick and simple scanning; No batteries or external power supply required to operate portable document scanner; Standard Connectivity: USB 2.0
Set dimensions and format for the destination
Choose the viewport to match the composition you need, rather than assuming the default will fit. A 600 × 300 viewport, for instance, suits a compact horizontal card better than a tall mobile layout. Select PNG when lossless output matters; JPEG or WebP may be preferable when the destination supports them and file size matters. If you set a quality value, the Screenshot API documentation applies it to JPEG and WebP, not PNG. The dimensions and formats are provider options, not guarantees that arbitrary HTML will render identically in every browser environment.
Capture one element from a live webpage
When the snippet belongs to a page already online, navigate to the URL and pass a CSS selector through an API that supports element capture. This captures the matching rendered page element; it is not the same as submitting a detached HTML fragment.
Rank #2
- FAST SPEEDS - Scans color and black and white documents a blazing speed up to 16ppm (1). Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
- ULTRA COMPACT – At less than 1 foot in length and only about 1. 5lbs in weight you can fit this device virtually anywhere (a bag, a purse, even a pocket).
- READY WHENEVER YOU ARE – The DS-640 mobile scanner is powered via an included micro USB 3. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan.
- WORKS YOUR WAY – Use the Brother free iPrint&Scan desktop app for scanning to multiple “Scan-to” destinations like PC, Network, cloud services, Email and OCR. (2) Supports Windows, Mac and Linux and TWAIN/WIA for PC/ICA for Mac/SANE drivers. (3)
- OPTIMIZE IMAGES AND TEXT – Automatic color detection/adjustment, image rotation (PC only), bleed through prevention/background removal, text enhancement, color drop to enhance scans. Software suite includes document management and OCR software. (4)
Cloudflare Browser Run documents selector capture as well as url or html input. Screenshot API also documents selector capture. Confirm the provider’s selector semantics and failure behavior, and make sure the selector identifies a visible element in the rendered page. Cloudflare screenshot endpoint options · Screenshot API reference.
Free tools Windows power users keep installed
One-click scans. No signup required.
Wait for client-rendered content
A page can load its initial document before JavaScript has populated the element you want. Cloudflare warns that default page-load behavior may capture JavaScript-heavy pages too early; its documentation describes gotoOptions.waitUntil and waitForSelector as ways to wait for navigation state or target content. Prefer waiting for the specific element when possible, so the capture does not depend only on a fixed delay. Cloudflare’s wait and screenshot options.
Rank #3
- FAST DOCUMENT SCANNING — Document scanner with feeder allows you to speed through stacks with a 50-sheet Auto Document Feeder (ADF); Efficient office scanner to help you scan more productively
- INTUITIVE, HIGH-SPEED SOFTWARE — Quickly scan with this desktop document scanner; Epson ScanSmart Software lets you easily preview scans, email files, upload to the cloud, and more; Plus, automatic file naming saves even more time
- SEAMLESS INTEGRATION — Easily incorporate your data into most document management software with the included TWAIN driver; Office document scanner integrates seamlessly with business workflows
- EASY SHARING — Duplex scanner allows you to scan straight to email or popular cloud storage2 services like Dropbox, Evernote, Google Drive, and OneDrive for simple storage and sharing
- SIMPLE FILE MANAGEMENT — Scanner allows the creation of searchable PDFs with Optical Character Recognition (OCR) and convert scans to editable Word or Excel files effortlessly; Designed for home and office document scanning
Compare the practical implementation paths
| Option | Input and capture | What to consider |
|---|---|---|
| ScreenshotNeo | Website screenshot API; one GET request can return PNG, JPEG, WebP or PDF. Supports HTML/CSS to image and CSS-selector element capture. | Clean-shot handling removes known consent platforms, newsletter popups and chat widgets before capture; only clean shots are billed. ScreenshotNeo. |
| Screenshot API | Documented raw HTML or URL input, selector capture, viewport controls and PNG, JPEG or WebP output. | Its guide describes API-key authentication, raw image-byte responses, a 5 MB raw HTML limit and viewport ranges. Verify current limits in the guide. |
| Cloudflare Browser Run | Documented URL or HTML input, selector capture, viewport and full-page options, and page-wait controls. | The docs warn that default page-load behavior may be too early for some JavaScript-heavy pages. See the screenshot endpoint documentation. |
| shot-scraper (local CLI) | Captures a local HTML file or webpage, can select an element, wait for content and output several image formats. | This is local browser automation software, not a hosted API. The cited manual is its Release 1.12 PDF: shot-scraper documentation. |
Choose based on input mode (raw HTML, URL or both), selector support, wait controls, output format and dimensions, hosted versus local operation, authentication, and current usage and security terms. A price or service-limit comparison across these options is not established here.
Or skip the browser setup
If you want a single request instead of managing browser capture, ScreenshotNeo accepts a URL and returns an image or PDF. It also supports HTML/CSS to image and capturing an element by CSS selector. Its one-call API path is for a URL; use the documented HTML/CSS-to-image option when your input is supplied markup. The cURL example below uses the documented URL-based request:
Rank #4
- Scanner type: Document
- Connectivity technology: USB
- With Auto Scan Mode, the scanner automatically detects what you're scanning
- Digitize documents and images
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. 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. The Free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Troubleshoot missing, incomplete or unusable captures
- The API rejects the request: Check that the endpoint accepts the input mode you sent, that its required authentication is present, and that your JSON field names and content type match its documentation. Screenshot API’s documented raw-HTML request uses POST, JSON, and an
X-Api-Keyheader. - The image is blank or the target is missing: For a raw snippet, verify the HTML is included in the accepted field. For a live page, confirm the URL is reachable and the CSS selector matches a visible element. If JavaScript fills the page, wait for its content selector or an appropriate navigation state.
- The screenshot cuts off content: Set the viewport dimensions deliberately. If the intended capture is a whole page rather than the visible viewport, check whether the API supports full-page capture and configure it explicitly.
- The result differs from the intended styling: A snippet may depend on CSS, fonts, images or scripts that are not included with the markup. Include or make dependencies available to the rendering environment, and validate the result for your actual content; documented options do not guarantee pixel-identical output.
- The output cannot be decoded as JSON: A successful Screenshot API screenshot is raw image bytes with an image MIME type. Save or stream the response as a binary file, and inspect the HTTP status and content type when diagnosing errors.
- The request fails on size or dimensions: Check Screenshot API’s documented raw HTML and viewport limits, which may change; reduce the markup or resize the requested viewport to a permitted value.
Reliability, performance and cost considerations
Rendering time and completeness depend on the page and its dependencies; the cited documentation does not establish a universal speed or success rate. Dynamic sites may require explicit waits, while large or resource-heavy pages can take longer to become ready. For recurring captures, decide whether to use a hosted service or run browser automation locally, and review the chosen provider’s current usage limits, security terms and error responses before production use. Do not treat a successful HTTP response as proof that the desired element rendered: validate the returned image when accuracy matters.
Frequently Asked Questions
Can every screenshot API turn a supplied HTML string into an image?
No. Check the endpoint contract: some accept URLs only, while others document raw HTML input.
Best Value
- OUR MOST ADVANCED SCANSNAP. Large touchscreen, fast 45ppm double-sided scanning, 100-sheet document feeder, Wi-Fi and USB connectivity, automatic optimizations, and support for cloud services. Upgraded replacement for the discontinued iX1600
- CUSTOMIZABLE. SHARABLE. Select personalized profiles from the touchscreen. Send to PC, Mac, mobile devices, and clouds. QUICK MENU lets you quickly scan-drag-drop to your favorite computer apps
- STABLE WIRELESS OR USB CONNECTION. Built-in Wi-Fi 6 for the fastest and most secure scanning. Connect to smart devices or cloud services without a computer. USB-C connection also available
- PHOTO AND DOCUMENT ORGANIZATION MADE EFFORTLESS. Easily manage, edit, and use scanned data from documents, receipts, photos, and business cards. Automatically optimize, name, and sort files
- AVOIDS PAPER JAMS AND DAMAGE. Features a brake roller system to feed paper smoothly, a multi-feed sensor that detects pages stuck together, and skew detection to prevent paper damage and data loss
Is capturing a selector from a URL the same as rendering an HTML snippet?
No. Selector capture targets an element in a page the API renders; raw HTML capture starts from markup supplied in the request.
Can I use a local HTML file instead of a hosted API?
Yes. shot-scraper documents local-file and webpage capture as a CLI workflow; it is not a hosted API.
Quick Recap
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.




