```yaml
product: AlterLab
title: Screenshots and PDF
category: guides
comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data."
source_url: https://alterlab.io/docs/guides/screenshots
```

# Screenshots and PDF

Capture a rendered page as an image or a PDF in the same request that fetches its content. See the [Screenshot API](/screenshot-api) overview.

| Capture | Add-on price |
|---|---|
| Screenshot | +$0.0002 |
| PDF | +$0.0004 |

## Full page

`advanced.screenshot` captures the whole page and returns `screenshot_url`. It requires `render_js` set to `true`; `auto` is rejected.

```bash
curl -X POST https://api.alterlab.io/api/v1/scrape \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/pricing",
    "advanced": {"render_js": true, "screenshot": true}
  }'
```

```python
from alterlab import AlterLabSync, AdvancedOptions

with AlterLabSync(api_key="YOUR_API_KEY") as client:
    resp = client.scrape(
        "https://example.com/pricing",
        mode="js",
        advanced=AdvancedOptions(render_js=True, screenshot=True),
    )
    print(resp["screenshot_url"])
```

> Consent overlays are hidden before capture by default. Set `consent` to `accept` or `reject` to click the banner instead.

## Viewport

A `screenshot` action captures at that point in a browser action sequence. `full_page` defaults to true; set it to false for the visible viewport. Each captured image costs $0.0002, and a failed capture is free.

```bash
curl -X POST https://api.alterlab.io/api/v1/scrape \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/pricing",
    "advanced": {
      "render_js": true,
      "actions": [{"type": "screenshot", "full_page": false}]
    }
  }'
```

## Formats

The capture is delivered as a stored image at `screenshot_url` and a document at `pdf_url`. The request has no option to choose an image format, quality or viewport size.

## Element capture

Capturing a single element by selector is not available. A screenshot covers the full page or the viewport. Use the [browser actions](/docs/guides/browser-actions) to scroll or click to the state you want, then capture.

## PDF generation

Set `advanced.generate_pdf` to true with `render_js` true. The response carries `pdf_url`.

```bash
curl -X POST https://api.alterlab.io/api/v1/scrape \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/pricing",
    "advanced": {"render_js": true, "generate_pdf": true}
  }'
```

## Pricing

Captures need browser rendering, billed at the $0.004 browser tier. A screenshot adds $0.0002 and a PDF adds $0.0004. See [pricing](/pricing).
