Everything you need to capture screenshots, generate PDFs, and extract web content via a simple REST API.
Pass your API key as an x-api-key header or ?api_key= query parameter.
curl "https://urlsnap.dev/api/screenshot?url=https://example.com" -H "x-api-key: YOUR_KEY"Capture a screenshot of any URL. Returns a PNG image directly (binary).
x-api-key header required.
curl "https://urlsnap.dev/api/screenshot?url=https://github.com" -H "x-api-key: YOUR_KEY"
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | required | The URL to screenshot |
| width | integer | optional | Viewport width in px (default: 1280) |
| height | integer | optional | Viewport height in px (default: 800) |
| full_page | boolean | optional | Capture full page scroll height (default: false) |
| delay | integer | optional | Wait ms after load before capture (default: 0) |
| format | string | optional | Image format: png or jpeg (default: png) |
// Node.js
const res = await fetch('https://urlsnap.dev/api/screenshot?url=https://example.com', { headers: { 'x-api-key': 'YOUR_KEY' } });
const buffer = await res.arrayBuffer();
fs.writeFileSync('screenshot.png', Buffer.from(buffer));# Python
import requests
r = requests.get('https://urlsnap.dev/api/screenshot', params={'url': 'https://example.com'}, headers={'x-api-key': 'YOUR_KEY'})
open('screenshot.png', 'wb').write(r.content)# cURL curl "https://urlsnap.dev/api/screenshot?url=https://example.com" -H "x-api-key: YOUR_KEY" -o screenshot.png
Generate a PDF from any URL. Returns a PDF file directly (binary).
x-api-key header required.
curl "https://urlsnap.dev/api/pdf?url=https://github.com" -H "x-api-key: YOUR_KEY"
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | required | The URL to convert to PDF |
| format | string | optional | Page size: A4, Letter, etc. (default: A4) |
| landscape | boolean | optional | Landscape orientation (default: false) |
| delay | integer | optional | Wait ms after load (default: 0) |
POST raw HTML in the request body to generate a PDF from custom HTML.
curl -X POST "https://urlsnap.dev/api/pdf" \ -H "x-api-key: YOUR_KEY" \ -H "Content-Type: text/html" \ -d "<!DOCTYPE html><html><body><h1>Hello World</h1></body></html>" \ --output page.pdf
Extract Open Graph metadata, title, favicon, and description from any URL. Renders JavaScript — works on SPAs and dynamic pages.
curl "https://urlsnap.dev/api/preview?url=https://github.com" \ -H "x-api-key: YOUR_KEY"
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | required | The URL to extract metadata from |
{
"title": "GitHub: Let's build from here",
"description": "GitHub is where over 100 million developers shape the future...",
"image": "https://github.githubassets.com/images/modules/site/social-cards/homepage.png",
"favicon": "https://github.com/favicon.ico",
"siteName": "GitHub",
"url": "https://github.com"
}Render an HTML string as a PNG or JPEG image. Useful for social cards, certificates, email images, and reports.
curl -X POST "https://urlsnap.dev/api/html-to-image" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"html":"<div style=\"background:#6366f1;color:#fff;padding:40px;font-size:48px\">Hello</div>","width":1200,"height":630}' \
--output card.png| Field | Type | Required | Description |
|---|---|---|---|
| html | string | required | HTML to render |
| width | integer | optional | Width in px (default: 1200) |
| height | integer | optional | Height in px (default: 630) |
| format | string | optional | png (default) or jpeg |
Rate limit resets daily at midnight UTC. Exceeded requests return HTTP 429.
Get your free API key in seconds — no credit card required.
Get Free API Key View Pricing