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

To automate ScreenshotAPI.net captures with cron, write a script that makes one screenshot request and exits, then schedule that script on a server that stays available. The API documents a GET endpoint at https://shot.screenshotapi.net/v3/screenshot; cron supplies the recurring timing. If you do not want to maintain a host and script, ScreenshotAPI.net also offers recurring jobs configured in its dashboard.

How the cron setup works

Cron does not keep a screenshot session running. It starts your program at the times in its schedule; each run should make one API request, save the response, record whether the run succeeded, and exit. This separation lets you choose the capture cadence independently of the capture code.

  1. Create a server-side script that calls ScreenshotAPI.net’s screenshot endpoint with your API token and target page URL.
  2. Run the script manually on the machine that will host it, and verify the HTTP response and saved file.
  3. Add a cron entry using absolute paths and an explicitly configured environment.
  4. Check the output and logs after the first scheduled run.

Create a one-shot Python capture script

ScreenshotAPI.net documents GET https://shot.screenshotapi.net/v3/screenshot, with token for the API key and url for the page to render. The following script makes one request, checks for an HTTP error, and writes a timestamped image so a later run will not overwrite it. Install the dependency with python3 -m pip install requests, then save this as capture.py:

import os
from datetime import datetime, timezone
from pathlib import Path
from urllib.parse import urlencode

import requests

API_TOKEN = os.environ["SCREENSHOTAPI_TOKEN"]
TARGET_URL = os.environ.get("TARGET_URL", "https://example.com")
OUTPUT_DIR = Path(os.environ.get("OUTPUT_DIR", "/var/tmp/screenshotapi"))

OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
stamp = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
output_path = OUTPUT_DIR / f"capture-{stamp}.png"

params = {"token": API_TOKEN, "url": TARGET_URL}
request_url = "https://shot.screenshotapi.net/v3/screenshot?" + urlencode(params)
response = requests.get(request_url, timeout=120)
response.raise_for_status()
output_path.write_bytes(response.content)
print(f"Saved capture to {output_path}")

The endpoint’s render documentation describes additional capture options; add only parameters supported by the current API documentation and your use case. This minimal example assumes the response body is the image to save. If you request another output format, use a matching file extension and confirm the response handling for that format.

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 token private

The token parameter authenticates the request. Do not put it in browser-side JavaScript or commit it to a public repository. Supply it to the server-side process through a protected environment configuration or secret manager. The script above intentionally reads it from SCREENSHOTAPI_TOKEN rather than embedding the credential in source code.

Test before scheduling

From the same account and server that cron will use, set the required environment variables and run the script directly. Confirm that it exits successfully and creates a non-empty image file. This catches token, URL encoding, network access, output-directory permissions, and dependency problems before cron is involved.

export SCREENSHOTAPI_TOKEN='your-token'
export TARGET_URL='https://example.com'
export OUTPUT_DIR='/var/tmp/screenshotapi'
/usr/bin/python3 /path/to/capture.py

Use your actual token and target URL; avoid pasting a live credential into shell history on a shared system. If your output directory is meant to retain a long history, plan how files will be archived or removed so recurring runs do not fill the disk.

Schedule the script with cron

ScreenshotAPI.net’s tutorial gives this example for a daily run at 08:00:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.
0 8 * * * /usr/bin/python3 /path/to/capture.py

The five fields are minute, hour, day of month, month, and day of week. In this example, 0 8 * * * means minute zero of hour eight, every day according to the cron daemon’s timezone. The vendor example does not establish timezone behavior for every server; check the host’s cron configuration if the capture must align with a particular local time.

Use the crontab editor for the account that should run the job:

crontab -e

A more operationally explicit entry sets the working directory, supplies variables, and sends output to a log:

0 8 * * * cd /path/to/job && SCREENSHOTAPI_TOKEN='your-token' TARGET_URL='https://example.com' OUTPUT_DIR='/var/tmp/screenshotapi' /usr/bin/python3 /path/to/capture.py >> /var/log/screenshotapi-capture.log 2>&1

Protect the crontab and log because the command contains a credential and the log may contain operational details. Alternatively, load secrets from a protected environment file or secret manager rather than writing them directly into the crontab. Cron commonly runs with a smaller environment than an interactive shell, so use absolute paths for the interpreter, script, and output locations, and explicitly configure any variables the script needs.

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.

Choose your capture cadence

The cited vendor cron example is daily at 08:00. A different cadence changes how often your script makes requests and how many files your storage accumulates. Set the schedule to match how often the page changes and the limits that apply to your account; the cited vendor pages do not establish current account-specific quotas.

Managed ScreenshotAPI.net schedules are described as hourly, daily, weekly, monthly, or custom. For self-hosted cron, choose a valid cron expression for your operating system and verify the next-run behavior on that host rather than assuming the dashboard’s presets map exactly to local cron.

