📸 Screenshot API — Documentation

Base URL: https://api.sitegrab.dev

Quickstart · Authentication · Endpoints · Pricing · Code Examples · Status Codes · Rate Limiting

Quickstart

Get started in 30 seconds:

# Step 1: Get a free API key
curl -X POST https://api.sitegrab.dev/v1/keys -H 'Content-Type: application/json' -d '{"tier":"free"}'

# → Returns {"api_key":"lf_...","tier":"free","limit":50}

# Step 2: Take your first screenshot
curl -X POST https://api.sitegrab.dev/v1/screenshot   -H 'Authorization: Bearer YOUR_API_KEY'   -H 'Content-Type: application/json'   -d '{"url":"https://example.com"}'   --output screenshot.png

That's it. Your free tier gives you 50 screenshots/month with 10 requests/minute rate limit. Check usage anytime at https://api.sitegrab.dev/v1/usage.

Authentication

Include your API key in one of these ways:

# Option 1: Authorization header
curl -H 'Authorization: Bearer YOUR_API_KEY' 'https://api.sitegrab.dev/v1/screenshot?url=https://example.com'

# Option 2: X-API-Key header
curl -H 'X-API-Key: YOUR_API_KEY' 'https://api.sitegrab.dev/v1/screenshot?url=https://example.com'

# Option 3: Query parameter (GET only)
curl 'https://api.sitegrab.dev/v1/screenshot?url=https://example.com&key=YOUR_API_KEY'

Endpoints

GET /v1/health

Health check endpoint. Returns API status and version.

curl 'https://api.sitegrab.dev/v1/health'
POST /v1/screenshot

Capture a screenshot of a webpage. Returns the screenshot file directly or a JSON response with status.

curl -X POST https://api.sitegrab.dev/v1/screenshot \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "format": "png",
    "full_page": true
  }'
ParameterTypeRequiredDescription
urlstringYesThe webpage URL to capture (must start with http:// or https://)
formatstringNoOutput format: png, jpeg, or pdf (default: png)
full_pagebooleanNoCapture full-page screenshot (default: true)
viewportstringNoViewport size, e.g. "1920x1080" (default: "1280x720")
delay_msnumberNoWait milliseconds before capture (default: 0)
GET /v1/screenshot?url=https://...

Simple GET endpoint for easy embedding. Same parameters as POST but via query string.

curl "https://api.sitegrab.dev/v1/screenshot?url=https://example.com&format=png" \
  -H "Authorization: Bearer YOUR_API_KEY"
GET /v1/usage

Get your current usage statistics and plan limits.

curl 'https://api.sitegrab.dev/v1/usage' -H 'Authorization: Bearer YOUR_API_KEY'
POST /v1/checkout

Create a Stripe Checkout session for subscription signup.

curl -X POST https://api.sitegrab.dev/v1/checkout \
  -H "Content-Type: application/json" \
  -d '{"tier": "pro"}'

Tiers: starter ($9/mo), pro ($19/mo), business ($49/mo)

POST /v1/keys

Create a new API key. No authentication required for free tier.

curl -X POST https://api.sitegrab.dev/v1/keys   -H 'Content-Type: application/json'   -d '{"tier": "free"}'
ParameterTypeRequiredDescription
tierstringNoKey tier: free, starter, pro, business (default: free)
customer_idstringNoOptional identifier for your records

Pricing

TierPriceScreenshots/moRate Limit
Free$05010 req/min
Starter$9/mo50060 req/min
Pro$19/mo2,000120 req/min
Business$49/mo10,000300 req/min

Code Examples

Python

import requests

API_KEY = "your_api_key_here"
API_URL = "https://api.sitegrab.dev/v1/screenshot"

response = requests.post(API_URL,
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={"url": "https://example.com", "format": "png"}
)
print(response.json())

JavaScript

const API_KEY = "your_api_key_here";
const API_URL = "https://api.sitegrab.dev/v1/screenshot";

const response = await fetch(API_URL, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ url: "https://example.com", format: "png" })
});
const data = await response.json();
console.log(data);

cURL

curl -X POST https://api.sitegrab.dev/v1/screenshot \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "format": "png", "full_page": true}'

Go

package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

func main() {
    url := "https://api.sitegrab.dev/v1/screenshot"
    body := json.encode({"url": "https://example.com", "format": "png"})
    
    req := http.post(url, "application/json", body)
    req.headers["Authorization"] = "Bearer your_api_key_here"
    
    resp := req.send()
    print(resp.body())
}

Ruby

require 'net/http'
require 'json'

uri = URI('https://api.sitegrab.dev/v1/screenshot')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri.request_uri)
request['Authorization'] = 'Bearer your_api_key_here'
request['Content-Type'] = 'application/json'
request.body = {url: 'https://example.com', format: 'png'}.to_json

response = http.request(request)
puts response.body

PHP

$apiKey = 'your_api_key_here';
$url = 'https://api.sitegrab.dev/v1/screenshot';

$options = [
  'method' => 'POST',
  'headers' => [
    'Authorization' => 'Bearer ' . $apiKey,
    'Content-Type' => 'application/json'
  ],
  'body' => json_encode(['url' => 'https://example.com', 'format' => 'png'])
];

$response = wp_remote_get($url, $options);
echo $response['body'];

Status Codes

CodeMeaning
200Success — screenshot captured and returned
202Accepted — request queued (VPS rendering), check back later
400Bad request — missing or invalid parameters
401Unauthorized — missing or invalid API key
429Rate limit exceeded — slow down your requests
500Server error — try again later

Rate Limiting

Rate limits are enforced per API key. Headers included in every response:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1702224000

Support

Questions? Issues? Email [R#dnsOg] or check https://sitegrab.dev.

API Home · LaminarForge · Pricing