Type-Safe

Capture screenshots in TypeScript

Add screenshot and scrolling GIF capabilities to your TypeScript applications with full type safety. Works with Node.js, Deno, and Bun runtimes.

Installation

  1. 1Use Node.js 18+, Deno, or Bun (all include native fetch)
  2. 2Get your API key from the dashboard
  3. 3Set the X-KEY header in your fetch requests

Authentication

Include your API key in the X-KEY header with every request:

const response = await fetch(url, {
  headers: { 'X-KEY': 'your-api-key' }
});
const buffer: ArrayBuffer = await response.arrayBuffer();

TypeScript Screenshot Example

Capture a screenshot or create a scrolling GIF animation with a simple GET request:

Screenshot
import { writeFile } from "fs/promises";

const response = await fetch(
  "https://api.scrnpix.com/screenshot?url=https%3A%2F%2Fexample.com&width=1280&height=720&format=png",
  { headers: { "X-KEY": "your-api-key" } }
);

const buffer = Buffer.from(await response.arrayBuffer());
await writeFile("screenshot.png", buffer);
Animation
import { writeFile } from "fs/promises";

const response = await fetch(
  "https://api.scrnpix.com/animate?url=https%3A%2F%2Fexample.com&scroll_duration=3000&scroll_easing=ease-in-out",
  { headers: { "X-KEY": "your-api-key" } }
);

const buffer = Buffer.from(await response.arrayBuffer());
await writeFile("animation.gif", buffer);

Response Format

On success, the API returns the image binary data directly in the response body.

Status Code200 OK
Content-Typeimage/png, image/jpeg, or image/gif
BodyBinary image data (ArrayBuffer)
Error ResponseError message with 4xx/5xx status

Key Features

Zero Setup

No need to install Puppeteer or manage headless Chrome. Just use the native fetch API with TypeScript.

Production Ready

Built on Cloudflare Workers with global edge network. Handles concurrency and browser lifecycle automatically.

TypeScript Integration

Full type safety with async/await. Works with Next.js, NestJS, Express, Deno, Bun, or any TypeScript project.

Rich Features

Custom viewport sizes, full page capture, PNG/JPEG formats, scrolling GIFs with 15 easing functions.

Frequently Asked Questions

Do I need to install any browser dependencies for TypeScript?

No. Scrnpix runs browsers on our infrastructure. You only need native fetch API to make HTTP calls.

Can I use this with Next.js or Deno?

Yes. Scrnpix works with any TypeScript runtime — Node.js, Deno, Bun, and frameworks like Next.js, NestJS, or Hono.

How do I handle errors in TypeScript?

Check the response.ok property or status code. A 200 status means success with image bytes in the body. Use try-catch for error handling.

What TypeScript version is required?

TypeScript 4.5+ is recommended for modern features. The API is a simple HTTP GET request.

Ready to capture screenshots in TypeScript?

Get your API key and start rendering screenshots in seconds. Free tier includes 50 screenshots per month.

Start Free