ScreenshotNeo

BlogHow-to

How to Take Scheduled Screenshots of an Indian Ecommerce Website with APITemplate.io

Schedule browser screenshots of an Indian ecommerce site with Playwright, then use APITemplate.io separately if you need a designed image from data.

By the ScreenshotNeo team4 October 202611 min read

Direct answer: use a browser automation script such as Playwright to open the live storefront and capture its rendered page, then run that script on a recurring schedule supplied by cron or another scheduler. APITemplate.io can be a separate step if you also need to generate a designed image from template data. Its documented image-generation API creates images from templates and supplied values; the cited documentation does not establish arbitrary live-URL browsing or a native recurring screenshot calendar. APITemplate.io image-template documentation · REST API reference.

1. Choose the page and capture context

Decide exactly what each run should capture: a homepage, product detail page, search results, or another public page. Use a stable URL and record it with each image. For an Indian storefront, verify the intended language, currency, delivery region, and session or consent state on the actual site. The same URL can render differently depending on those inputs. This guide does not assume how any particular merchant behaves.

Choose the output view deliberately:

  • Viewport screenshot: captures the visible browser area. Useful for consistent visual checks and smaller files.
  • Full-page screenshot: captures the page beyond the initial viewport. Useful for product pages and long category pages, but may be tall and can expose content loaded during scrolling.
  • Element screenshot: captures one selected element, such as a product card or price panel. The selector must match an element that exists when capture runs.

Keep viewport dimensions, device scale factor, locale, timezone, and any region-related browser state consistent between runs. Otherwise, a screenshot difference may reflect changed capture conditions rather than a storefront change.

2. Capture the live page with Playwright

Playwright documents viewport, full-page, and element screenshots. Install it on a machine or container that can run scheduled jobs. This example uses Node.js, saves timestamped PNG files, waits for the page to load, and optionally captures a selected element.

mkdir storefront-capture
cd storefront-capture
npm init -y
npm install playwright
npx playwright install chromium

Create capture.mjs:

import { chromium } from 'playwright';
import { mkdir } from 'node:fs/promises';

const targetUrl = process.env.TARGET_URL;
if (!targetUrl) throw new Error('Set TARGET_URL to the page to capture');

const outputDir = process.env.OUTPUT_DIR ?? './captures';
const fullPage = process.env.FULL_PAGE === 'true';
const selector = process.env.SELECTOR;
const width = Number(process.env.VIEWPORT_WIDTH ?? 1440);
const height = Number(process.env.VIEWPORT_HEIGHT ?? 1000);

await mkdir(outputDir, { recursive: true });
const stamp = new Date().toISOString().replaceAll(':', '-');
const browser = await chromium.launch({ headless: true });

try {
  const context = await browser.newContext({
    viewport: { width, height },
    locale: process.env.LOCALE ?? 'en-IN',
    timezoneId: process.env.TIMEZONE ?? 'Asia/Kolkata',
    deviceScaleFactor: Number(process.env.DEVICE_SCALE_FACTOR ?? 1),
  });
  const page = await context.newPage();
  const response = await page.goto(targetUrl, {
    waitUntil: 'domcontentloaded',
    timeout: 60000,
  });

  if (!response || !response.ok()) {
    throw new Error(`Navigation failed: ${response?.status() ?? 'no response'}`);
  }

  // Prefer a meaningful page condition over an arbitrary long sleep.
  const readySelector = process.env.READY_SELECTOR;
  if (readySelector) {
    await page.locator(readySelector).waitFor({ state: 'visible', timeout: 30000 });
  } else {
    await page.waitForLoadState('networkidle', { timeout: 15000 }).catch(() => {});
  }

  // Optional settling delay for content that animates or updates after load.
  const settleMs = Number(process.env.SETTLE_MS ?? 0);
  if (settleMs > 0) await page.waitForTimeout(settleMs);

  const path = `${outputDir}/storefront-${stamp}.png`;
  if (selector) {
    const element = page.locator(selector).first();
    await element.waitFor({ state: 'visible', timeout: 30000 });
    await element.screenshot({ path });
  } else {
    await page.screenshot({ path, fullPage });
  }
  console.log(`Saved ${path}`);
  await context.close();
} finally {
  await browser.close();
}

Run it manually before scheduling:

TARGET_URL='https://shop.example.in/' LOCALE='en-IN' TIMEZONE='Asia/Kolkata' node capture.mjs

Replace the example URL with a page you are permitted to capture. To capture a full page, set FULL_PAGE=true. To capture one element, set SELECTOR='.product-details'. Set READY_SELECTOR to a stable selector that appears when the information of interest is ready. Confirm that selector against the actual site.

Options and capture details

