A simple self-hosted API to take screenshots of websites using Puppeteer.
A NestJS wrapper around capture-website.
Check the package.json for the full list of dependencies.
Check the Dockerfile to see how the image is built.
Parameter | Type | Default Value | Description |
---|---|---|---|
url | string | URL to capture | |
width | number | 1024 | Viewport width |
height | number | 768 | Viewport height |
scale | number | 1 | Scale factor of the viewport |
timeout | number | 15 | Timeout before giving up |
delay | number | 0 | Delay after page load |
mime_type | string | webp | jpg, png or webp |
quality | number | 0.8 | Image quality |
You can view the full query parameters here.
pnpm install
cp .env.example .env
nano .env
# development
pnpm run start
# watch mode
pnpm run start:dev
# production mode
pnpm run start:prod
# unit tests
pnpm run test
# e2e tests
pnpm run test:e2e
# test coverage
pnpm run test:cov
docker build -t screenshot-api .
docker run -p 3000:3000 screenshot-api