ViperCapture
API documentation

Quickstart

Create an API key and send a render request.

1. Create an API key

Sign in and create an API key from the dashboard. Each account has one key. The dashboard shows the raw key once. Store it in a server-side secret manager. Do not put it in browser JavaScript or a public repository.

2. Send POST /v1/render

TypeScript.ts
const response = await fetch("https://capture.viperisuseful.cc/v1/render", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.VIPERCAPTURE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://example.com",
    output: "png",
    viewport: { width: 1440, height: 900 },
    full_page: true,
    cache: true,
    lazy_load: "adaptive",
    cleanup: { consent_mode: "reject", block_ads: true },
  }),
})

if (!response.ok) {
  const error = await response.json()
  throw new Error(`${error.error.code}: ${error.error.message}`)
}

const image = Buffer.from(await response.arrayBuffer())

3. Read the response headers

Record X-Request-Id with the render. The response can also include X-ViperCapture-Queue-Ms, X-ViperCapture-Render-Ms, X-ViperCapture-Navigation-Status, X-ViperCapture-Output-Count, X-ViperCapture-Cache, X-ViperCapture-Credit-Cost, and the standard RateLimit-* headers. A 429 response includes Retry-After. Remove cache:true when the request must produce a new render.