About
Screengrabber is a self-hosted REST API service that uses Microsoft Edge via Playwright to capture screenshots of web pages. It supports configurable viewport sizes, aspect ratios, zoom levels, output formats, and Redis-backed caching.
Quick Start
Make a GET request with the target URL as the first path segment. All other path segments are optional and control the screenshot appearance.
GET /{url}/{size}/{aspectRatio}/{zoom}/_modifiers?format=jpeg HTTP/1.1
X-Api-Key: your-api-key
For example, to capture a 1024×1024 screenshot of https://example.com:
https://screengrabber.example.com/https%3A%2F%2Fexample.com/large
Authentication
If API_KEYS is configured, every request must include an X-Api-Key header. The service returns 401 Unauthorized for missing or invalid keys.
X-Api-Key: your-api-key
If API_KEYS is empty (the default), no authentication is required.
Self-Hosting
Screengrabber ships as a Docker image. The simplest way to run it is with docker compose.
services:
screengrabber:
image: ghcr.io/homotechsual/screengrabber:latest
ports:
- "8080:8080"
environment:
REDIS_CONNECTION: redis:6379
API_KEYS: changeme
depends_on:
- redis
redis:
image: redis:7-alpine
restart: unless-stopped
See the Configuration reference for a full list of environment variables.