Efficient & Expressive

Capture screenshots in Nim

Add screenshot and scrolling GIF capabilities to your Nim applications with std/httpclient. Efficient, expressive, no headless browsers to manage.

Installation

  1. 1std/httpclient is included in Nim standard library
  2. 2Get your API key from the dashboard
  3. 3Set the X-KEY header in your requests

Authentication

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

import std/httpclient

var client = newHttpClient()
client.headers = newHttpHeaders({"X-KEY": "your-api-key"})
let response = client.getContent(url)

Nim Screenshot Example

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

Screenshot
import httpclient

var client = newHttpClient()
client.headers = newHttpHeaders({"X-KEY": "your-api-key"})

let response = client.getContent(
  "https://api.scrnpix.com/screenshot?url=https%3A%2F%2Fexample.com&width=1280&height=720&format=png"
)

writeFile("screenshot.png", response)
Animation
import httpclient

var client = newHttpClient()
client.headers = newHttpHeaders({"X-KEY": "your-api-key"})

let response = client.getContent(
  "https://api.scrnpix.com/animate?url=https%3A%2F%2Fexample.com&scroll_duration=3000&scroll_easing=ease-in-out"
)

writeFile("animation.gif", response)

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 (string)
Error ResponseError message with 4xx/5xx status

Key Features

Zero Setup

std/httpclient is built into Nim. No external dependencies or browser installations required.

Production Ready

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

Nim Integration

Compile to C for efficiency. Integrates seamlessly with Jester, Prologue, or any Nim application.

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 Nim?

No. Scrnpix runs browsers on our infrastructure. You only need Nim's built-in std/httpclient to make HTTP calls.

Can I use this with Jester or Prologue?

Yes. Scrnpix works with any Nim framework — Jester, Prologue, Karax, or plain Nim applications.

How do I handle errors in Nim?

Use try-except blocks to catch HttpRequestError. A 200 status means success with image bytes in the response body.

What Nim version is required?

Nim 1.6+ with std/httpclient support. The API is a simple HTTP GET request.

Ready to capture screenshots in Nim?

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

Start Free