Docs🌐 WebWebpage Screenshot
POST/api/screenshot$0.005

🌐 Webpage Screenshot

Capture screenshots of any publicly accessible webpage using a headless browser. Returns a CDN URL of the PNG screenshot. Supports full-page captures and custom viewport dimensions.

Request Body

ParameterTypeRequiredDescriptionDefault
urlstringrequiredURL of the webpage to screenshot
fullPagebooleanoptionalCapture full page (scrolled)false

Response Fields

FieldTypeDescription
urlstringCDN URL of the PNG screenshot
widthnumberScreenshot width in pixels
heightnumberScreenshot height in pixels

Code Examples

cURL
bash
curl -X POST https://sparkforge.sh/api/screenshot \
  -H "Content-Type: application/json" \
  -H "X-PAYMENT: <x402-payment-token>" \
  -d '{
    "url": "https://sparkforge.sh",
    "fullPage": false
  }'
Python
python
import requests

response = requests.post(
    "https://sparkforge.sh/api/screenshot",
    headers={"Content-Type": "application/json", "X-PAYMENT": "<token>"},
    json={"url": "https://sparkforge.sh", "fullPage": True}
)

data = response.json()
print(data["url"])  # → CDN URL of the screenshot
TypeScript / Node.js
typescript
const res = await fetch402("https://sparkforge.sh/api/screenshot", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ url: "https://sparkforge.sh", fullPage: false }),
});

const { url, width, height } = await res.json();

Example Response

json
{
  "url": "https://cdn.sparkforge.sh/screenshots/abc123.png",
  "width": 1280,
  "height": 800
}

💳 Payment via x402

This endpoint costs $0.005 per call, paid in USDC on Base, Polygon, or Solana. Use the @x402/fetch library to handle payments automatically, or implement the x402 handshake manually.

bash
# Free demo mode (no payment)
curl https://sparkforge.sh/api/screenshot?demo=true

# Or try via MCP (Claude Desktop, Cursor, Windsurf)
# Add to mcp config: { "url": "https://sparkforge.sh/api/mcp" }
Previous
Text Summarizer
Next
Web Scraper