ScreenshotNeo

BlogHow-to

How to Take Scheduled Website Screenshots with HTMLCSStoImage

Schedule HTMLCSStoImage captures by pairing its per-request screenshot API with cron, a scheduled workflow, or an automation service.

By the ScreenshotNeo team4 October 202610 min read

To take scheduled website screenshots with HTMLCSStoImage, schedule a job that sends a capture request to its API. The screenshot endpoint creates an image for each request; the recurring schedule belongs in cron, a scheduled workflow, or an automation service. The reviewed documentation describes per-request captures and automation integrations, not a recurring schedule built into the screenshot endpoint.

The flow is: scheduler trigger → authenticated request to https://hcti.io/v1/image → save or record the returned image. This guide uses a public webpage URL. The API uses HTTP Basic authentication with your API ID as the username and API key as the password. [URL to Image API docs · API keys and authentication]

1. Choose the recurring trigger

Choose a scheduler that can make an HTTP request or run a script. A server cron job or scheduled workflow gives you direct control over code and storage. HTMLCSStoImage also lists n8n, Zapier, and Make as automation options; check the chosen service’s current plan and documentation for its recurrence, timezone, secrets, retry, and run-log behavior. [HTMLCSStoImage URL to Image docs]

Approach Good fit Decide before relying on it
Cron or scheduled workflow Code-first teams that want control of request handling and archive storage. Where it runs, trigger timezone, missed-run behavior, and how secrets and logs are managed.
Automation platform A no-code or low-code flow, especially when a capture should trigger other steps. Whether your selected plan supports the recurrence, timezone, retries, URL iteration, credential vault, and destination you need.

Define the cadence and timezone in the scheduler. The API’s timezone option changes the browser’s rendering timezone; it does not set when the scheduler runs. Decide whether each scheduled run captures one page or iterates over a list. For a list, record success or failure per URL so one failure does not hide the status of the rest.

2. Prepare credentials and destination

  1. Create or retrieve the HTMLCSStoImage API ID and secret API key from the account dashboard. Use a key with only the permissions the job needs.
  2. Store both values in the scheduler’s secret store or a server-side environment configuration. Do not put the key in browser JavaScript, a public repository, or a command saved in shared shell history.
  3. Choose whether the workflow keeps the returned image URL or downloads the image into storage you control. The API returns an image URL; the docs say image URLs remain available while the account is active, so use your own archive when you need retention tied to your storage policy. [API key permissions · URL to Image API docs]

3. Make one capture request

First make one request manually or from a short-lived server-side script. Confirm the target is publicly reachable and that the result has the desired viewport, page height, and timing before adding the recurrence.

cURL

export HCTI_API_ID='YOUR_API_ID'
export HCTI_API_KEY='YOUR_API_KEY'
curl --fail-with-body -X POST 'https://hcti.io/v1/image' \
  -u "$HCTI_API_ID:$HCTI_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://example.com","full_screen":true}'

The response includes the generated image URL. Inspect the response and use its actual URL field in your workflow; download that URL if you need a local copy. Confirm the response shape against the current API docs before building a parser around it.

Python

import os
import requests

api_id = os.environ["HCTI_API_ID"]
api_key = os.environ["HCTI_API_KEY"]
response = requests.post(
    "https://hcti.io/v1/image",
    auth=(api_id, api_key),
    json={"url": "https://example.com", "full_screen": True},
    timeout=60,
)
response.raise_for_status()
result = response.json()
print(result)

Install the dependency with python -m pip install requests. This prints the response so you can identify the returned image URL according to the current response schema.

Node.js

const apiId = process.env.HCTI_API_ID;
const apiKey = process.env.HCTI_API_KEY;
if (!apiId || !apiKey) throw new Error('Missing HCTI credentials');

