Docs/Api/Snapshots API
Api

Snapshots API

Capture and manage visual snapshots.

2 min read

Snapshots API

Capture, retrieve, and manage snapshots programmatically.

List Snapshots

GET /v1/projects/{projectId}/snapshots

Query params:

  • page - Page number
  • limit - Items per page
  • from - Start date (ISO 8601)
  • to - End date (ISO 8601)

Response:

{
  "data": [
    {
      "id": "snap_abc123",
      "projectId": "proj_xyz",
      "url": "https://example.com/page",
      "imageUrl": "https://cdn.inpera.app/snapshots/...",
      "viewport": {
        "width": 1920,
        "height": 1080
      },
      "createdAt": "2024-12-24T12:00:00Z"
    }
  ]
}

Get Snapshot

GET /v1/snapshots/{snapshotId}

Capture Snapshot

POST /v1/snapshots
Content-Type: application/json

{
  "projectId": "proj_xyz",
  "url": "https://example.com/page",
  "viewport": {
    "width": 1440,
    "height": 900,
    "deviceScaleFactor": 2
  },
  "fullPage": true,
  "waitForSelector": ".content-loaded"
}

Response: 202 Accepted (async operation)

{
  "data": {
    "id": "snap_new123",
    "status": "processing",
    "estimatedTime": 10
  }
}

Capture Options

Option Type Default Description
viewport.width number 1920 Viewport width
viewport.height number 1080 Viewport height
fullPage boolean false Capture entire page
waitForSelector string - Wait for element
delay number 0 Delay before capture (ms)
hideSelectors string[] - Elements to hide

Delete Snapshot

DELETE /v1/snapshots/{snapshotId}

Compare Snapshots

POST /v1/snapshots/compare
Content-Type: application/json

{
  "baselineId": "snap_abc",
  "comparisonId": "snap_xyz"
}

Response includes diff percentage and highlighted image.