> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snapopa.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Capture Overview

> Introduction to the /capture endpoint

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

```json theme={null}
{
  "url": "https://example.com"
}
```

## Full Request Example

```json theme={null}
{
  "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

```json theme={null}
{
  "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

<Note>
  Average capture time is 1-3 seconds depending on page complexity and options selected.
</Note>

## Related

* [Parameters](/capture/parameters) - All available options
* [Formats](/capture/formats) - Output format options
* [Caching](/capture/caching) - Cache configuration
