> ## 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.

# Output Formats

> Available output formats for captures

Snapopa supports multiple output formats for different use cases.

## Available Formats

| Format | MIME Type         | Use Case                           |
| ------ | ----------------- | ---------------------------------- |
| `png`  | `image/png`       | High quality, transparency support |
| `jpeg` | `image/jpeg`      | Smaller file size, photos          |
| `webp` | `image/webp`      | Modern format, best compression    |
| `pdf`  | `application/pdf` | Documents, printing                |

## PNG (Default)

Best for screenshots with text, UI elements, or transparency.

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

* Lossless compression
* Supports transparency
* Larger file sizes

## JPEG

Best for photos and when file size matters.

```json theme={null}
{
  "url": "https://example.com",
  "format": "jpeg",
  "quality": 85
}
```

* Lossy compression (controlled by `quality`)
* Smaller files
* No transparency support

<Note>
  The `quality` parameter (1-100) only affects JPEG and WebP formats.
</Note>

## WebP

Modern format with excellent compression.

```json theme={null}
{
  "url": "https://example.com",
  "format": "webp",
  "quality": 90
}
```

* Best compression ratio
* Supports transparency
* Wide browser support

## PDF

For document-style captures and printing.

```json theme={null}
{
  "url": "https://example.com",
  "format": "pdf",
  "isFullPage": true
}
```

* Vector text (searchable/selectable)
* Best for printing
* Often used with `isFullPage: true`

## Response Types

Control how the capture is returned:

<Tabs>
  <Tab title="JSON (default)">
    ```json theme={null}
    {
      "url": "https://example.com",
      "responseType": "json"
    }
    ```

    Response:

    ```json theme={null}
    {
      "success": true,
      "data": {
        "fileUrl": "https://cdn.snapopa.com/abc.png",
        "metadata": { ... }
      }
    }
    ```
  </Tab>

  <Tab title="Binary File">
    ```json theme={null}
    {
      "url": "https://example.com",
      "responseType": "file"
    }
    ```

    Response: Raw binary file with appropriate `Content-Type` header.
  </Tab>
</Tabs>

## Format Comparison

| Feature       | PNG      | JPEG   | WebP     | PDF    |
| ------------- | -------- | ------ | -------- | ------ |
| Transparency  | Yes      | No     | Yes      | No     |
| Compression   | Lossless | Lossy  | Both     | -      |
| Quality param | No       | Yes    | Yes      | No     |
| Best for      | UI/Text  | Photos | General  | Docs   |
| Avg size      | Large    | Small  | Smallest | Varies |
