Skip to main content
All API responses follow a consistent JSON structure.

Success Response

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

Response Fields

FieldTypeDescription
successbooleanWhether the request succeeded
errorobject/nullError details if failed
dataobject/nullResponse data if successful

Data Object

FieldTypeDescription
uuidstringUnique capture identifier
fileUrlstringCDN URL to the capture
fromCachebooleanWhether served from cache
tokenCostnumberCredits consumed
fileSizeBytesnumberFile size in bytes
processingTimeMsnumberProcessing time in ms
metadataobjectCapture metadata

Metadata Object

FieldTypeDescription
mimeTypestringFile MIME type
widthnumberImage width in pixels
heightnumberImage height in pixels
createdAtnumberUnix timestamp (seconds)

Binary Response

When using responseType: "file", the response is the raw file:
curl -X POST https://api.snapopa.com/capture \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "responseType": "file"}' \
  -o screenshot.png
Response headers include:
  • Content-Type: image/png, image/jpeg, image/webp, or application/pdf
  • Content-Length: File size in bytes
  • X-Capture-UUID: Capture identifier

Error Response

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid URL format"
  },
  "data": null
}
See Error Handling for complete error codes.

HTTP Status Codes

StatusMeaning
200Success
400Bad Request (validation error)
401Unauthorized (invalid API key)
402Payment Required (quota exceeded)
429Too Many Requests (rate limited)
500Internal Server Error