← All projects

A Playwright-powered internal API for rendered page scraping and screenshots, designed to give AI agents better web context. It supports API-key protection, deterministic JSON extraction, screenshot caching, and Docker-friendly self-hosting for Next.js and server-side workflows.

Role
API design and backend engineering
Delivery
GitHub
Availability
Open source
Interface
HTTP API behind an API key

How it works

SNAP GOBLIN SERVICEClientagent or pipelineGuardskey · URL policyRejected401 / 400ChromiumPlaywrightScreenshotPage JSONDisk cachestable keys + TTLSNAP GOBLIN / URL TO CONTEXT

Swipe to see the whole system

  1. Render first, then read

    Pages are loaded in a real browser and can wait for network idle, a selector, or a fixed delay before anything is captured or extracted.

  2. Same request, same answer

    Responses use a fixed JSON shape and a cache key derived from the request, so repeated calls are fast and pipelines can rely on the format.

  3. Safe by default

    Localhost and private networks are blocked unless allowed, only http and https are accepted, and allow and deny lists narrow targets further.

The problem

AI agents and ingestion pipelines increasingly need to see the web the way a person does, but most pages render in JavaScript, so a raw HTTP fetch returns an empty shell. Running a headless browser per request is slow and, left unguarded, it becomes a way to reach internal networks.

My approach

Snap Goblin wraps Playwright in a small self-hosted HTTP service. One call captures a screenshot, another returns the rendered page as structured JSON, and results are cached on disk under stable keys. Every route but the health check needs an API key, and private-network targets are refused unless an operator explicitly allows them.

Engineering scope

  1. TypeScript Express service with a shared Playwright Chromium instance and a cap on concurrent pages
  2. Screenshot and scrape endpoints with on-disk caches, TTLs, a refresh endpoint, and viewport, text, HTML, and link limits
  3. API-key authentication, separate rate limits for authorized and unauthorized clients, URL policy checks, and a Docker Compose deployment