Use ScreenshotAPI.net’s managed scheduler instead

If you would rather not keep a server-side cron job, ScreenshotAPI.net documents a recurring scheduler configured from its dashboard. Open Query Builder, enter the target URL, choose capture settings, and select the scheduled screenshot option with a preset or custom cron expression. Manage the resulting job under Schedule Requests, where the documented controls include start, stop, delete, and viewing screenshots. The service says managed captures run automatically and are stored for later review.

Stopping a job pauses future captures while keeping the job. Deleting it permanently removes screenshots associated with it, according to the vendor’s scheduling documentation. Download any captures you need to preserve before deleting a job. The reviewed documentation does not establish timezone semantics, retry behavior, failure alerts, or current account limits, so verify those details in your dashboard or with the vendor if they are requirements.

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

Self-hosted cron or managed scheduling?

Consideration Self-hosted cron ScreenshotAPI.net managed schedule
Where it runs Your server’s cron daemon runs the script. ScreenshotAPI.net runs the recurring job through its service.
Operations you own Host availability, script, secrets, logs, and output/storage handling. Job setup and control through the dashboard; the service stores managed screenshots for review.
Integration and control The script can feed your own server-side processing and storage. Less infrastructure to maintain for recurring captures managed in the dashboard.
Best fit You already have an always-on host or need capture files to flow into your own systems. You want scheduled captures without maintaining your own recurring runner.

This is a workflow distinction, not a performance comparison. The right choice depends on whether you prefer to operate the runner and outputs yourself or manage recurring jobs in the vendor’s dashboard.

Reliability, security, and cost considerations

  • Host availability: A self-hosted job can only run when its server and cron service are available. A personal computer that sleeps or is turned off is not a reliable scheduler.
  • Logs and exit status: Redirect output to a log or use your system’s job monitoring so you can diagnose failures. The vendor sources do not document cron-side retries.
  • Unique output names: Use timestamps or another unique identifier. ScreenshotAPI.net warns in its rendering documentation that reusing a non-unique result filename can overwrite an existing file.
  • Slow or dynamic pages: If a page has not finished rendering when captured, review the documented wait and delay controls before simply increasing the schedule frequency.
  • Request volume and storage: More frequent captures mean more requests and, for local output, more stored files. Check the limits and retention needs that apply to your account and infrastructure.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting cron captures

The script works in a terminal but not from cron

Cron may use a different working directory and environment from your login shell. Set the working directory explicitly, use absolute paths, and provide required variables such as SCREENSHOTAPI_TOKEN, TARGET_URL, and OUTPUT_DIR. Redirect standard output and errors to a log to see the actual failure.

The request is rejected or returns an HTTP error

Check that the token is valid and supplied as the documented token parameter, that the target URL is correctly encoded, and that the host can reach the API endpoint. The example raises an error for unsuccessful HTTP responses; inspect the response details without recording or exposing the token.

No image appears or the file is empty

Check the process exit status, output directory permissions, available disk space, and log output. Confirm that the response body is the requested output format and that the script’s extension matches it. If a page is dynamic, investigate the API’s rendering wait or delay options.

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.

Older captures disappear

A reused filename can overwrite a prior result. Use unique names, as in the timestamped Python example, or write to a storage system that versions files.

The schedule runs at an unexpected hour

Verify the host’s timezone and cron daemon configuration. The vendor documentation reviewed here does not establish a universal timezone rule for its managed scheduler, either; confirm the account’s behavior in current vendor guidance.

Or skip the browser setup

ScreenshotNeo offers a one-call screenshot API, so you can avoid maintaining a browser capture setup yourself. Its call accepts a URL and returns an image or PDF; see the ScreenshotNeo API documentation for request options.

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

ScreenshotNeo accepts cookie banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers indicate the page verdict and billing status. It also has an MCP server for AI agents, with tools for screenshots, page information, and PDFs. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Visit ScreenshotNeo or sign up free for 1,000 screenshots a month, with no card.

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

Frequently Asked Questions

Do I need to keep my computer on for scheduled screenshots?

For self-hosted cron, the machine running cron must be on and reachable at the scheduled time. ScreenshotAPI.net’s managed scheduler runs through its service instead of your own computer.

Does cron use my local timezone?

A cron daemon generally follows its host configuration, but verify the timezone on the machine running your job. ScreenshotAPI.net’s reviewed scheduler documentation does not establish its managed jobs’ timezone behavior.

Can I pause a ScreenshotAPI.net managed schedule without losing its screenshots?

Yes. The documentation distinguishes stopping, which pauses future runs, from deleting, which permanently removes the job’s related screenshots.

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.