Quickstart Guide
This guide will help you capture your first screenshot in under 5 minutes. No complex setup required.
Step 1: Get Your API Key
Sign up for a free account and get your API key from the dashboard. Your API key looks like this:
Keep your API key secret
Never expose your API key in client-side code. Use environment variables or a backend proxy.
Step 2: Make Your First Request
Use cURL, your favorite HTTP client, or one of our SDKs to capture a screenshot:
Using cURL
curl -X POST https://api.screencraft.dev/v2/screenshot \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"viewport": { "width": 1920, "height": 1080 },
"format": "png"
}' Using Node.js
const response = await fetch('https://api.screencraft.dev/v2/screenshot', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_live_your_api_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://example.com',
viewport: { width: 1920, height: 1080 },
format: 'png',
}),
});
const data = await response.json();
console.log('Screenshot URL:', data.data.url); Using Python
import requests
response = requests.post(
'https://api.screencraft.dev/v2/screenshot',
headers={
'Authorization': 'Bearer sk_live_your_api_key',
'Content-Type': 'application/json',
},
json={
'url': 'https://example.com',
'viewport': {'width': 1920, 'height': 1080},
'format': 'png',
}
)
data = response.json()
print('Screenshot URL:', data['data']['url']) Step 3: Get Your Screenshot
The API returns a JSON response with the screenshot URL:
{
"success": true,
"data": {
"url": "https://cdn.screencraft.dev/s/abc123.png",
"width": 1920,
"height": 1080,
"format": "png",
"size": 245678,
"created_at": "2025-12-27T10:30:00Z"
}
} The screenshot is hosted on our CDN and available for 24 hours. Download it or use the URL directly.
Common Options
Full Page Screenshot
Capture the entire page, including content below the fold:
{
"url": "https://example.com",
"fullPage": true
} Specific Element
Capture only a specific element using a CSS selector:
{
"url": "https://example.com",
"selector": "#main-content",
"padding": 20
} Wait for Content
Wait for dynamic content to load before capturing:
{
"url": "https://example.com",
"waitFor": {
"selector": ".loaded",
"timeout": 5000
}
} Mobile Viewport
Capture with a mobile device viewport:
{
"url": "https://example.com",
"viewport": {
"width": 375,
"height": 812,
"deviceScaleFactor": 3,
"isMobile": true
},
"device": "iPhone 14 Pro"
} Next Steps
Now that you've captured your first screenshot, explore more features: