Skip to content

Self-Hosted
Screenshot API

A portfolio project — a self-hosted REST API for capturing full-page website screenshots, built with Node.js, Puppeteer, and Docker. Deployable anywhere containers run.

Puppeteer + network-idle

Headless Chrome via Puppeteer waits for networkidle0 before capture, ensuring JS-rendered pages and deferred assets are fully loaded before the screenshot is taken.

Stateless REST endpoint

A single GET /api/screenshot endpoint accepts URL and viewport parameters, authenticates via Authorization: Bearer, and streams the PNG directly — no session state, no storage layer.

Containerised with Docker

Packaged as a Docker image with Chromium dependencies baked in. Environment variables configure the API key and quota limits, keeping secrets out of the image and deployable to any container runtime.

Works Everywhere

Pass your API key as a Bearer token in the Authorization header.

cURL

curl "https://urlscreenshot.app
  /api/screenshot
  ?url=https://example.com
  &width=1200" \
  -H "Authorization: Bearer sk_..." \
  -o screenshot.png

JavaScript

const res = await fetch(
  '/api/screenshot?url=' + url,
  {
    headers: {
      Authorization: 'Bearer sk_...'
    }
  }
);
const buf = await res.arrayBuffer();

Python

import requests
r = requests.get(
  'https://urlscreenshot.app
   /api/screenshot',
  params={'url': url},
  headers={
    'Authorization': 'Bearer sk_...'
  }
)
open('shot.png','wb').write(r.content)