To screenshot a website from a URL with a REST API, send the absolute page URL and capture options to a screenshot service, authenticate as its documentation requires, then save the response in the format the service actually returns. The details differ by provider: some return image bytes, while others return JSON or redirect to a file. This guide shows a documented Cloudflare request and explains how to choose settings, handle responses, and diagnose failures.
How a REST screenshot request works
A screenshot API runs a browser render on the service side. Your application sends a target URL and options such as viewport dimensions, image format, or full-page mode. The service then returns image bytes, metadata, or a redirect, depending on its contract. There is no universal endpoint, field naming scheme, authentication method, or response format.
- Choose a provider and confirm its endpoint, authentication, request fields, and response format in its current documentation.
- Keep the API credential on a server you control. Use the provider’s documented authorization header where supported rather than placing a production key in client-side code or a URL.
- Send an absolute target URL and only the capture settings you need.
- Check the HTTP status and response type before saving or parsing the result.
For example, Cloudflare documents POST /accounts/{account_id}/browser-rendering/screenshot, using an API token with at least the Browser Rendering Write permission. Its endpoint accepts a URL or HTML and includes browser navigation and capture controls. These details apply to Cloudflare, not REST screenshot APIs generally. See the Cloudflare screenshot API reference.
Make a screenshot request with Cloudflare
Replace the account ID and token with your own, and adjust the request body to the endpoint’s current schema. This example asks for a full-page PNG and writes the response to a file. Confirm the response contract for your account and implementation before treating the body as raw image bytes.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
curl --fail-with-body -X POST 'https://api.cloudflare.com/client/v4/accounts/YOUR_ACCOUNT_ID/browser-rendering/screenshot'
-H 'Authorization: Bearer YOUR_API_TOKEN'
-H 'Content-Type: application/json'
-d '{"url":"https://example.com","format":"png","fullPage":true}'
--output screenshot.png
The endpoint supports controls such as viewport, full-page capture, clipping, navigation waits, selector waits, cookies, and cache TTL. Consult the API reference for valid field names and constraints. Its documented cache TTL default is 5 seconds, with a range of 0–86,400 seconds; that is a Cloudflare-specific setting, not a general REST standard.
Choose capture settings deliberately
Viewport or full-page
A viewport screenshot shows the browser’s visible area at the specified width and height. A full-page capture aims to include the scrollable document, but provider limits can constrain the resulting dimensions. Start with a viewport capture when validating a layout, then enable full-page mode if you need the complete document.
Dimensions and pixel scale
Viewport width and height describe the emulated browser window. Device scale or retina scale affects pixel density where supported; it is not a substitute for increasing viewport dimensions. Check whether a provider expresses viewport measurements in CSS pixels and what output limits apply.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Format and quality
Use a format supported by the selected API and your downstream workflow. PNG is lossless in Screenshot API (screenshot-api.net)’s documentation; JPEG and WebP are lossy formats whose quality settings may trade file size for image fidelity. The supported formats and parameter names vary across services.
Wait for the page to render
Initial document load does not guarantee that client-rendered content, images, or other delayed elements are ready. Where available, prefer a selector wait for a specific element, a navigation wait condition, or a bounded delay. A delay alone cannot guarantee that every dynamic component has settled.
Page state and other options
Depending on the provider, you may be able to supply cookies or headers, set dark mode, change timezone or geolocation, inject CSS or JavaScript, crop to a selector, or generate a PDF. These controls can affect what the page displays and may require careful handling of credentials. Verify support and restrictions in that provider’s documentation before relying on them.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Timeouts and caching
A longer timeout can give slow pages more time to render, but it may also increase latency. Caching can reduce repeated work while making a screenshot less fresh. For context, Screenshot API (screenshot-api.org) documents a 30,000 ms default timeoutMs; this is a setting for that service, not a universal default.
Handle the response correctly
Do not assume that an HTTP success means the response body is an image. Screenshot API (screenshot-api.net) documents a direct image-byte response with a matching Content-Type. Screenshot API (screenshot-api.org), by contrast, documents JSON by default for GET and an option to redirect to the resulting image or PDF; its Python example reads a screenshotUrl from JSON. Check the selected service’s current contract before writing code that saves the response.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →- Binary image: check the status and content type, then write the response bytes directly to a file.
- JSON: parse the documented response fields, then download the returned file URL if the API provides one.
- Redirect: follow it only as the provider documents, and make sure the client saves the final response rather than an intermediate page.
For a GET request, URL-encode the target URL so its query parameters are not mistaken for API parameters. Some services also accept POST, which is often more convenient for structured options. For example, Screenshot API (screenshot-api.org) documents GET and POST at /api/v1/screenshot and a separate batch endpoint at /api/v1/screenshot/batch; Screenshot API (screenshot-api.net) documents GET at /v1/screenshot. Their distinct contracts illustrate why one provider’s request cannot be assumed to work with another. See Screenshot API documentation and Screenshot API documentation.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Diagnose common failures
- Invalid URL: send a complete absolute URL with an accepted scheme, typically
https://, and URL-encode it when passing it in a query string. - 401 or 403 from the screenshot API: verify the credential, endpoint, method, and required permission scope. For Cloudflare’s documented endpoint, the token needs at least Browser Rendering Write.
- The saved file is not an image: inspect the status, content type, and response body. You may have received JSON, an error document, or a redirect rather than image bytes.
- The screenshot shows a login or error page: inspect the target page’s final status as well as the screenshot service’s status. Screenshot API (screenshot-api.net) documents an
X-Page-Statusheader; its documentation notes that a 401 or 403 can indicate the rendered page is a login or error page. See its documentation. - Content is missing: first confirm whether the page renders late, then use a supported selector wait or navigation condition. Add a bounded delay only when needed and verify the result.
- Timeout or quota error: read the provider’s error response and limits, then adjust the timeout or usage plan only if that resolves the identified cause. Limits and error formats are provider-specific.
- Unexpected crop or resolution: check full-page mode, viewport dimensions, scale, clipping, and any maximum image dimensions documented by the provider.
Keep credentials and target access secure
Store production API keys as server-side secrets. Avoid query-string keys where possible because URLs can appear in logs, browser history, and source; Screenshot API (screenshot-api.net) specifically warns that query credentials can be exposed to people who can read page source or server logs. Treat credentials sent to the screenshot service separately from cookies or authorization headers forwarded to the target page. Capture only pages you are authorized to access; a screenshot API does not establish permission to view restricted content or bypass the target site’s access controls.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. Its GET endpoint returns a PNG, JPEG, WebP, or PDF, and its documented capture options include viewport and full-page settings, waits, selector capture, custom headers and cookies, and more. Example cURL request:
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 the request and response details. ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Free tools Windows power users keep installed
One-click scans. No signup required.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Frequently Asked Questions
Does every screenshot REST API return image bytes?
No. Some return image bytes, while others return JSON or redirect to a file. Check the provider’s documented response contract before saving or parsing a response.
Can a screenshot API capture a page behind a login?
Only if you are authorized and the provider supports the needed session or authentication options. Do not assume the service bypasses access controls.
Is full-page capture always the whole page?
Not necessarily. Providers may impose output-dimension limits, so check the selected service’s documented maximums.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →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.

