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

cURL can save a webpage screenshot as a PNG, but it does not render HTML itself. Your command sends an HTTP request to a browser-rendering service; that service loads the page, runs its JavaScript, captures the rendered result, and returns PNG bytes (or sometimes a hosted image URL). The smallest practical workflow is:

curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/screenshot' 
  -H 'Authorization: Bearer <apiToken>' 
  -H 'Content-Type: application/json' 
  -d '{"url":"https://example.com"}' 
  --output screenshot.png

Cloudflare’s endpoint accepts a url or html value, processes HTML and JavaScript, and documents a default 1920 × 1080 viewport. The --output option writes the binary response to screenshot.png.

What cURL does—and what it does not do

cURL is the HTTP client in this workflow. It handles the request method, authentication headers, JSON body, URL encoding, and file output. A remote browser renderer (or a renderer you operate yourself) performs navigation, JavaScript execution, layout, and rasterization. Sending a URL to an ordinary web server with cURL only downloads its HTTP response; it does not create a visual screenshot.

Before choosing a command, establish the service’s response contract. Some APIs return image bytes that can be written directly to a file. Others return JSON containing a hosted PNG URL, which requires a second download. Error responses may also be JSON, so an apparently created file is not proof that the capture succeeded.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Guermok Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P 60FPS & 2K 30FPS
  • 【1080P 60FPS Video Capture Card】 This HDMI game capture card is based on USB3.0 high speed transmission port, input resolution up to 4K@30HZ, output resolution up to 2K@30Hz or 1920×1080@60Hz. Type c and USB interface can meet most of the devices in daily life. Easily meet the online capture, real-time recording, online meetings, live gaming and other functions, so you have a better visual enjoyment. Note: For capture use only; requires capture software to function and is not intended for direct screen casting to a monitor or TV
  • 【Ultra Low Latency Screen Sharing】 HDMI capture card is made of good quality aluminum alloy with strong heat dissipation, allowing you to enjoy ultra low latency while live gaming or video recording or live streaming, avoiding blue screens and lag. This HDMI to USBC capture card supports easy recording of good quality audio or HD video and transferring it to your computer or streaming platform, allowing you to record 60 fps HD video directly on your hard drive and real-time preview
  • 【Plug and Play, Easy to Carry】 This HDMI 1080P video capture card does not require any additional drivers or external power supply, just plug and play for fast capture. The capture card is small and lightweight, so you can put it in your bag for emergencies, making it very portable for outdoor live streaming. It's also a great way to share content in game recording, video conference, video recorder and online teaching
  • 【Wide Compatibility USB Capture Card】 Easily streams to Facebook, Youtube or Twitch. With the connection, this HDMI to USB C/3.0 video capture devices can be working on several Operating Systems and various software: Windows 7/ 8/ 10, Mac OS or above, Linux, Android, Laptop, Xbox One, PS3/PS4/PS5, Camera, DVDs, Set Top Box, Webcame, DSLR, Switch/Switch 2, TV BOX, HDTV, Potplayer/VLC, ZOOM, OBS Studio etc.
  • 【Package Content & Note】 1x HD Audio Capture Card , 1x USB 3.0 to USB C Adapter (A-side 3.0, B-side 2.0), 1x user manual. Please note that you need to restart the OBS Studio software after the audio setup is complete, otherwise it will result in no sound output. When using an adapter, if the device is recognized as USB 2.0, try using the other side with the USB-C port. Simply flip the capture card and reconnect it to be recognized as USB 3.0

Minimal PNG capture with Cloudflare Browser Rendering

The following is the documented POST pattern. Replace both placeholders with your Cloudflare account ID and API token:

curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/screenshot' 
  -H 'Authorization: Bearer <apiToken>' 
  -H 'Content-Type: application/json' 
  -d '{"url":"https://example.com"}' 
  --output screenshot.png
  1. Set the target page in the JSON url property.
  2. Send the bearer token in the Authorization header, not in the page URL.
  3. Keep --output so cURL writes binary bytes rather than printing them in your terminal.
  4. Inspect the resulting file with an image viewer or the file screenshot.png command.

Cloudflare documents this endpoint as rendering the page’s HTML and JavaScript before capturing the fully rendered page. Its example uses a 1920 × 1080 viewport; other viewport and full-page settings are available through the service’s request schema.

Viewport, full-page, and element-sized images

Viewport capture

A viewport capture records the selected browser window. Set width and height when your test or design review must match a specific device size. A viewport image is predictable in dimensions but will not include content below the fold.

