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

ScreenshotMachine’s official material documents an HTTP screenshot API called from a shell with curl; it does not document a separate ScreenshotMachine CLI executable. You can run that documented API request in a GitHub Actions workflow, save the returned image as an artifact, and keep the customer key in an Actions secret. The example below adapts ScreenshotMachine’s API request for a workflow; it is not a vendor-published or verified GitHub Action.

Set up the workflow

  1. In your GitHub repository, open Settings → Secrets and variables → Actions, choose New repository secret, and create SCREENSHOTMACHINE_KEY with your ScreenshotMachine customer key. GitHub explains how workflow variables and environment values are configured in its variables documentation.
  2. Create .github/workflows/screenshot.yml in the repository and add the workflow below. It can be started manually from the repository’s Actions tab.
name: Capture website screenshot
on:
  workflow_dispatch:
jobs:
  screenshot:
    runs-on: ubuntu-latest
    steps:
      - name: Request screenshot
        env:
          SCREENSHOTMACHINE_KEY: ${{ secrets.SCREENSHOTMACHINE_KEY }}
        run: |
          set -eu
          curl -fGs "https://api.screenshotmachine.com" 
            --data-urlencode "key=$SCREENSHOTMACHINE_KEY" 
            --data-urlencode "url=https://example.com" 
            --data-urlencode "dimension=1366x768" 
            --data-urlencode "device=desktop" 
            --data-urlencode "format=png" 
            --data-urlencode "cacheLimit=0" 
            --data-urlencode "delay=2000" 
            --data-urlencode "zoom=100" 
            --output screenshot.png
      - name: Upload screenshot
        uses: actions/upload-artifact@v4
        with:
          name: website-screenshot
          path: screenshot.png

The curl command sends a GET request to ScreenshotMachine and writes its response body to screenshot.png. The upload step makes that file available as a workflow artifact after the job completes. The vendor documents the API request and file-output pattern, while GitHub documents workflow syntax and shell steps; this combined YAML is an adapted example, not a claim that the vendor has tested it. See GitHub’s workflow syntax reference.

Adjust the screenshot request

The API example requires key and url. The other parameters below appear in ScreenshotMachine’s documented sample; check its current API reference before relying on accepted values or changing options.

Parameter Example value Effect in this workflow
url https://example.com Page to capture. Replace it with the target URL.
key $SCREENSHOTMACHINE_KEY Account customer key, passed from the Actions secret.
dimension 1366x768 Requested capture dimensions. The vendor’s example also uses 1366xfull for a full-page image; verify accepted values in the current API reference.
device desktop Device setting shown in the vendor example.
format png Image format shown in the vendor example. Keep the filename extension aligned with the requested format.
cacheLimit 0 Cache option shown in the vendor example.
delay 2000 Delay option shown in the vendor example.
zoom 100 Zoom option shown in the vendor example.

All values other than key and url can be omitted or changed to suit the capture, subject to the API’s currently accepted options. --data-urlencode safely encodes parameter values, including URLs with query strings.

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.

Keep the key and output safe

  • Do not put the customer key directly in the YAML, repository, command text, or a logged echo. The environment mapping scopes it to the request step.
  • Use a secret at the appropriate repository or organization level for your project. Do not expose secrets to untrusted pull-request workflows; GitHub restricts secret availability in some forked pull-request contexts.
  • Use a URL you are permitted to capture. The requested page may contain private or sensitive information, and the resulting artifact can be accessed by people with repository permissions.
  • The example uploads the generated image as an artifact. If you only need the file during the job, omit the upload step and add later steps that consume screenshot.png.

Choose curl or a language script

For a single request, curl keeps the workflow short and makes request options visible in YAML. A Python or other language script is useful when the URL, output naming, retries, or downstream processing need program logic. ScreenshotMachine’s official material includes API examples and language sample repositories, but the available sources do not establish current SDK package versions or a vendor-maintained GitHub Action. The request endpoint and parameters still need to follow the API reference.

Troubleshoot failed captures

  • curl exits with an HTTP error: -f makes curl return a failure status for an HTTP error, so GitHub marks the step failed. Check that the secret is configured under the correct repository or organization, that the key is valid, and that the target URL is reachable.
  • The secret appears empty: Confirm the workflow references the exact secret name, SCREENSHOTMACHINE_KEY, and that the secret exists for this repository. Secrets are not necessarily available to workflows triggered from untrusted forks.
  • The file is missing or empty: Check the preceding curl step’s result and response status before attempting artifact upload. Because output is written directly to a file, a failed request should stop the step rather than produce a useful screenshot.
  • The page is incomplete or visually different: Review the target URL and the request’s dimensions, device, delay, and zoom settings. A delay may help with pages that render content after initial load, but the vendor material cited here does not specify a guaranteed rendering time for any particular site.
  • The image format and filename disagree: Keep format and the output extension consistent, then inspect the resulting file if an image viewer cannot open it.

Or skip the browser setup

ScreenshotNeo is a screenshot API and MCP server for developers. Its one-call request can save a screenshot without setting up a browser in the workflow. Cookie banners, newsletter popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 shots a month with no card, and paid plans start at $5 for 3,000 shots.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for request options. ScreenshotNeo also supports PNG, JPEG, WebP, and PDF output, with options for full-page capture, selectors, device sizes, and more. Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Frequently Asked Questions

Is there an official ScreenshotMachine CLI for GitHub Actions?

The official material cited here documents an HTTP API and a curl shell example, not a standalone CLI executable.

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

Can I trigger the workflow automatically instead of manually?

Yes. GitHub Actions supports additional workflow triggers; consult the workflow syntax reference and add the trigger that fits your repository process.

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.
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
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.

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.