Setting Purpose Guidance
VIEWPORT_WIDTH, VIEWPORT_HEIGHT Browser viewport size in CSS pixels Keep fixed across scheduled runs; use dimensions matching the comparison you need.
DEVICE_SCALE_FACTOR Pixel density of the browser context Use 1 for ordinary output or a higher value for sharper images; higher density increases file size.
FULL_PAGE Capture beyond the viewport Use only when the entire page matters; long pages can be slow and large.
SELECTOR Capture a single matching element Use a stable selector and wait for it to be visible.
READY_SELECTOR Wait for important content Prefer a page-specific readiness condition over waiting for every network connection to stop.
SETTLE_MS Allow brief time for animation or late updates Keep it as short as the page needs; fixed delays increase every run’s duration.
LOCALE, TIMEZONE Set browser locale and clock zone These do not guarantee a particular delivery region or currency; verify the rendered page.
OUTPUT_DIR Choose local output directory For durable history, upload captures to storage available to your workflow.

Playwright screenshot API details are in the official Screenshots documentation. Full-page capture does not by itself guarantee that every lazy-loaded image or product widget has finished loading. If needed, scroll through the page before the final capture or wait for specific image and content selectors, then validate the result.

3. Run the script on a recurring schedule

The scheduler starts the browser script; Playwright performs the capture. Set the scheduler’s timezone explicitly. The following cron entry runs every day at 09:00 in the machine’s configured timezone:

0 9 * * * cd /absolute/path/storefront-capture && TARGET_URL='https://shop.example.in/' LOCALE='en-IN' TIMEZONE='Asia/Kolkata' /usr/bin/node capture.mjs >> /var/log/storefront-capture.log 2>&1

Use an absolute project path and the actual Node.js path available on the scheduler host. Cron uses the host’s timezone unless configured otherwise; configure the host or scheduler to Asia/Kolkata if 09:00 India time is intended. Confirm how daylight-saving changes or timezone settings are handled by the scheduler you choose.

A scheduled workflow should also define what happens when a run fails:

  1. Set a timeout appropriate to the slowest expected page load.
  2. Retry transient navigation or network failures a limited number of times, with a delay between attempts.
  3. Log the URL, start time, result, response status, and output filename for each attempt.
  4. Alert on repeated failures, missing output, or an unexpectedly tiny/blank image.
  5. Keep credentials and cookies in the scheduler’s secret store or a protected server-side file, not in source control.

Make’s APITemplate.io integration documentation shows a scheduled workflow trigger feeding image generation. That demonstrates an external scheduled trigger for a workflow; it does not establish that APITemplate.io itself schedules live browser screenshots. See APITemplate.io’s Make integration.

4. Store each capture with enough context

Use a stable naming scheme that preserves the run time and target identity, for example product-123/2026-10-04T09-00-00+05-30.png. Alongside each image, record the exact URL, capture timestamp and timezone, viewport, locale, selector or full-page setting, and whether the capture succeeded. This makes comparisons interpretable when a later run differs.

Local files can disappear with an ephemeral runner. If you need a durable history, upload completed files to storage your workflow controls and apply an appropriate retention policy. Do not include session cookies, authorization headers, or other secrets in filenames or logs.

5. Where APITemplate.io fits

APITemplate.io’s documented image API generates an image from a template ID and supplied overrides, returning a download URL. It can be useful after capture if you want a designed report graphic or another template-based asset that uses data from the screenshot workflow. It is not the browser step that opens and captures the storefront. See the image-template guide.

The APITemplate.io REST reference describes synchronous generation by default and an asynchronous mode for larger or batch generation jobs, with a transaction reference and webhook notification when generation completes. That completion notification is separate from the recurring trigger that starts your screenshot workflow. Check your account’s current documentation for endpoint region and configuration: the cited APITemplate.io pages differ on endpoint details, so this guide does not hard-code a regional endpoint. See the REST API reference.

APITemplate.io also documents ecommerce assets such as invoices, receipts, shipping labels, and promotional visuals generated from order data. Those are adjacent template-generation use cases rather than visual monitoring of a live storefront. See APITemplate.io ecommerce automation.

6. Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. For a one-off capture, send a GET request with the target URL. The same call can run from your scheduler instead of maintaining a browser installation. See the ScreenshotNeo API documentation for request options.

cURL

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

Python

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://shop.example.in"},
    timeout=90,
)
r.raise_for_status()
with open("shot.webp", "wb") as f:
    f.write(r.content)

Node.js

const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://shop.example.in',
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await import('node:fs/promises').then(({ writeFile }) =>
  writeFile('shot.webp', Buffer.from(await res.arrayBuffer()))
);