Full-page capture

Full-page mode stitches or expands the capture to include the document’s scrollable content. It is useful for archiving long pages, but output can become very tall and may encounter provider-specific maximum dimensions. Confirm the service’s limits before using it for unbounded documents.

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

Element or selector capture

Some APIs accept a CSS selector and capture only that element. This is useful for cards, receipts, charts, or regression-test targets. Selector support, visibility rules, and behavior when the selector is missing differ by provider; define a failure policy rather than assuming the whole page will be returned.

Rank #2
Sale
Anker USB C to HDMI Adapter (4K@60Hz), USB Type C to HDMI Cable Adapter
  • The Anker Advantage: Join the 80 million+ powered by our leading technology.
  • Vivid Video: The HDMI adapter lets you connect to any TV or display with an HDMI port to stream video in up to 4K resolution.
  • Plug and Play: Instantly turn your laptop’s USB-C port into an HDMI port, with no installation necessary. This product does not support charging or Power Delivery (PD).
  • Premium Construction: A lightweight aluminum casing allows for greater heat dissipation, while the reinforced braided-nylon cable is designed to withstand the twists and tugs of daily use.
  • Compatibility: Supports USB-C DP Alt mode, USB4, and Thunderbolt connections.

Wait for the page to be ready

Navigation completion is not the same as visual readiness. Single-page applications may fetch data after the initial document loads, and lazy images may appear only after scrolling. Cloudflare documents gotoOptions.waitUntil values including networkidle0 and networkidle2, plus waiting for a selector that proves the required content exists.

Use a readiness strategy appropriate to the page:

  • Network idle: suitable when the page’s requests settle reliably.
  • Selector wait: best when a known heading, table, or application state marks completion.
  • Fixed delay: a fallback for unpredictable third-party requests; keep it as short as the page allows.

Waiting too little produces an incomplete screenshot. Waiting for every background request can delay or prevent capture on pages with analytics, live feeds, or long-polling connections.

Make output sharp and consistent

CSS pixels and physical image pixels are not identical. Cloudflare notes that a large viewport can look blurry when deviceScaleFactor is too low. Increase the device scale factor for sharper retina-style output, while accounting for the larger file and memory cost. Keep viewport dimensions, scale factor, browser version, fonts, timezone, and color scheme stable when comparing screenshots over time.

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

Dark mode and responsive layouts

Responsive breakpoints can change the page substantially. Specify the viewport rather than relying on a provider default. If the service supports color-scheme or dark-mode emulation, set it explicitly so a scheduled capture does not change when the renderer’s defaults change.

Authenticated and personalized pages

The credential for the screenshot API is separate from credentials needed by the target page. Depending on the renderer, you may provide:

Rank #3
Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P60FPS HDMI Capture Card for Streaming, Gaming, Video Recording Compatible with Switch, Xbox, PS4/5, OBS,iPad Mac OS Windows,Camera, Zoom(Silver)
  • 【4K HDMI Input, 2K@30Hz Recording】Powered by a true USB 3.0 high-speed interface, the capture card supports up to 4K@30Hz HDMI input and records at 2K@30Hz or 1080P@60Hz. Perfect for gamers, streamers, and professionals who need crisp, smooth video for live streaming, gameplay recording, or online meetings.
  • 【Ultra Low Latency Screen Sharing】Built with a premium aluminum alloy shell and advanced chipset for stable heat dissipation, ensuring ultra-low latency transmission. Capture high-quality video and dual-channel audio in real time—no lag, no frame drop—ideal for Twitch, YouTube, or OBS streaming.
  • 【Easy Plug and Play, Compact & Portable】No driver or external power required—just plug and play via USB 3.0 or Type-C connection to your Windows or macOS computer. Lightweight and compact design makes it easy to carry for outdoor streaming, live shows, or mobile recording setups.
  • 【Wide Compatibility & Multi-Device Support】Compatible with Windows 7 8 10 11, macOS, Linux,Android and supports most popular software such as OBS, Zoom, VLC, Twitch Studio, and more. Works seamlessly with PS4, PS5, Xbox, Switch, DSLR cameras, TV boxes, and other HDMI-output devices for streaming to YouTube, Twitch, etc.
  • 【What You Get】Includes: HDMI Capture Card, USB 3.0 to USB-C Adapter, User Manual. Tips: Make sure your tablet’s OTG function is enabled before connecting. Test your HDMI device with a monitor first to confirm video and audio output, then connect to the Video Capture Card for recording.
  • Session cookies for an already authenticated browser context.
  • HTTP Basic Authentication credentials.
  • Custom authorization headers sent to the target origin.

