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

PowerShell can call any screenshot API that exposes HTTP. Use Invoke-WebRequest when the endpoint returns image bytes, or Invoke-RestMethod when it returns JSON. Keep your key in an environment variable, URL-encode GET parameters, and verify both the HTTP response and the page-status field before treating the file as a valid capture.

This guide shows raw-image, JSON, module, full-page, element, authenticated, batch, and troubleshooting patterns. Examples use provider-documented parameter names; adjust them to the API you select.

What you need before starting

  • PowerShell 5.1 on Windows or PowerShell 7+ on Windows, macOS, or Linux.
  • An account and API key for a screenshot service.
  • A target URL that the capture service can reach. Private localhost pages normally require a tunnel or an accessible test environment.
  • A writable output directory.

Store the key outside the script. For a temporary session:

$env:SCREENSHOT_API_KEY = 'replace-with-your-key'

For production automation, use your CI/CD secret store, Windows Credential Manager, Azure Key Vault, or another secret manager. Do not commit keys or put them in a URL that may be logged.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • 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.

Pattern 1: save raw image bytes with Invoke-WebRequest

screenshot-api.net documents a single HTTP GET that returns raw image bytes; it has no SDK to install. Invoke-WebRequest -OutFile writes those bytes directly.

$apiKey = $env:SCREENSHOT_API_KEY
$target = 'https://example.com'
$outFile = Join-Path $PWD 'shot.png'

$query = @{
    url       = $target
    format    = 'png'
    full_page = 'true'
    width     = 1280
    height    = 800
}
$headers = @{ Authorization = "Bearer $apiKey" }

try {
    $response = Invoke-WebRequest `
        -Uri 'https://screenshot-api.net/v1/screenshot' `
        -Headers $headers `
        -Body $query `
        -Method Get `
        -OutFile $outFile `
        -PassThru

    if ($response.StatusCode -lt 200 -or $response.StatusCode -ge 300) {
        throw "HTTP status $($response.StatusCode)"
    }
    "Saved $outFile"
}
catch {
    throw "Screenshot request failed: $($_.Exception.Message)"
}

When PowerShell builds a GET request from a hashtable, it encodes the query values. If you construct the URL yourself, encode the target URL, especially when it already contains ?, &, or non-ASCII characters.

Check the rendered document, not only transport status

A service can return HTTP 200 while rendering a login, access-denied, or application error page. Where the provider exposes it, inspect X-Page-Status (and any equivalent document-status field) before publishing the image. A 401 or 403 document status means the capture is a login or error page, not the intended content.

$pageStatus = $response.Headers['X-Page-Status']
if ($pageStatus -and $pageStatus -notmatch '^(200|ok)$') {
    Remove-Item $outFile -ErrorAction SilentlyContinue
    throw "Rendered page status was $pageStatus"
}

Pattern 2: parse a JSON response with Invoke-RestMethod

Screenshot API documents GET and POST requests, bearer or X-API-Key authentication, JSON by default, and redirect=1 when you want a redirect to the image or PDF.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
$apiKey = $env:SCREENSHOT_API_KEY
$payload = @{
    url      = 'https://example.com'
    format   = 'png'
    fullPage = $false
} | ConvertTo-Json

