To capture a website with Rust, send an HTTP request to a hosted screenshot API and save the returned image or PDF. This renders a remote URL; it does not capture your Rust program’s local desktop. The verified Screenshot API path is its REST endpoint, while its Rust SDK is listed as cargo add screenshot-api but its Rust-specific methods and response types are not documented in the materials available here. The examples below therefore use a conventional Rust HTTP client to call the documented REST API directly.
Choose the right kind of screenshot
A hosted website screenshot API opens a URL in a remote browser and returns a rendered result. This is useful for page previews, reports, visual checks, and other URL-to-image workflows. It is different from capturing a monitor, window, or app running on your own computer.
- Remote website: use a hosted API such as Screenshot API or ScreenshotNeo. The former documents a URL-based REST capture flow; ScreenshotNeo provides a website screenshot API and MCP server.
- Local desktop or window: use an operating-system capture framework or a Rust binding for one. For example,
screencapturekitbinds Apple’s ScreenCaptureKit; the documented screenshot support is associated with macOS 14.0 and later features. - Image-buffer work: crates such as
miniscreenshotandscreen_shotaddress local display capture or image handling, not hosted website rendering.
These approaches are not interchangeable: a hosted API needs a reachable website URL and network access, while a local capture crate works with a local display and its platform permissions.
Make a first Rust request with the REST API
Screenshot API documents POST /api/v1/screenshot with a bearer API key and JSON body. Create an API key through the service, add an HTTP client to a Rust project, and send a JSON request. This example uses reqwest with blocking support so the flow fits in a small command-line program. It saves the response body as a PNG; check the response status before treating the body as an image.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitches#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.
Project setup
Create a project and add the dependencies:
cargo new rust-website-shot
cd rust-website-shot
cargo add reqwest --features blocking,json,rustls-tls
cargo add serde_json
Set the API key in your shell rather than embedding it in source control. In a Unix-like shell:
export SCREENSHOT_API_KEY='YOUR_API_KEY'
On PowerShell, use $env:SCREENSHOT_API_KEY='YOUR_API_KEY' for the current session.
Runnable example
Replace src/main.rs with the following. It requests a viewport screenshot of https://example.com, checks for an HTTP error, and writes the returned bytes to shot.png.
use reqwest::blocking::Client;
use serde_json::json;
use std::{env, error::Error, fs};
fn main() -> Result<(), Box<dyn Error>> {
let api_key = env::var("SCREENSHOT_API_KEY")?;
let client = Client::new();
let response = client
.post("https://screenshotapi.net/api/v1/screenshot")
.bearer_auth(api_key)
.header("Content-Type", "application/json")
.json(&json!({
"url": "https://example.com",
"format": "png",
"fullPage": false
}))
.send()?
.error_for_status()?;
let bytes = response.bytes()?;
fs::write("shot.png", &bytes)?;
println!("Saved {} bytes to shot.png", bytes.len());
Ok(())
}
Run it with cargo run. The example assumes the endpoint returns image bytes for this request. The API’s basic flow may instead provide a screenshot URL or redirect depending on the request form and options, so inspect the response behavior for the route you use before writing the body directly to an image file.
Free tools Windows power users keep installed
One-click scans. No signup required.
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.
What is verified—and what is not—about the Rust SDK
The official SDK index lists a Rust package installed with cargo add screenshot-api, but the Rust-specific documentation could not be retrieved. No verified Rust method names, structs, or response model are available here, so the example deliberately calls the documented HTTP endpoint rather than pretending to use that SDK. Before adopting the crate, check its current package documentation, version, authentication setup, and whether it returns bytes, a URL, or another response type.
Request shape, methods, and output handling
The documented endpoint is /api/v1/screenshot. The basic JSON request includes a URL, format, and full-page flag; a minimal example is:
{
"url": "https://example.com",
"format": "png",
"fullPage": false
}
POST is the better fit when you need a structured body with capture options. The API also documents GET requests: GET returns JSON by default, and redirect=1 requests a redirect to the generated image or PDF. Its docs additionally show an X-API-Key header option. Use the authentication style and response mode that match the endpoint documentation for your request; do not assume every mode returns raw image bytes.
Documented output formats are PNG, JPEG, WebP, and PDF. Save a response with the matching file extension only after confirming the response represents that format. If a response is JSON containing a result URL, parse the JSON and fetch or follow that result according to the API’s documented flow instead of saving JSON as an image.
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.
Capture controls to decide before scaling up
The API reference lists the following options. Exact JSON property spelling and accepted values beyond the verified examples should be taken from the current endpoint reference rather than inferred from this summary.
| Need | Documented control | When it helps |
|---|---|---|
| Control framing | Viewport dimensions, device scale factor | Set the browser viewport and image density for a consistent render. |
| Capture the whole page | Full-page mode | Useful for long pages; verify whether content below the fold is loaded by the remote browser. |
| Capture one region | Selector capture, selector wait | Target a specific page element and wait for it to appear before capturing. |
| Wait for rendering | Navigation wait strategy, delay | Allow client-side rendering or late-loading content to settle before the screenshot. |
| Change page appearance | Dark mode | Capture a page under a dark color scheme when the site supports it. |
| Reduce clutter | Ad blocking, cookie-banner blocking | Request cleaner captures where supported; blocking behavior can vary by site. |
| Alter the page | CSS and JavaScript injection (POST only) | Apply capture-specific styling or page changes without editing the source site. |
| Set regional context | Geolocation, timezone, locale (POST only) | Render pages that vary content by region, time zone, or language settings. |
| Produce a document | PDF options (POST only) | Configure PDF output rather than an image capture. |
For repeated work, the API also documents batch capture at /api/v1/screenshot/batch. Batch requests can reduce client-side orchestration, but the request limits and error behavior for individual items should be confirmed in the current API reference before relying on them.
Local screen capture is a different Rust problem
If the goal is a desktop screenshot rather than a website render, select a crate by operating system and capture target. The reviewed alternatives differ in platform coverage and representation, so check their current crate documentation for exact APIs, permission requirements, and supported environments.
screencapturekit: a Rust binding for Apple ScreenCaptureKit, intended for local screen, window, and app capture. Screenshot support is tied to macOS 14.0-or-later features.miniscreenshot: a modular workspace with encoding utilities and separate Wayland, X11, portal, and rendering integrations. Choose and configure the integration appropriate to the target environment.screen_shot: a display bitmap capture crate. Its documentation notes ARGB pixels and known issues involving error-path memory leaks and channel ordering, which matter when consuming or converting the captured buffer.
These libraries do not replace the hosted REST workflow above when the input is a public website URL and the desired result is a remotely rendered page.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →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
Common problems and practical fixes
401 or 403 response
Check that the key is present, active, and sent in the expected authentication location. The documented POST example uses Authorization: Bearer YOUR_API_KEY; the API also documents an X-API-Key alternative. Avoid logging the secret or committing it to a repository.
The saved file is not a viewable image
The response may be JSON rather than image bytes, particularly with GET’s default JSON response behavior, or may contain an error body. Check the HTTP status and response content type before writing a file. For GET, the docs specify redirect=1 when you want a redirect to the resulting image or PDF.
The page is blank or missing dynamic content
Client-rendered content may not have appeared when the browser captured the page. Use a documented navigation wait strategy, selector wait, or delay as appropriate; wait for a meaningful element rather than choosing an arbitrary long delay when you can. Check that the target URL is publicly reachable from the hosted service and that the page does not require an interactive login or a browser state your request has not supplied.
The target element is absent
Confirm the CSS selector matches the rendered page, not just the source HTML, and configure selector waiting if the element is added asynchronously. If the element is inside a context the capture service cannot access, such as a cross-origin embedded frame, selector capture may not work as expected.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchBest 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.
Full-page output is incomplete
Some pages load images and sections only as the user scrolls. Full-page mode is documented, but that alone does not establish that every lazy-loaded element will be triggered. Try a suitable wait strategy and inspect the result; if complete archival is essential, validate the output against pages that use lazy loading.
Rust compilation or TLS errors
Check that the dependency features shown in the example are enabled and that the project uses a supported Rust toolchain. If your environment cannot build the selected TLS backend, consult the current reqwest documentation for a TLS feature compatible with your platform. This is a client dependency issue, separate from the screenshot API’s response.
Performance, reliability, and cost planning
Remote rendering includes network navigation and browser work, so it is not equivalent to reading a static image from disk. Use explicit, purpose-driven wait conditions; request only the page area and format your workflow needs; and avoid resending identical work unnecessarily if you can safely reuse a prior result. For production capture jobs, apply timeouts and bounded retries in your client, and distinguish transient transport failures from HTTP responses that require correcting the request.
Screenshot API’s pricing page lists Free at $0/month for 500 screenshots, Starter at $19/month for 5,000, and Pro at $59/month for 50,000; the vendor also advertises annual savings on paid tiers, overage billing, and optional SLA terms. Prices and quotas are vendor-published plan details and may change, so confirm the current pricing page before committing to a budget. The service’s own materials describe use cases including full-page archiving, social preview images, URL-to-PDF reports, visual regression checks, competitor or SEO monitoring, and directory thumbnails; those are vendor-presented use cases, not guarantees of a particular result.
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 →Or skip the browser setup
If you want a hosted capture without wiring up a browser yourself, ScreenshotNeo is a website screenshot API and MCP server. Its API accepts one GET request for a URL and returns PNG, JPEG, WebP, or PDF. See the ScreenshotNeo API documentation for the current request parameters.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie and consent banners, newsletter popups, and chat widgets before capture; each of those steps can be disabled. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses include X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo’s free plan.
Frequently Asked Questions
Can I use Screenshot API’s listed Rust crate without writing an HTTP request?
The SDK index lists cargo add screenshot-api, but its Rust-specific documentation and call signatures are not established here. Check the crate’s current documentation before relying on it; the REST example is the verified integration path.
Does a website screenshot API need the target site to be public?
The examples render a URL through a hosted service, so the capture service must be able to reach the page. Private network access, authentication state, or other access restrictions require support expressly documented by the service.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
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.

