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

You can take a ScreenshotMachine screenshot from Linux with Bash and curl, calling its hosted screenshot API. The documented workflow is not an installed ScreenshotMachine CLI executable: it sends an HTTP GET request and saves the response locally. You need a ScreenshotMachine customer key and the URL to capture.

Take a ScreenshotMachine screenshot from Linux

Save this as screenshot.sh. Replace the customer-key placeholder and set the target URL and capture options. The request uses --data-urlencode so that characters in the URL and other parameter values are encoded for the query string.

#!/usr/bin/env bash
set -euo pipefail

CUSTOMER_KEY="PUT_YOUR_CUSTOMER_KEY_HERE"
SECRET_PHRASE="" # Leave empty if not configured.
URL="https://www.google.com"
DIMENSION="1366x768"
DEVICE="desktop"
FORMAT="png"
CACHE_LIMIT="0"
DELAY="2000"
ZOOM="100"

ARGS=(
  --data-urlencode "key=$CUSTOMER_KEY"
  --data-urlencode "dimension=$DIMENSION"
  --data-urlencode "device=$DEVICE"
  --data-urlencode "format=$FORMAT"
  --data-urlencode "cacheLimit=$CACHE_LIMIT"
  --data-urlencode "delay=$DELAY"
  --data-urlencode "zoom=$ZOOM"
  --data-urlencode "url=$URL"
)

if [[ -n "$SECRET_PHRASE" ]]; then
  HASH=$(printf '%s' "$URL$SECRET_PHRASE" | md5sum | cut -d ' ' -f 1)
  ARGS+=(--data-urlencode "hash=$HASH")
fi

curl -G -s "https://api.screenshotmachine.com" "${ARGS[@]}" > output.png

The endpoint, GET request, parameters, optional hash, and output redirection follow ScreenshotMachine’s screenshot API documentation. The strict Bash settings are a script adaptation, not a ScreenshotMachine requirement. Make the script executable and run it:

chmod +x screenshot.sh
./screenshot.sh

The response is written to output.png. A successful curl process does not by itself prove that the file contains a screenshot: ScreenshotMachine may return an error image. Check the response as described under troubleshooting.

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.

Choose dimensions, format, and capture behavior

ScreenshotMachine documents the following parameters and defaults. Verify the live API guide for current accepted values before relying on them in a production script.

Parameter Purpose and documented values
key Your required customer API key.
url The required page URL. The API documentation recommends percent-encoding it; curl --data-urlencode does that for the example.
dimension Viewport width and height in [width]x[height] form. The documented default is 120x90; width ranges from 100 to 1920 and height from 100 to 9999. Use full for full-page height.
format Output image format: jpg, png, or gif. Documented default: jpg.
cacheLimit Cache age in days, documented from 0 to 14, with a default of 14. Set it to 0 to request a fresh screenshot. The guide also describes fractional-day values for shorter intervals.
delay Wait before capture, in milliseconds. Documented choices run from 0 to 10000 in listed increments; the default is 200 ms. A longer delay can give animations or late content more time to appear.
zoom Scale from 10 to 400 percent; documented default: 100. ScreenshotMachine says 200 or higher can produce a retina-style, larger image. Zoom is ignored below typical device dimensions.
device The sample uses desktop. Consult the API guide’s device description for currently supported values rather than assuming a device list.

For a normal viewport, set a width and height such as 1366x768. For a full-page capture, use DIMENSION="full"; the requested output height can then differ from a fixed viewport. Choose PNG when you need that format, or JPG when its smaller, lossy image is acceptable. GIF is also listed as an accepted format. Set CACHE_LIMIT="0" when you need a new capture instead of a cached one; otherwise the documented default allows cache use for up to 14 days. Increase DELAY when a page needs extra time to render, bearing in mind that a delay adds waiting time to each request.

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.

Handle API keys and the optional hash

Keep the customer key and any secret phrase in server-side configuration, not in a public repository or browser code. When a secret phrase is configured, ScreenshotMachine documents a hash made by calculating the MD5 digest of the URL value concatenated with the secret phrase. The sample computes that value with Linux md5sum and adds it to the request. According to the vendor, calls with a missing or incorrect hash are ignored after a phrase is configured. The hash check does not make it safe to publish the underlying key or secret phrase.

If the target URL changes, calculate the hash using that exact URL value plus the secret phrase. Leave SECRET_PHRASE empty when no phrase is configured.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

Troubleshoot an unexpected file or failed capture

ScreenshotMachine documents an X-Screenshotmachine-Response header and error codes. Invalid or incomplete calls may also return an image containing an error message, so inspect the response rather than relying only on the shell exit status.

Response code What to check
missing_key, invalid_key Confirm that CUSTOMER_KEY contains the correct customer key and is being passed as key.
missing_url, invalid_url Check that URL is present and valid. Keep --data-urlencode so query strings and reserved characters are encoded correctly.
invalid_hash If a secret phrase is enabled, verify that the hash uses the exact URL value followed by the configured phrase. If no phrase is configured, omit the hash.
no_credits Check the account’s available credits.
invalid_selector, invalid_crop If using selector or crop options beyond this example, review those values against the API documentation.
system_error Retrying may help, but the documented error code alone does not identify a specific cause; verify the request and consult the vendor’s current guidance.

To capture the response header for diagnosis, add -D response-headers.txt to the curl command. For example, replace its final line with:

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
curl -G -s -D response-headers.txt "https://api.screenshotmachine.com" "${ARGS[@]}" > output.png

Then inspect response-headers.txt for X-Screenshotmachine-Response. If the file is not the expected image, also verify the requested format and whether an error image was returned.

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

Use the separate PDF endpoint for a PDF

Website-to-PDF conversion is a distinct ScreenshotMachine API, not an image-format setting on the screenshot endpoint. Its Bash example uses https://pdfapi.screenshotmachine.com and PDF-specific parameters such as paper size, orientation, media, background, delay, and scale. See the vendor’s PDF API documentation for its exact request options and use that endpoint when the required output is a PDF.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

Or skip the browser setup

If you want a screenshot API with a single GET request rather than wiring up browser automation, ScreenshotNeo returns a PNG, JPEG, WebP, or PDF from a URL. For example, this cURL request saves a WebP capture:

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 options. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. ScreenshotNeo also has an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents. Its free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo free: 1,000 screenshots a month, no card required.

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.

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.