ScreenshotNeo removes cookie and consent banners, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Every feature is available on every plan. Check the docs for the current parameter options, including caching and capture controls.

Create a free ScreenshotNeo account for 1,000 screenshots a month with no card.

7. Reliability, performance, and cost

Keep captures comparable

  • Fix the viewport, device scale factor, locale, timezone, URL, and page state that matter to your comparison.
  • Use a specific readiness selector for important content. A generic network-idle condition can be unreliable on pages with long-lived requests.
  • Expect consent dialogs, login walls, bot checks, location selectors, inventory changes, and personalized prices to affect what is visible. Validate the chosen page before relying on unattended runs.
  • For full-page images, account for lazy loading and page height. Very tall captures can take longer and produce larger files.

Estimate workload and cost

For a self-managed browser, estimate runs per month as URLs × runs per day × days in the month, then account for retries and any additional viewport or locale variants. Your infrastructure cost depends on where and how the browser runs, image retention, and how often jobs retry; the cited sources do not provide a universal price for that setup. For APITemplate.io, account for template-generation transactions separately if the workflow creates an additional designed image. Check your plan’s current pricing and transaction rules before deployment.

For ScreenshotNeo, the stated allowance is 1,000 shots per month free with no card; paid options are Starter at $5 for 3,000, Growth at $15 for 15,000, Pro at $39 for 60,000, Scale at $99 for 250,000, and Business at $249 for 1,000,000. Yearly billing gives two months free. Only clean shots are billed, according to the product’s billing description. Confirm the current plan details on the product site before choosing a plan.

8. Troubleshooting

Symptom Likely cause Fix
Browser executable is missing Chromium was not installed in the runtime environment. Run npx playwright install chromium during image or host setup; ensure scheduled jobs use the same environment.
Navigation times out Slow page, blocked automation, network issue, or a page that never settles. Check the URL from the runner, use a sensible navigation timeout, wait for a specific content selector, and retry transient failures with a limit.
Screenshot is blank or incomplete Capture ran before the main content rendered, or the page rejected/redirected the automated visit. Inspect the response status and final URL, wait for the actual content selector, and test the page manually in the same region and session context.
Product images are missing in full-page output Images may load lazily only after scrolling or may still be downloading. Scroll through the page in steps, wait for relevant images to complete, then take the screenshot.
Element capture says no element found The selector is wrong, the element is delayed, or it is inside a frame. Verify the selector in the rendered DOM, wait for visibility, and handle the relevant frame explicitly if applicable.
Scheduled run uses the wrong time Cron or the runner is using a different timezone than expected. Configure the scheduler timezone explicitly and log timestamps with timezone offsets.
Runs overwrite earlier files Filename is static or has insufficient timestamp precision. Include an ISO timestamp or unique run identifier in each output key.
APITemplate.io call finishes but screenshot was never taken Template generation was used as if it were browser navigation. Run Playwright or a screenshot service first. Pass data to an APITemplate template only as a separate generation step.
APITemplate.io endpoint or region is unclear The cited docs show differing endpoint details. Use the endpoint documented for the account and verify region requirements before deployment.
ScreenshotNeo response is not an image The request may have failed or returned an error response. Check the HTTP status and response headers before saving the body as an image; consult the API docs for parameter and error details.

9. Before enabling unattended captures

  • Confirm that the target page and capture frequency comply with the merchant’s terms and applicable rules.
  • Check whether the URL requires login, a consent choice, age confirmation, or a region selection.
  • Verify locale, delivery region, currency, and session state on the actual site; browser locale alone may not set all of them.
  • Run multiple manual captures at the intended cadence and inspect the output and logs.
  • Set retention, failure alerts, and a retry limit before relying on the workflow.

FAQ

Does APITemplate.io schedule recurring screenshots of a live website?

The cited documentation supports template-based image generation and scheduled workflow triggers through integrations. It does not establish a native recurring calendar that browses arbitrary live URLs and captures them.

Can I capture a page behind login?

Potentially, with browser context state or authentication handled securely, but the workflow must be configured for the site and permitted by its terms. Do not expose credentials in code repositories or logs.

Should I use a viewport or full-page screenshot for price monitoring?

Use the smallest capture that reliably includes the price and its relevant context. A targeted element is efficient when the selector is stable; a viewport is less dependent on page markup; full-page capture is useful when surrounding details matter.

Will browser locale force an Indian price and delivery region?

No. Locale and timezone are only part of the browser context. The storefront may use cookies, account settings, location selectors, or other signals. Verify the rendered result on the chosen site.

Does an APITemplate.io webhook start the next scheduled capture?

The documented webhook notifies you about asynchronous generation completion. The recurring trigger remains a separate scheduler responsibility.