$result = Invoke-RestMethod `
    -Uri 'https://api.screenshot-api.org/api/v1/screenshot' `
    -Method Post `
    -Headers @{ Authorization = "Bearer $apiKey" } `
    -ContentType 'application/json' `
    -Body $payload

$result | ConvertTo-Json -Depth 10

Inspect the returned schema before writing a file. Providers may return an image URL, a base64 field, job metadata, or another structure. Never assume a property named url or image exists.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 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.

Download a returned image URL

if ($result.imageUrl) {
    Invoke-WebRequest -Uri $result.imageUrl -OutFile (Join-Path $PWD 'shot.png')
}
elseif ($result.imageBase64) {
    [IO.File]::WriteAllBytes(
        (Join-Path $PWD 'shot.png'),
        [Convert]::FromBase64String($result.imageBase64)
    )
}
else {
    throw 'Response contained neither a documented image URL nor base64 image data.'
}

Use the provider’s actual property names. If you request redirect=1, handle the final response as an image or PDF download rather than JSON.

Capture controls that matter

Viewport versus full page

width and height define the browser viewport. full_page=true captures the scrollable document when supported. A full-page image can be very tall; use a normal viewport for above-the-fold monitoring.

Format, quality, and scale

PNG preserves lossless pixels and is useful for text comparison. JPEG and WebP reduce file size; quality controls affect artifacts. screenshot-api.net documents default width 1280 CSS pixels, default height 800, maximum width 3840, maximum height 4320, default quality 85, scale from 0.1 to 3, and a 25-second default timeout. These are provider parameters, not industry-wide limits.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
$query = @{
    url       = 'https://example.com'
    format    = 'webp'
    quality   = 85
    scale     = 2
    width     = 1440
    height    = 900
    full_page = 'false'
    delay     = 1500
}

Late content, dark mode, and device scale

Use a delay or provider wait condition for JavaScript-rendered content. Dark-mode and device-scale options let you generate visual variants; keep those settings fixed in regression tests so comparisons remain meaningful.

Authenticated pages

When supported, send narrowly scoped cookies, request headers, or basic-auth credentials. Prefer an authorization header over query-string credentials, redact logs, and use a short-lived test account. Confirm that the captured document is authenticated rather than a sign-in page.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • 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.

Element screenshots

screenshot-api.net accepts a CSS selector and returns a 400 no_element error when nothing matches. First confirm the page loads, then verify the selector in the same viewport and state used by the API.

Batch and visual-regression workflows

Screenshot API documents batch capture, while screenshot-api.net documents comparison, baseline, and scheduled visual checks. For repeatability, pin viewport, scale, color scheme, delay, fonts, and test data; retain the request parameters beside each artifact.

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

Direct REST call or a PowerShell module?

Concern Direct HTTP Vendor module
Installation Built into PowerShell; no package dependency Install and maintain a module
Portability Works across PowerShell editions when the API is reachable Depends on module compatibility and dependencies
Feature coverage Expose every documented API parameter immediately Limited to what the module version surfaces
Response handling You control byte, JSON, redirect, and error parsing Cmdlets may simplify parsing but impose a response shape
Version control Pin endpoint behavior in your script Pin and audit module versions

The direct REST approach is the most portable baseline. A module can improve discoverability for a team that prefers cmdlet help, but it couples scripts to that vendor’s package surface.

Installing the documented module

Install-Module ScreenshotAPI -Scope CurrentUser
Import-Module ScreenshotAPI
Get-Command -Module ScreenshotAPI
Get-Help <command-name> -Full

The cited SDK page confirms module availability but does not specify capture cmdlet names or signatures. Do not invent them; discover the installed commands with Get-Command and verify parameters with Get-Help. Keep the HTTP pattern as a fallback.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One GET request returns PNG, JPEG, WebP, or PDF. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response reports the result in X-Page-Verdict and X-Billed headers.

PowerShell can call it directly:

$q = @{
    access_key = $env:SCREENSHOTNEO_API_KEY
    url        = 'https://stripe.com'
}
Invoke-WebRequest -Uri 'https://api.screenshotneo.com/v1/shot' -Method Get -Body $q -OutFile 'shot.webp'

See the complete parameter reference in the ScreenshotNeo documentation. Available controls include full-page capture with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets or custom viewports, retina scale, PDF paper size/margins/landscape/page ranges, HTML/CSS rendering, custom JavaScript and CSS, pre-capture clicks, hidden selectors, waits for selectors/delay/network idle, blocking ads/trackers/requests/resource types, custom headers/cookies/user agents/Authorization, timezone and geolocation, transparent backgrounds, resizing, selectable-TTL caching, signed public-image links, asynchronous jobs with signed webhooks, bulk capture of 100 URLs per call, a usage API, and an OpenAPI specification. Common parameter names used by other screenshot APIs also work, easing migration.

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.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • 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

ScreenshotNeo also provides take_screenshot, get_page_info, and capture_pdf through MCP for Claude, Cursor, and other MCP clients. Every feature is available on every plan: 1,000 shots per month free with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

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

Troubleshooting checklist

401 or 403

Check the key, header spelling, account permissions, and endpoint. If the transport succeeds but the page status is 401/403, the target rendered an access page; supply valid, scoped credentials or choose a public test URL.

The output is JSON, not an image

You called a JSON endpoint or omitted a redirect option. Use Invoke-RestMethod, inspect the schema, then download the documented URL or decode the documented base64 field.

The file is empty or unreadable

Check HTTP status before trusting the file, ensure the output directory is writable, and confirm the response content type. A text error body saved with a .png extension is not a screenshot.

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

Missing selector

Verify spelling, wait for client-side rendering, and test the selector in browser developer tools. For screenshot-api.net, no match produces 400 no_element.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 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.

Timeout or incomplete page

Increase the provider timeout where allowed, add a delay or network-idle wait, reduce full-page complexity, and block unnecessary third-party resources. A longer wait increases latency and may increase provider usage.

PowerShell encoding or URL errors

Use a hashtable with -Body for GET parameters or explicitly URL-encode values. In JSON requests, set -ContentType 'application/json' and serialize with ConvertTo-Json.

Operational guidance

  • Set explicit timeouts and retry only transient network failures; do not blindly retry authentication or validation errors.
  • Use deterministic URLs, data, viewport, fonts, and wait conditions for visual tests.
  • Log request IDs, status codes, document verdicts, and timing, but never log API keys or session cookies.
  • Keep originals in a content-addressed or date-stamped location and record the capture parameters beside them.
  • Estimate cost from successful, billable captures and understand whether your provider bills failed, cached, or blocked requests.

Frequently Asked Questions

Can I call a screenshot API from Windows PowerShell 5.1?

Yes. Invoke-WebRequest and Invoke-RestMethod are available in Windows PowerShell 5.1; use provider-supported TLS and authentication settings.

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

How do I know whether an image shows the real page?

Check the HTTP status, content type, and the provider’s document-status field such as X-Page-Status. A successful HTTP response can still contain a login or error page.

Should I send an API key in the query string?

Prefer an Authorization or X-API-Key header. Query strings can appear in shell history, proxy logs, and monitoring systems.

What is the simplest format for visual regression tests?

Use fixed PNG output, viewport dimensions, scale, color scheme, waits, and test data; then compare each new capture with a stored baseline.

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.

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