Prefer short-lived, least-privilege credentials. Do not put production secrets in a query string or commit them to shell history. Store API tokens in protected environment variables and pass them through headers or the provider’s secret mechanism.

GET versus POST and safe URL handling

When a service uses GET parameters, encode the target URL with cURL’s --data-urlencode. This matters when the page URL contains its own query string, ampersands, fragments, or non-ASCII characters. A generic pattern is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G 'https://renderer.example/v1/screenshot' 
  -H "Authorization: Bearer $API_TOKEN" 
  --data-urlencode 'url=https://example.com/search?q=red&sort=latest' 
  --data-urlencode 'format=png' 
  -o screenshot.png

Use POST for integrations when the provider supports it; credentials and large option objects stay out of the URL. The exact endpoint, parameter names, and authentication method are provider-specific.

When the API returns a hosted PNG URL

HTML/CSS to Image documents a POST request to https://hcti.io/v1/image with JSON, including format: "png". Its response describes a hosted .png URL rather than image bytes. The flow is therefore two steps:

  1. POST the HTML/CSS and PNG options, then parse the returned JSON.
  2. Download the returned URL with a second cURL request, for example curl -L 'https://returned-host/path.png' -o screenshot.png.

Do not blindly save the first response as .png until you know whether it is binary image data or JSON metadata.

Rank #4
Sale
Papeaso Video Capture Card, 4K Input HDMI to USB-C, 1080P 60FPS Capture
  • [60fps4K perfect capture card] - Designed for game recording, video recording, online meeting, live broadcasting etc. Records high resolution video up to 1080p at 60fps The USB-C end is compatible with more devices
  • Video Card Capture USB C – Capture card 60fps can be used for Windows, Android, Mac OS X and Linux. No more installing drivers, based on the high-speed USB 2.0 technology, let your live streaming on Twitch, YouTube, Facebook, Twitter, OBS, Potplayer and VLC
  • No delay, no freezing: the HDMI video capture card 1080p offers a high-resolution input with a resolution of up to 3840 x 2160 @ 60 Hz. 1080p video recording card images are fluid, without freezing and no delay. Suitable for HD video recording, live broadcasting, live games, etc
  • [Widely Compatible] - The 1080P HDMI recording card is compatible with most devices, such as: PS3, PS4, Xbox One, Xbox 360, Wili U Wii, Nintendo Switch, DVD, Security Camera, Webcam, Set-Top Box, DSLR etc
  • [You should forge the iron as long as it is hot] - We are sure that you will be satisfied with this game capture card - Input end: USB C / Output end: HDMI, package comes with a USB C adapter to adapter your USB C and USB device

Robust shell handling and validation

Use --fail-with-body where supported so HTTP errors produce a non-zero exit status while preserving the provider’s diagnostic body:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl --fail-with-body --silent --show-error 
  -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/screenshot' 
  -H 'Authorization: Bearer <apiToken>' 
  -H 'Content-Type: application/json' 
  -d '{"url":"https://example.com"}' 
  --output screenshot.png

Afterward, verify the file type and size. A tiny file beginning with a JSON error object is not a valid PNG. For pipelines, write to a temporary path, check the command status and MIME type, then rename it atomically.

Performance, reliability, and operating choices

Managed renderer

A managed API removes browser installation, patching, sandboxing, scaling, and queue operations from your application. You still need to handle provider limits, retries, timeouts, authentication, and target-site failures.

Self-hosted renderer

Self-hosting a renderer such as Splash gives you control over deployment and network placement. It also makes browser updates, capacity, security isolation, fonts, storage, and monitoring your responsibility. Choose it when operational control outweighs maintenance work.

Retry policy

