New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

snapapi-js

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snapapi-js

SnapAPI client — REST API for screenshots, PDFs, and web content extraction. No browser infrastructure required.

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
2
-80%
Maintainers
1
Weekly downloads
 
Created
Source

snapapi-js

Official JavaScript/TypeScript client for SnapAPI — a REST API for screenshots, PDFs, QR codes, and web content extraction. No browser infrastructure required.

Features

  • Screenshots: Capture full-page or viewport screenshots of any URL
  • PDFs: Convert markdown to PDF or HTML pages to PDF
  • Markdown: Convert HTML to markdown
  • QR codes: Generate QR codes from any text
  • Open Graph: Extract OG metadata from URLs
  • Content extraction: Extract text/HTML from web pages

Install

npm install snapapi-js

Quick Start

import SnapAPI from 'snapapi-js';
import { writeFileSync } from 'fs';

const client = new SnapAPI({ apiKey: 'your-api-key' });

// Take a screenshot
const screenshot = await client.screenshot({ url: 'https://example.com' });
writeFileSync('screenshot.png', screenshot);

// Convert markdown to PDF
const pdf = await client.markdownToPDF({ content: '# Hello World\n\nThis is a PDF.' });
writeFileSync('document.pdf', pdf);

// Generate a QR code
const qr = await client.qr({ text: 'https://example.com', size: 256 });
writeFileSync('qr.png', qr);

// Extract Open Graph metadata
const og = await client.og({ url: 'https://example.com' });
console.log(og);

API Reference

new SnapAPI(options)

OptionTypeRequiredDescription
apiKeystringYesYour SnapAPI key (free: 100 calls/month)
baseUrlstringNoCustom base URL (default: https://api.opspawn.com)

screenshot(options) → Promise<Uint8Array>

OptionTypeDefaultDescription
urlstringRequiredURL to screenshot
widthnumber1280Viewport width
heightnumber720Viewport height
fullPagebooleanfalseCapture full page
formatstringpngpng, jpeg, or webp
qualitynumber80Image quality (1-100)
delaynumber0Wait time in ms before capture

markdownToPDF(options) → Promise<Uint8Array>

OptionTypeDefaultDescription
contentstringRequiredMarkdown content
titlestringPDF title
formatstringA4Page size: A4, Letter, Legal

og(options) → Promise<object>

Returns Open Graph metadata for a URL.

toMarkdown(options) → Promise<object>

Converts an HTML page to Markdown.

qr(options) → Promise<Uint8Array>

OptionTypeDefaultDescription
textstringRequiredText/URL to encode
sizenumber256Image size in pixels
formatstringpngpng or svg

Pricing

  • Free: 100 calls/month — no credit card required
  • Pro: $19/month — 10,000 calls/month
  • Business: $99/month — 100,000 calls/month

Get your free API key at opspawn.com/snapapi.

Keywords

screenshot

FAQs

Package last updated on 06 Mar 2026

Related posts