HTTP API Reference

This is the public HTTP API for Snap.

Base URL

https://snap.i2dev.com

Authentication

Pass your API key using either header:

Authorization: Bearer YOUR_API_KEY

or

x-api-key: YOUR_API_KEY

POST /v1/screenshots

Captures a screenshot of a URL (synchronous). Returns an imageUrl plus metadata.

Example request (copy/paste)

curl -sS -X POST https://snap.i2dev.com/v1/screenshots   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{
    "url": "https://example.com",
    "format": "png",
    "fullPage": false,
    "viewport": { "width": 1280, "height": 720 },
    "waitUntil": "load"
  }'

Example response

{
  "jobId": "...",
  "request_id": "...",
  "imageUrl": "https://snap.i2dev.com/_local/jobs/...png",
  "contentType": "image/png",
  "bytes": 12345,
  "durationMs": 987,
  "logs": [],
  "page_errors": []
}

Async mode (for long renders)

Set "async": true in the POST /v1/screenshots body to queue the render and return immediately. Then poll GET /v1/jobs/:id for status.

Async submit example

curl -sS -X POST https://snap.i2dev.com/v1/screenshots   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{
    "url": "https://example.com",
    "format": "png",
    "async": true
  }'

Async submit response

{
  "jobId": "...",
  "request_id": "...",
  "status": "queued",
  "statusUrl": "https://snap.i2dev.com/v1/jobs/..."
}

Poll job status

curl -sS -H "Authorization: Bearer YOUR_API_KEY"   https://snap.i2dev.com/v1/jobs/JOB_ID

Job status response (done)

{
  "jobId": "...",
  "status": "succeeded",
  "result": {
    "imageUrl": "https://snap.i2dev.com/_local/jobs/...png",
    "contentType": "image/png",
    "bytes": 12345,
    "durationMs": 987
  }
}

Request body

FieldTypeRequiredDescription
urlstringYesThe URL to screenshot (public http/https only; SSRF protections enabled).
format"png" | "jpeg"NoDefault: png
fullPagebooleanNoCapture full scrollable page. Default: false
viewport{ width, height }NoDefault: {"width":1280,"height":720}
waitUntil"load" | "domcontentloaded" | "networkidle"NoDefault: load
waitForSelectorstringNoWait for a CSS selector before capturing.
timeoutMsnumberNoOverall render timeout (bounded by server max).
navTimeoutMsnumberNoNavigation timeout (bounded by server max).
timezoneIdstringNoExample: America/Toronto
localestringNoExample: en-US
extraHTTPHeadersobjectNoExtra request headers (string → string).
cookiesarrayNoCookies to set before navigation.
asyncbooleanNoQueue render and return immediately (requires async mode enabled).

Errors

Errors are returned as JSON and include a request_id. Include that ID when reporting issues.

{
  "error": "Invalid or missing API key",
  "code": "unauthorized",
  "request_id": "..."
}

Common HTTP status codes:

  • 400 bad_request / unsafe_url
  • 401 unauthorized
  • 429 rate_limited / too_many_inflight
  • 500 internal_server_error