Node.js and Python SDKs

Tiny, zero-dependency clients for the screenshot and PDF API. They are served from this domain, so you install them by URL: no registry account, nothing else gets pulled in. Each is one readable file you can vendor into your project if you prefer.

Get a free key (100 renders)   API reference · OpenAPI spec

Node.js (18+)

npm install https://shotmint.creasework.com/sdk/dist/shotmint-0.1.0.tgz

Uses the built-in fetch, ships TypeScript types, and works with import or require. Save as shot.mjs and run with SHOTMINT_KEY=sm_... node shot.mjs:

import Shotmint from 'shotmint';
import { writeFile } from 'node:fs/promises';

const sm = new Shotmint(); // reads SHOTMINT_KEY

const png = await sm.screenshot({ url: 'https://example.com', full_page: true });
await writeFile('shot.png', png);
console.log('credits left:', png.credits);

const pdf = await sm.pdf({ html: '<h1>Invoice #1</h1>', format: 'A4' });
await writeFile('invoice.pdf', pdf);

// Signed, cached <img src> URL: the key never appears in it
console.log(await sm.signedScreenshotUrl({ url: 'https://example.com', width: 1200 }));

Python (3.8+)

pip install https://shotmint.creasework.com/sdk/dist/shotmint-0.1.0-py3-none-any.whl

Standard library only (urllib). Add the same URL to requirements.txt to pin it. Run with SHOTMINT_KEY=sm_... python shot.py:

from shotmint import Shotmint, ShotmintError

sm = Shotmint()  # reads SHOTMINT_KEY

png = sm.screenshot(url="https://example.com", full_page=True)
open("shot.png", "wb").write(png)
print("credits left:", png.credits)

pdf = sm.pdf(html="<h1>Invoice #1</h1>", format="A4")
open("invoice.pdf", "wb").write(pdf)

try:
    sm.screenshot(url="https://does-not-exist.invalid")
except ShotmintError as e:
    print(e.status, e)

What both clients do

MethodDoes
screenshot(params)POST /v1/screenshot. Returns the image bytes with credits, creditsLow / credits_low and the content type attached.
Every screenshot parameter passes straight through.
pdf(params)POST /v1/pdf. Returns the PDF bytes.
Every PDF parameter passes straight through.
account()Credits left, the low-credit flag and your top-up link.
signedScreenshotUrl / signed_screenshot_urlA signed /s/ image URL for <img> tags, cached 24h, key never exposed.
Shotmint.freeKey() / free_key()Creates a free 100-credit key (one per IP per 24h).

Errors raise ShotmintError with status (401 bad key, 402 out of credits, 400/422 render errors, 503 busy) and the API's message. A failed render is never billed.

Other languages

The API is plain HTTP, so any client works: see the copy-paste guides for PHP, Go, Ruby, C# and Java, or no-code recipes on the integrations page.

Pricing stays the same with or without the SDK: from €5 for 2,000 renders, prepaid, credits never expire.