# Screenshots

Functions for interacting with the `screenshots` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.

## Create Screenshot

Capture a screenshot

Sync by default (holds up to 28s). Pass `async: true` in the body or `?async=true` in the
query string to return 202 immediately; either one is enough, and `false` in one never
cancels `true` in the other.
Poll via GET /v1/screenshots/\{id\}.

**Limits:** request bodies are capped at 512 KB. An oversized body
returns a `400` with error code `request_too_large`.

**Parameters**

- `async_ (bool | Unset)`
- `body (ScreenshotRequest)`
- `url` — `str`
- `device` — `ScreenshotRequestDevice | Unset`
- `viewport` — `None | Unset | Viewport`
- `async_` — `bool | Unset` — When true, the request returns 202 immediately and the screenshot is captured in the background; poll `GET /v1/screenshots/\{id\}`. The `?async=true` query parameter is a second spelling of this field: the request is async when either one says true, and `false` in one never cancels `true` in the other.
- `full_page` — `bool | Unset`
- `format_` — `ScreenshotRequestFormat | Unset`
- `quality` — `int | Unset`
- `block_ads` — `bool | Unset`
- `block_cookie_banners` — `bool | Unset`
- `wait_until` — `ScreenshotRequestWaitUntil | Unset`
- `wait_for_selector` — `None | str | Unset`
- `delay_ms` — `int | Unset`
- `scroll` — `bool | Unset`
- `clip` — `Clip | None | Unset`
- `dark_mode` — `bool | Unset`
- `device_scale_factor` — `None | ScreenshotRequestDeviceScaleFactorType1 | ScreenshotRequestDeviceScaleFactorType2Type1 | ScreenshotRequestDeviceScaleFactorType3Type1 | Unset`
- `include_html` — `bool | Unset`
- `country` — `str | Unset`
- `language` — `None | str | Unset`
- `metadata` — `Metadata | Unset` — Arbitrary key-value metadata. Max 4096 bytes when JSON-serialized.

**Call styles**

```python
sync_detailed(client=client, body=body, async_=async_) -> Response[Error | Error | ScreenshotResponse | ScreenshotResponse]
sync(client=client, body=body, async_=async_) -> Error | Error | ScreenshotResponse | ScreenshotResponse | None
await asyncio_detailed(client=client, body=body, async_=async_) -> Response[Error | Error | ScreenshotResponse | ScreenshotResponse]
await asyncio(client=client, body=body, async_=async_) -> Error | Error | ScreenshotResponse | ScreenshotResponse | None
```

## Get Screenshot

Get screenshot status

**Parameters**

- `id (str)`

**Call styles**

```python
sync_detailed(id=id, client=client) -> Response[Error | Error | ScreenshotResponse | ScreenshotResponse]
sync(id=id, client=client) -> Error | Error | ScreenshotResponse | ScreenshotResponse | None
await asyncio_detailed(id=id, client=client) -> Response[Error | Error | ScreenshotResponse | ScreenshotResponse]
await asyncio(id=id, client=client) -> Error | Error | ScreenshotResponse | ScreenshotResponse | None
```