Skip to main content
The /capture endpoint is the core of the Snapopa API. It takes a URL and returns a screenshot, PDF, or metadata.

Endpoint

POST https://api.snapopa.com/capture

Basic Request

{
  "url": "https://example.com"
}

Full Request Example

{
  "url": "https://example.com",
  "format": "png",
  "viewport": {
    "width": 1920,
    "height": 1080
  },
  "isFullPage": false,
  "quality": 95,
  "timeout": 30000,
  "waitUntil": "domcontentloaded",
  "responseCache": {
    "enabled": true,
    "ttl": 86400
  }
}

Response

{
  "success": true,
  "error": null,
  "data": {
    "uuid": "capture-uuid",
    "fileUrl": "https://cdn.snapopa.com/capture-uuid.png",
    "fromCache": false,
    "tokenCost": 1,
    "fileSizeBytes": 245678,
    "processingTimeMs": 1234,
    "metadata": {
      "mimeType": "image/png",
      "width": 1920,
      "height": 1080,
      "createdAt": 1703001234
    }
  }
}

Request Flow

  1. Validation - Request body is validated against the schema
  2. Cache Check - If caching is enabled, check for existing capture
  3. Authentication - API key is verified
  4. Rate Limiting - Request is checked against rate limits
  5. Capture - Screenshot is taken using headless browser
  6. Storage - Result is stored on CDN
  7. Response - URL and metadata are returned
Average capture time is 1-3 seconds depending on page complexity and options selected.