Retry transient transport failures and provider rate limits with bounded exponential backoff. Do not repeatedly retry deterministic errors such as an invalid URL, rejected credentials, or a missing selector. Record the target URL, option set, renderer response status, and elapsed time for diagnosis.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
UGREEN 2K@30Hz 1080P 60FPS Video Capture Card 4K Input HDMI to USB 3.0
  • 2K 30FPS & 1080p 60FPS HDMI Capture Card: The 4K@30Hz input and 2K@30Hz output resolutions offer dual benefits. The high input resolution preserves original video quality for post-production editing, while the 2K output provides an optimal balance between clarity and compatibility. At the same time, this HDMI to USB-C capture card is also backward compatible with 1080p 60FPS, to fulfill a variety of daily needs. Note: Ensure your HDMI source device and the capture device support 2K resolution
  • Low Latency 5 Gbps High Data Transfer Speed: With high-speed USB 3.0 technology for optimal performance and low delay, you can easily stream video from the Switch/Switch 2/PS4/PS5 to Twitch, YouTube, Facebook, Twitter, OBS, Potplayer, and VLC on a computer. It's also backward compatible with USB 2.0. Note: This capture card for streaming only supports HDMI input sources, as well as iPadOS devices need to be updated to 17 or higher to use it
  • USB A and USB C ports: Featuring both USB-A and USB-C interfaces, this streaming capture card ensures broad compatibility with modern devices, including smartphones, laptops, tablets, desktops, and Quest 3. Perfect for multi-scenario streaming—whether you're broadcasting camera footage, mobile gaming, or PC live streams. Note: This capture card only supports unidirectional signal flow—HDMI input to USB output
  • Universal Compatibility: This Driver-Free HDMI capture card for streaming supports Windows 11/10/8.1/7, MacOS, Linux, and phones/tablets. This capture card effortlessly livestreams gameplay from Switch, Switch 2, PS4/PS4 Pro/PS5 (Disable HDCP mode), Xbox Series X, and Meta Quest 3/2 directly to your iPad, laptop, or PC. Fully support OBS Studio, XSplit, PotPlayer, QuickTime Player, and more for streaming, recording, editing, and high-res video transfer. Note: iPadOS 17 or later is required for USB-C iPad compatibility. Switch / Xbox / PS5/ PS4 work fine when HDCP is turned off
  • Durable USB Capture Card: The aluminum alloy casing easily dissipates heat and is lightweight while effectively shielding against EMI, ensuring stable signal transmission. The built-in cable features 26AWG (2C) + 30AWG (1P) tinned copper conductors, ensuring excellent conductivity and corrosion resistance, enhancing durability, and reducing signal loss

Caching and freshness

Caching reduces repeated browser work but can return an intentionally older page. Decide whether the screenshot is an immutable artifact, a periodically refreshed snapshot, or a real-time test result, and configure cache behavior accordingly.

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

Common failures and fixes

Symptom Likely cause Fix
PNG file contains JSON API returned an error or metadata response. Use --fail-with-body, inspect the status and content type, and follow the provider’s URL-download flow when applicable.
Blank or partially rendered page Capture occurred before JavaScript or data finished. Use a selector wait, networkidle0/networkidle2, or a measured delay.
Blurry text Device scale factor is too low for the chosen viewport. Increase deviceScaleFactor and allow for larger output.
Wrong mobile/desktop layout Renderer used an unexpected viewport. Set explicit width and height and keep them fixed in automated jobs.
401 or 403 response API token is missing, expired, or lacks permission; target page may also require separate credentials. Check the API header, account scope, and target cookies or authorization settings.
URL with query parameters fails Characters were interpreted by the shell or URL parser. Quote the value and use --data-urlencode for GET requests.
Timeout Slow origin, never-ending requests, or an over-large full-page capture. Wait for a meaningful selector, block unnecessary resources if supported, reduce capture size, and set a bounded timeout.

Or skip the browser setup

ScreenshotNeo is a managed screenshot API and MCP server. It accepts consent banners like a visitor, removes more than 60 known consent platforms plus newsletter popups and chat widgets before capture, and bills only clean shots. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; each response reports the result in X-Page-Verdict and X-Billed headers.

One cURL request returns PNG, JPEG, WebP, or PDF output:

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 documentation for options such as full-page and selector capture, waits, device presets, retina scale, custom CSS or JavaScript, cookies and headers, blocking rules, PDFs, signed links, asynchronous jobs, bulk capture, and the usage API. For Python:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

For Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools to Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots each month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

Frequently Asked Questions

Can cURL screenshot a page without an external browser service?

Not by itself. cURL transfers HTTP data; you need a browser renderer running locally or behind an API endpoint.

Why is my screenshot not a PNG even though the filename ends in .png?

The response may be JSON metadata or an error. Check the HTTP status and content type before saving or processing the file.

Should I use full-page capture for every page?

No. Use viewport capture for fixed visual checks and full-page capture when content below the fold is part of the artifact; full-page images can be very tall.

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

How should I protect screenshot API credentials in automation?

Keep keys in protected environment variables or secret storage, send them in headers when supported, and avoid query strings for production credentials.

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.