npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

snapapi-sdk

v1.4.0

Published

Official Node.js SDK for SnapAPI — screenshot, analyze, PDF, metadata, monitors, and more

Readme

snapapi-js

Official Node.js SDK for SnapAPI — capture any website as an image.

Zero dependencies. Uses native fetch (Node 18+).

Install

npm install snapapi-js

Quick Start

const SnapAPI = require('snapapi-js');
const fs = require('fs');

const snap = new SnapAPI('snap_your_key_here');

// Basic screenshot
const image = await snap.screenshot('example.com');
fs.writeFileSync('screenshot.png', image);

// With options
const webp = await snap.screenshot('example.com', {
  format: 'webp',
  darkMode: true,
  fullPage: true,
});
fs.writeFileSync('screenshot.webp', webp);

// Mobile screenshot (iPhone 14)
const mobile = await snap.screenshot('example.com', { device: 'iphone14' });

// Capture a specific element
const header = await snap.screenshot('example.com', { selector: 'header' });

// Get structured page data (great for AI agents)
const meta = await snap.screenshot('example.com', { meta: true });
console.log(meta.title, meta.description);
console.log(meta.headings);  // [{level: 1, text: "..."}, ...]
console.log(meta.links);     // [{text: "...", href: "..."}, ...]
console.log(meta.text);      // Extracted visible text (first 2000 chars)

// Check your usage
const usage = await snap.usage();
console.log(`${usage.usage.count} screenshots this month`);

Screenshot Options

| Option | Type | Description | |------------|---------|--------------------------------------| | width | number | Viewport width in pixels | | height | number | Viewport height in pixels | | format | string | "png", "jpeg", or "webp" | | quality | number | Image quality 1-100 (jpeg/webp only) | | fullPage | boolean | Capture the full scrollable page | | delay | number | Wait ms before capturing | | darkMode | boolean | Emulate dark color scheme | | blockAds | boolean | Block common ad networks | | cache | boolean | Use cached result if available | | selector | string | CSS selector to capture | | device | string | Device preset: "iphone14", "pixel7", "ipad", "desktop", etc. | | meta | boolean | Return page metadata as JSON |

Error Handling

const { SnapAPIError } = require('snapapi-js');

try {
  const image = await snap.screenshot('example.com');
} catch (err) {
  if (err instanceof SnapAPIError) {
    console.error(err.status, err.message);
  }
}

Scheduled Monitors

// Create a monitor — captures every 15 minutes
const monitor = await snap.createMonitor({
  url: 'https://example.com',
  name: 'Homepage',
  interval_minutes: 15,
  params: { format: 'webp', fullPage: true },
  webhook_url: 'https://your-app.com/webhook',
});

// List all monitors
const monitors = await snap.listMonitors();

// Pause / resume
await snap.updateMonitor(monitor.id, { status: 'paused' });
await snap.updateMonitor(monitor.id, { status: 'active' });

// Browse snapshots
const { snapshots } = await snap.listSnapshots(monitor.id, { limit: 10 });

// Download a snapshot image
const image = await snap.getSnapshot(monitor.id, snapshots[0].id);
fs.writeFileSync('snapshot.webp', image);

// Delete a monitor (cascades to snapshots)
await snap.deleteMonitor(monitor.id);

Monitors require Starter tier or above. See pricing for limits.

Account Management

// Full account info
const account = await snap.account();

// Update settings
await snap.updateSettings({ name: 'My App' });

// Sign up (no API key needed)
const snap = new SnapAPI('placeholder');
const result = await snap.signup('[email protected]');
console.log(result.key); // Your new API key

License

MIT