const response = await fetch('https://hcti.io/v1/image', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${Buffer.from(`${apiId}:${apiKey}`).toString('base64')}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ url: 'https://example.com', full_screen: true }),
  signal: AbortSignal.timeout(60_000),
});
const body = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${body}`);
console.log(body);

These examples send one API request. The scheduler repeats the script or request at the cadence you configure.

4. Set capture options for the page

Start with the smallest set of options that meets the screenshot’s purpose. These are documented URL capture controls; check the parameter reference for accepted values and plan restrictions before depending on an option. [URL to Image parameters]

Need Option Use and edge case
Capture the whole page full_screen: true Captures the full page height. Very long pages may need extra rendering time so lazy-loaded content can appear.
Capture a specific region selector: "CSS selector" Crops to the matching element. A selector that matches nothing can produce an unusable result; validate it after page redesigns.
Wait for page scripts ms_delay, max_wait_ms Add a delay or set the maximum wait. Docs describe max_wait_ms from 500 to 10,000 milliseconds; a fixed delay adds time to every capture.
Wait for a page-controlled signal render_when_ready: true For URL captures, the page can signal readiness by adding an element with ID HCTIReadyNow. The ScreenshotReady() helper is for HTML-to-image rendering and is not available for URL-to-image because the service does not control the page.
Set browser dimensions viewport_width, viewport_height Set both dimensions when using either. Mobile, touch, and landscape emulation options are also documented.
Choose browser rendering context media_type, timezone media_type selects screen or print CSS. timezone sets the browser timezone using an IANA name such as America/New_York; it does not affect the trigger time.
Other documented controls format, transparent_background, request_overrides Formats include PNG, JPG, WebP, and PDF. Request overrides can block matching browser requests and are documented as a paid-plan feature. Check current docs and account limits.

For JavaScript-heavy pages, first try a modest ms_delay; if you control the site, a readiness marker can avoid guessing. A scheduler cannot make a private or authenticated page publicly accessible. The dossier supports capture of public URLs; verify current vendor support and configuration before designing a workflow around private pages.

5. Add a recurring schedule

For a Unix-like host, save the Python script as capture.py, configure the two credentials in the host’s protected environment, then add a cron entry. This example runs daily at 08:30 in the cron host’s configured timezone:

30 8 * * * /usr/bin/python3 /opt/jobs/capture.py >> /var/log/site-capture.log 2>&1

Use the absolute path to the script and interpreter. Confirm the host’s timezone and how daylight-saving transitions are handled; cron timezone behavior depends on the host and its configuration. For a managed scheduler or workflow, configure the recurrence and timezone in that product’s interface, then point it at the same server-side script or HTTP request. Do not assume every integration offers the same schedule controls.

For multiple pages, keep the URL list in configuration or a data store rather than duplicating credentials and scripts. Process each URL independently, attach a timestamp to each result, and record failures separately. Keep a concurrency limit appropriate for your account and target sites; the dossier does not establish a universal API throughput figure.

6. Save results and make the job reliable

  • Record each run: save the scheduled timestamp, target URL, HTTP status, response body or parsed image URL, and final storage location.
  • Handle errors deliberately: treat 401 and 403 as configuration or permission errors; fix credentials or permissions before retrying. For 429, inspect the response to distinguish image-credit limits from API throttling. The documented causes have different remedies.
  • Retry transient failures: use a bounded retry policy with increasing delay for temporary network or server errors. Avoid retrying invalid credentials or a confirmed plan limit on every scheduler tick.
  • Prevent duplicate archives: use the scheduled run identifier or a timestamped object name. If a run can overlap its next trigger, use a lock or queue so jobs do not overwrite each other’s output.
  • Alert on missed or repeated failures: use the scheduler’s available logs and notifications. Verify the specific scheduler’s behavior and retention on your plan.
  • Check output before treating it as a valid snapshot: a successful HTTP request alone does not prove that a dynamic page finished rendering or that a selector still matches.

HTMLCSStoImage documents 401 for missing or invalid credentials, 403 for insufficient permissions, and 429 for image-credit limits or API throttling. For throttling, its rate-limit guide recommends waiting 60 seconds before retrying the affected management operation; image-credit exhaustion requires checking usage, billing period, or plan rather than repeatedly retrying. [Using the API · Rate and usage limits]

7. Troubleshooting

Symptom Likely cause Fix
401 Unauthorized API ID or key is missing, invalid, or incorrectly paired. Check the scheduler’s secret values and Basic auth configuration. Rotate a key if it was exposed.
403 Forbidden The key lacks permission for the requested operation. Review key permissions and grant only the required access.
429 response Image credits are exhausted, or a throttled operation exceeded its limit. Read the error body and inspect account usage. Wait before retrying a throttled operation; address the plan limit for exhausted credits.
Image is blank or incomplete The page may need more time, rely on JavaScript, or defer content until scrolling. Try a delay, the readiness marker where supported, or full-page capture. Confirm the target is publicly reachable and inspect the page itself.
Wrong crop or selector error The CSS selector no longer matches after a site change. Test the selector against the current page and update it. Add a check for the expected output dimensions or content.
Scheduler runs at the wrong local time Trigger timezone differs from browser rendering timezone or host timezone. Configure the scheduler timezone explicitly when available and check host timezone behavior. The API timezone option only sets the browser’s timezone.
Image link later unavailable The workflow relies only on the returned URL and account availability. Download the generated file into storage you control if archival retention is required.
Runs are duplicated or overwrite files Triggers overlap or filenames are reused. Use unique run timestamps or IDs and prevent overlapping execution with a lock or queue.

8. Performance, reliability, and cost

Capture cost and runtime scale with scheduled frequency and the number of URLs: estimate monthly requests as runs per day × days in the billing period × URLs per run. Each request also takes time to render and download, so keep delays limited to what the page needs and account for longer pages or slow resources. No benchmark or universal render time is established by the reviewed sources.

Monitor account usage and the scheduler’s run history. HTMLCSStoImage says image creation consumes image credits and that exceeding the allowance can produce a 429; check the account dashboard and current plan for limits rather than assuming that retries are free or that a failed scheduled run will be rescheduled automatically. Store images in a destination suitable for the retention period you need. The API docs describe storage destinations as an option on qualifying plans; verify current availability for your account. [Rate and usage limits · Create and render options]

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One GET request captures a URL as PNG, JPEG, WebP, or PDF. Its clean-shot flow accepts cookie and consent banners like a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Only clean shots are billed: bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, with the page verdict and billing status in response headers. An MCP server gives AI agents tools for screenshots, page information, and PDF capture.

See the ScreenshotNeo API docs. Example request:

cURL

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

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Cookie banners, popups, and chat widgets are removed before the shot. Bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for free and capture 1,000 screenshots a month with no card.

FAQ

Can HTMLCSStoImage take screenshots automatically on a schedule?

The API renders when a request arrives. Use an external recurring trigger to send that request; the reviewed docs do not establish a recurring schedule in the capture endpoint.

Does the scheduler timezone change the webpage’s displayed time?

No. Configure the trigger’s timezone in the scheduler. The API’s timezone parameter sets the browser rendering timezone.

Can I schedule a screenshot of a page behind a login?

The cited URL-to-image material specifies a public URL. Do not assume private-page access works without verifying supported authentication and configuration with the current docs.

Should I keep the image URL or download the file?

Keep the URL for convenient access while the account remains active. Download or configure a storage destination when you need an archive under your own retention policy.