SnapAPI Documentation
Capture screenshots, videos, and PDFs of any webpage programmatically. Get started in under 5 minutes.
Quick Start
Make your first API call and capture a screenshot.
1. Get Your API Key
Sign up at dashboard to get your free API key. You'll receive 200 free screenshots to start.
2. Make Your First Request
curl -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}' \
--output screenshot.png
const response = await fetch('https://api.snapapi.pics/v1/screenshot', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ url: 'https://example.com' })
});
const blob = await response.blob();
// Save or process the image
import requests
response = requests.post(
'https://api.snapapi.pics/v1/screenshot',
headers={'X-Api-Key': 'YOUR_API_KEY'},
json={'url': 'https://example.com'}
)
with open('screenshot.png', 'wb') as f:
f.write(response.content)
That's it! You've captured your first screenshot. The image will be saved as screenshot.png.
Authentication
All API requests require authentication using your API key. Include it in the X-Api-Key header:
X-Api-Key: sk_live_xxxxxxxxxxxxxxxxxxxx
Never expose your API key in client-side code. Always make API calls from your server.
Base URL
All API requests should be made to:
https://api.snapapi.pics/v1
Screenshot API
Capture high-quality screenshots of any webpage with full customization options.
Captures a screenshot of the specified URL and returns the image.
Request Body
| Parameter | Type | Default | Description |
|---|---|---|---|
| url | stringrequired | - | URL to capture (must include protocol) |
| format | string | png | Output format: png, jpeg, webp, avif |
| width | integer | 1280 | Viewport width (100-3840) |
| height | integer | 800 | Viewport height (100-2160) |
| fullPage | boolean | false | Capture full scrollable page |
| quality | integer | 80 | Image quality 1-100 (jpeg/webp/avif) |
| delay | integer | 0 | Delay before capture in ms (0-30000) |
| blockAds | boolean | false | Block advertisements |
| blockCookieBanners | boolean | false | Hide cookie consent banners |
| darkMode | boolean | false | Emulate dark mode preference |
Example Request
curl -X POST "https://api.snapapi.pics/v1/screenshot" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"width": 1920,
"height": 1080,
"fullPage": true,
"format": "webp",
"quality": 90,
"blockAds": true,
"blockCookieBanners": true
}' \
--output screenshot.webp
const response = await fetch('https://api.snapapi.pics/v1/screenshot', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com',
width: 1920,
height: 1080,
fullPage: true,
format: 'webp',
quality: 90,
blockAds: true,
blockCookieBanners: true
})
});
const imageBlob = await response.blob();
import requests
response = requests.post(
'https://api.snapapi.pics/v1/screenshot',
headers={'X-Api-Key': 'YOUR_API_KEY'},
json={
'url': 'https://example.com',
'width': 1920,
'height': 1080,
'fullPage': True,
'format': 'webp',
'quality': 90,
'blockAds': True,
'blockCookieBanners': True
}
)
with open('screenshot.webp', 'wb') as f:
f.write(response.content)
Video API New
Capture smooth video recordings of webpages with automatic scrolling animations.
Records a video of the specified URL with customizable scroll behavior.
Scroll Options
| Parameter | Type | Default | Description |
|---|---|---|---|
| url | stringrequired | - | URL to record |
| format | string | mp4 | Output format: mp4, webm, gif |
| scroll | boolean | false | Enable automatic scrolling |
| scrollDuration | integer | 1500 | Duration of scroll animation (ms) |
| scrollEasing | string | linear | Easing: linear, ease_in, ease_out, ease_in_out |
| scrollBack | boolean | false | Scroll back to top after reaching bottom |
| scrollComplete | boolean | false | Ensure entire page is scrolled |
| fps | integer | 24 | Frames per second (1-30) |
Example: Scroll Video
curl -X POST "https://api.snapapi.pics/v1/video" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"scroll": true,
"scrollDuration": 2000,
"scrollEasing": "ease_in_out",
"scrollBack": true,
"format": "mp4",
"fps": 30
}' \
--output recording.mp4
const response = await fetch('https://api.snapapi.pics/v1/video', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com',
scroll: true,
scrollDuration: 2000,
scrollEasing: 'ease_in_out',
scrollBack: true,
format: 'mp4',
fps: 30
})
});
const videoBlob = await response.blob();
import requests
response = requests.post(
'https://api.snapapi.pics/v1/video',
headers={'X-Api-Key': 'YOUR_API_KEY'},
json={
'url': 'https://example.com',
'scroll': True,
'scrollDuration': 2000,
'scrollEasing': 'ease_in_out',
'scrollBack': True,
'format': 'mp4',
'fps': 30
}
)
with open('recording.mp4', 'wb') as f:
f.write(response.content)
Extract API New
Extract structured content from any webpage. Perfect for LLM workflows, RAG pipelines, and content analysis. Returns clean markdown, article content, metadata, links, and more.
POST /v1/extract
/v1/extract
Request Body
| Parameter | Type | Default | Description |
|---|---|---|---|
| urlrequired | string | - | URL to extract content from |
| type | string | markdown | Extraction type: markdown, text, html, article, structured, links, images, metadata |
| selector | string | - | CSS selector to extract from specific element |
| maxLength | number | - | Truncate output to this many characters |
| blockAds | boolean | false | Block ads before extraction |
| blockCookieBanners | boolean | false | Hide cookie consent banners |
Extraction Types
| Type | Description | Use Case |
|---|---|---|
| markdown | Clean markdown with headings, links, lists, code blocks | LLM input, documentation, RAG |
| article | Article with title, byline, excerpt, and content (uses Mozilla Readability) | News/blog extraction, content analysis |
| structured | JSON with title, author, date, description, word count, and content | Data pipelines, indexing |
| text | Plain text only, no formatting | Search indexing, simple processing |
| html | Raw HTML content | Custom parsing, archiving |
| links | Array of {text, href} objects | Link analysis, web crawling |
| images | Array of {src, alt, width, height} objects | Image extraction, media analysis |
| metadata | Page title, description, OG tags, Twitter cards, favicon | SEO analysis, link previews |
Example: Markdown Extraction
curl -X POST https://api.snapapi.pics/v1/extract \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/article", "type": "markdown"}'
const response = await fetch('https://api.snapapi.pics/v1/extract', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com/article',
type: 'markdown'
})
});
const { data } = await response.json();
console.log(data); // Clean markdown content
import requests
response = requests.post(
'https://api.snapapi.pics/v1/extract',
headers={'X-API-Key': 'YOUR_API_KEY'},
json={'url': 'https://example.com/article', 'type': 'markdown'}
)
data = response.json()['data']
print(data) # Clean markdown content
Example: Structured Extraction for LLM
// Response for type: "structured"
{
"success": true,
"type": "structured",
"data": {
"url": "https://example.com/article",
"title": "Article Title",
"author": "John Doe",
"publishedTime": "2024-01-15T10:00:00Z",
"description": "A brief description...",
"wordCount": 1250,
"content": "Full article content in markdown..."
}
}
Markdown Input for Screenshots
Render markdown directly to a screenshot. Great for generating images from documentation, README files, or dynamic content.
curl -X POST https://api.snapapi.pics/v1/screenshot \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"markdown": "# Hello World\n\nThis is **bold** and *italic*.", "width": 800}' \
--output screenshot.png
const markdown = \`# My Document
## Features
- Clean rendering
- GitHub-style formatting
- Code block support
\\\`\\\`\\\`javascript
console.log('Hello!');
\\\`\\\`\\\`
\`;
const response = await fetch('https://api.snapapi.pics/v1/screenshot', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ markdown, width: 800 })
});
Content Validation
Validate page content before capturing to ensure you get the expected result.
| Parameter | Type | Description |
|---|---|---|
| failIfContentMissing | string[] | Fail if any of these strings are NOT found on the page |
| failIfContentContains | string[] | Fail if any of these strings ARE found on the page |
Example
{
"url": "https://example.com/dashboard",
"failIfContentMissing": ["Welcome back"],
"failIfContentContains": ["Access Denied", "Error 404"]
}
AI Analysis API New
Analyze any webpage using your own LLM API key. Perfect for competitive intelligence, compliance audits, lead qualification, and automated research. Bring your own OpenAI or Anthropic key (BYOK).
POST /v1/analyze
/v1/analyze
Request Body
| Parameter | Type | Default | Description |
|---|---|---|---|
| url * | string | - | URL to analyze |
| prompt * | string | - | Your analysis prompt (what to look for or extract) |
| provider | string | openai | LLM provider: openai or anthropic |
| apiKey * | string | - | Your LLM API key (OpenAI or Anthropic) |
| model | string | gpt-4o / claude-sonnet-4-20250514 | Model to use (optional override) |
| jsonSchema | object | - | JSON schema for structured output |
| includeScreenshot | boolean | false | Include screenshot in analysis (vision models) |
| includeMetadata | boolean | true | Include page metadata in response |
| maxContentLength | number | 50000 | Max characters to send to LLM |
| blockAds | boolean | true | Block ads before extraction |
| blockCookieBanners | boolean | true | Block cookie consent banners |
Example: Basic Analysis
curl -X POST "https://api.snapapi.pics/v1/analyze" \
-H "X-Api-Key: YOUR_SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://competitor.com/pricing",
"prompt": "List all pricing tiers with their features and prices",
"provider": "openai",
"apiKey": "YOUR_OPENAI_KEY"
}'
Example: Structured Output
Get predictable JSON responses by providing a schema:
curl -X POST "https://api.snapapi.pics/v1/analyze" \
-H "X-Api-Key: YOUR_SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/team",
"prompt": "Extract all team members from this page",
"provider": "openai",
"apiKey": "YOUR_OPENAI_KEY",
"jsonSchema": {
"type": "object",
"properties": {
"team_members": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"role": { "type": "string" },
"bio": { "type": "string" }
},
"required": ["name", "role"]
}
}
},
"required": ["team_members"]
}
}'
Example: Visual Analysis with Screenshot
curl -X POST "https://api.snapapi.pics/v1/analyze" \
-H "X-Api-Key: YOUR_SNAPAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"prompt": "Describe the visual design and UX of this landing page",
"provider": "anthropic",
"apiKey": "YOUR_ANTHROPIC_KEY",
"includeScreenshot": true
}'
Response
{
"success": true,
"url": "https://competitor.com/pricing",
"metadata": {
"url": "https://competitor.com/pricing",
"title": "Pricing - Competitor",
"description": "Simple, transparent pricing"
},
"analysis": "Based on the pricing page, here are the tiers:\n\n1. **Free** ($0/month)\n - 100 requests/month\n - Basic features\n\n2. **Pro** ($29/month)\n - 10,000 requests/month\n - All features\n\n3. **Enterprise** (Custom)\n - Unlimited requests\n - Dedicated support",
"provider": "openai",
"model": "gpt-4o",
"responseTime": 3421
}
Use Cases
- Competitive Intelligence: Monitor competitor pricing, features, and messaging
- Compliance Audits: Check pages for required disclaimers, privacy policy elements
- Lead Qualification: Analyze company websites to score leads
- Content Analysis: Extract topics, sentiment, and key points from articles
- Price Monitoring: Track product prices with structured extraction
- SEO Analysis: Check meta tags, headings, and content structure
PDF API
Generate high-quality PDF documents from any webpage.
Generates a PDF document from the specified URL.
PDF Options
| Parameter | Type | Default | Description |
|---|---|---|---|
| pageSize | string | a4 | Page format: a4, letter, legal |
| landscape | boolean | false | Use landscape orientation |
| printBackground | boolean | true | Include background graphics |
| marginTop | string | 0 | Top margin (e.g., "20mm") |
Batch API
Capture multiple screenshots in a single request.
Process multiple capture requests in parallel.
{
"urls": [
"https://example.com",
"https://example.org",
"https://example.net"
],
"format": "png",
"width": 1920,
"webhookUrl": "https://yoursite.com/webhook"
}
NEW Async & Webhooks
Process screenshots asynchronously with optional webhook notifications. Perfect for long-running captures or when you don't want to wait for the response.
Async Screenshot Request
Add async: true to get an immediate response with a job ID.
{
"url": "https://example.com",
"format": "png",
"fullPage": true,
"async": true,
"webhookUrl": "https://yoursite.com/webhook",
"webhookHeaders": {
"Authorization": "Bearer your-token"
}
}
Async Response
{
"success": true,
"async": true,
"jobId": "abc123xyz",
"status": "pending",
"statusUrl": "/v1/screenshot/async/abc123xyz",
"message": "Screenshot job queued. Poll statusUrl or wait for webhook."
}
Check Job Status
Poll to check job status. Add ?includeData=true to get image data.
// Pending
{
"success": true,
"jobId": "abc123xyz",
"status": "pending",
"createdAt": "2026-02-04T22:00:00.000Z"
}
// Completed
{
"success": true,
"jobId": "abc123xyz",
"status": "completed",
"createdAt": "2026-02-04T22:00:00.000Z",
"completedAt": "2026-02-04T22:00:05.000Z",
"format": "png",
"width": 1280,
"height": 800,
"fileSize": 45678
}
Webhook Payload
When the screenshot completes (or fails), we'll POST to your webhook URL:
// Success
{
"event": "screenshot.completed",
"jobId": "abc123xyz",
"success": true,
"data": "base64-encoded-image-data...",
"format": "png",
"width": 1280,
"height": 800,
"fileSize": 45678
}
// Failure
{
"event": "screenshot.failed",
"jobId": "abc123xyz",
"success": false,
"error": "Timeout waiting for page to load"
}
Webhook Headers
Every webhook includes these headers:
X-SnapAPI-Event: screenshot.completed or screenshot.failedX-SnapAPI-Timestamp: Unix timestamp (ms)Content-Type: application/json
Parameters
| Parameter | Type | Description |
|---|---|---|
| async | boolean | Enable async mode. Returns immediately with job ID. |
| webhookUrl | string | URL to receive webhook when job completes. |
| webhookHeaders | object | Custom headers to include in webhook request (e.g., auth tokens). |
Official SDKs
Use our official SDKs to integrate SnapAPI quickly into your application.
JavaScript
npm install github:Sleywill/snapapi-js
import { SnapAPI } from 'snapapi-js';
const client = new SnapAPI({ apiKey: 'sk_live_xxx' });
const screenshot = await client.screenshot({
url: 'https://example.com',
fullPage: true
});
fs.writeFileSync('screenshot.png', screenshot);
Python
pip install git+https://github.com/Sleywill/snapapi-python
from snapapi import SnapAPI
client = SnapAPI(api_key='sk_live_xxx')
screenshot = client.screenshot(
url='https://example.com',
full_page=True
)
with open('screenshot.png', 'wb') as f:
f.write(screenshot)
Go
go get github.com/Sleywill/snapapi-go
import "github.com/Sleywill/snapapi-go"
client := snapapi.NewClient("sk_live_xxx")
data, err := client.Screenshot(snapapi.ScreenshotOptions{
URL: "https://example.com",
FullPage: true,
})
os.WriteFile("screenshot.png", data, 0644)
PHP
composer require sleywill/snapapi-php
use SnapAPI\Client;
$client = new Client('sk_live_xxx');
$screenshot = $client->screenshot([
'url' => 'https://example.com',
'fullPage' => true
]);
file_put_contents('screenshot.png', $screenshot);
Swift
// Swift Package Manager
.package(url: "https://github.com/Sleywill/snapapi")
import SnapAPI
let client = SnapAPI(apiKey: "sk_live_xxx")
let screenshot = try await client.screenshot(
ScreenshotOptions(url: "https://example.com", fullPage: true)
)
try screenshot.write(to: URL(fileURLWithPath: "screenshot.png"))
Kotlin
// Add JitPack repository first
implementation("com.github.Sleywill.snapapi:kotlin:1.1.0")
val client = SnapAPI("sk_live_xxx")
val screenshot = client.screenshot(
ScreenshotOptions(url = "https://example.com", fullPage = true)
)
File("screenshot.png").writeBytes(screenshot)
Error Codes
All API errors return a JSON response with an error code and message.
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_URL | The provided URL is invalid or malformed |
| 401 | UNAUTHORIZED | Invalid or missing API key |
| 402 | QUOTA_EXCEEDED | Monthly quota exceeded |
| 408 | TIMEOUT | Page load exceeded timeout limit |
| 422 | CONTENT_VALIDATION_FAILED | Content validation conditions not met |
| 429 | RATE_LIMITED | Too many requests |
| 500 | CAPTURE_FAILED | Failed to capture the page |
Error Response Format
{
"success": false,
"error": {
"code": "INVALID_URL",
"message": "The provided URL is invalid. Please include the protocol."
}
}
Rate Limits
Rate limits vary by plan. Exceeding limits returns a 429 status code.
| Plan | Requests/Min | Concurrent | Screenshots/Mo |
|---|---|---|---|
| Free | 10 | 1 | 200 |
| Starter | 60 | 5 | 5,000 |
| Pro | 120 | 10 | 50,000 |
Contact us at slwv.dev@gmail.com for custom enterprise plans.