LinkSnap
API Reference

API Reference

Complete API documentation for LinkSnap

API Reference

LinkSnap provides a simple REST API for capturing web screenshots. All endpoints use JSON for requests and responses.

Base URL

https://api.linksnap.dev

Authentication

All API requests require authentication via Bearer token:

Authorization: Bearer lk_your_api_key

Get your API key from the Console.

Endpoints

Create Screenshot

POST /v1/screenshots

Capture a screenshot of a webpage.

Request Body

ParameterTypeRequiredDescription
urlstringYesThe URL to capture
formatstringNoOutput format: png, jpeg, webp. Default: png
qualitynumberNoImage quality (1-100). Default: 80
fullPagebooleanNoCapture full page. Default: false
viewportobjectNoViewport settings
viewport.widthnumberNoViewport width. Default: 1920
viewport.heightnumberNoViewport height. Default: 1080
delaynumberNoWait time in ms before capture (0-10000). Default: 0
blockAdsbooleanNoBlock ads and trackers. Default: false

Example Request

curl -X POST https://api.linksnap.dev/v1/screenshots \
  -H "Authorization: Bearer lk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "format": "png",
    "fullPage": true,
    "viewport": {
      "width": 1440,
      "height": 900
    }
  }'

Response

{
  "success": true,
  "data": {
    "id": "ss_abc123def456",
    "url": "https://cdn.linksnap.dev/screenshots/ss_abc123def456.png",
    "format": "png",
    "width": 1440,
    "height": 2500,
    "fileSize": 524288,
    "cached": false,
    "createdAt": "2024-01-15T10:30:00.000Z"
  }
}

Get Screenshot

GET /v1/screenshots/:id

Retrieve details about a specific screenshot.

Response

{
  "success": true,
  "data": {
    "id": "ss_abc123def456",
    "url": "https://cdn.linksnap.dev/screenshots/ss_abc123def456.png",
    "sourceUrl": "https://example.com",
    "format": "png",
    "width": 1440,
    "height": 2500,
    "fileSize": 524288,
    "createdAt": "2024-01-15T10:30:00.000Z"
  }
}

List Screenshots

GET /v1/screenshots

List your recent screenshots.

Query Parameters

ParameterTypeDescription
limitnumberMax results (1-100). Default: 20
cursorstringPagination cursor

Response

{
  "success": true,
  "data": [
    {
      "id": "ss_abc123def456",
      "url": "https://cdn.linksnap.dev/screenshots/ss_abc123def456.png",
      "sourceUrl": "https://example.com",
      "format": "png",
      "createdAt": "2024-01-15T10:30:00.000Z"
    }
  ],
  "pagination": {
    "hasMore": true,
    "nextCursor": "ss_xyz789"
  }
}

Error Codes

CodeStatusDescription
INVALID_URL400The provided URL is invalid or blocked
INVALID_FORMAT400Unsupported image format
UNAUTHORIZED401Missing or invalid API key
QUOTA_EXCEEDED429Monthly quota exhausted
RATE_LIMITED429Too many requests
CAPTURE_FAILED500Failed to capture screenshot
TIMEOUT504Page took too long to load

Error Response Format

{
  "success": false,
  "error": {
    "code": "QUOTA_EXCEEDED",
    "message": "Monthly screenshot quota exceeded. Please upgrade your plan."
  }
}

Rate Limits

Rate limits are per API key:

PlanRequests/minute
Free10
Basic30
Pro60
Team120

When rate limited, you'll receive a 429 response with a Retry-After header.

Webhooks

Configure webhooks to receive notifications when screenshots are ready:

{
  "event": "screenshot.completed",
  "data": {
    "id": "ss_abc123def456",
    "url": "https://cdn.linksnap.dev/screenshots/ss_abc123def456.png",
    "status": "success"
  },
  "timestamp": "2024-01-15T10:30:00.000Z"
}

Configure webhooks in your Console settings.