Skip to main content
Screenshotly’s API handles on-demand captures. To schedule recurring screenshots, combine it with an external scheduling mechanism.

Cron jobs

Run a capture script on a schedule using cron (Linux/macOS):
// capture.js
import { Screenshotly } from 'screenshotly-js';

const client = new Screenshotly(process.env.SCREENSHOTLY_API_KEY);

async function capture() {
  const screenshot = await client.capture({
    url: 'https://example.com',
    format: 'jpeg',
    fullPage: true,
    width: 1920,
    height: 1080
  });

  console.log(`[${new Date().toISOString()}] Captured: ${screenshot.data.imageUrl}`);
}

capture();
Add a crontab entry to run daily at 2:00 AM:
0 2 * * * /usr/bin/node /path/to/capture.js >> /path/to/cron.log 2>&1

GitHub Actions

Create a scheduled workflow to capture screenshots automatically:
# .github/workflows/scheduled-screenshot.yml
name: Scheduled screenshot

on:
  schedule:
    - cron: '0 3 * * *' # daily at 03:00 UTC

jobs:
  capture:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      - run: npm install screenshotly-js
      - run: node capture.js
        env:
          SCREENSHOTLY_API_KEY: ${{ secrets.SCREENSHOTLY_API_KEY }}

AWS Lambda

Deploy your capture logic as a Lambda function triggered by EventBridge on a schedule:
import { Screenshotly } from 'screenshotly-js';

const client = new Screenshotly(process.env.SCREENSHOTLY_API_KEY);

export const handler = async (event) => {
  const screenshot = await client.capture({
    url: 'https://example.com',
    format: 'jpeg'
  });

  console.log('Captured:', screenshot.data.imageUrl);
  return { statusCode: 200, body: screenshot.data.imageUrl };
};
Configure an EventBridge rule with a cron expression to trigger the Lambda function on your desired schedule.

Workflow automation tools

You can also use no-code platforms to schedule captures:
  • Zapier — create a Zap with a Schedule trigger and a Webhooks action calling the Screenshotly API
  • Make (Integromat) — use the HTTP module with a scheduling trigger
See no-code integrations for setup details.

Best practices

  • Store API keys securely — use environment variables or secrets managers, never hardcode keys in scripts
  • Log results — capture timestamps, URLs, and outcomes for troubleshooting
  • Set up failure alerts — send notifications via email or Slack if scheduled captures fail
  • Stagger schedules — if running many scheduled captures, spread them out to avoid rate limit issues
  • Manage storage — implement a retention policy for stored screenshots to control costs