# Capture pages (batch)

Capture up to 20 public URLs in one request, returning each page's result or its own error.

- Platform: [Universal Web](https://docs.upscrape.com/docs/platforms/web)
- Capability ID: `web.pages.capture`
- Cost: 1 credit per request
- Maximum runtime: 600 seconds
- Execute endpoint: `POST https://data.upscrape.com/execute`

## Request

Use the exact public capability ID in the shared execute envelope.

```bash
curl --request POST \
  --url https://data.upscrape.com/execute \
  --header "Authorization: Bearer $UPSCRAPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Prefer: wait=30" \
  --data '{
  "input": {
    "concurrency": 4,
    "urls": [
      "https://example.com/",
      "https://www.iana.org/help/example-domains"
    ]
  },
  "capability": "web.pages.capture"
}'
```

## Input


| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accept_statuses` | `array<integer>` | No |  |
| `allow_browser_fallback` | `boolean` | No | Default: `true`. |
| `allow_truncated` | `boolean` | No | Default: `false`. |
| `concurrency` | `integer` | No | Maximum URLs captured at once. From 1 to 8. Default: `4`. |
| `detail` | `string` | No | Per-page detail, identical to web.page.capture. Allowed values: `summary`, `standard`, `full`. Default: `standard`. |
| `document` | `object` | No | Document options applied to every URL; ignored for ordinary HTML. |
| `exclude_selectors` | `array<string>` | No |  |
| `headers` | `object` | No | Extra request headers for every URL. Host cannot be set. |
| `include_selectors` | `array<string>` | No |  |
| `main_content_only` | `boolean` | No | Keep per-page Markdown to the main content. Default: `true`. |
| `max_body_bytes` | `integer` | No | From 1 to 104857600. |
| `max_total_bytes` | `integer` | No | From 1 to 104857600. |
| `urls` | `array<string>` | Yes | Public http(s) URLs to capture in one bounded batch. |

### Example input

```json
{
  "concurrency": 4,
  "urls": [
    "https://example.com/",
    "https://www.iana.org/help/example-domains"
  ]
}
```

## Response

Successful output is returned in `results[0].data`.

Raw platform output is intentionally open-ended and may evolve with the upstream source.

### Illustrative sample output

This example shows one response. Values and optional fields vary with the data available.

```json
{
  "results": [
    {
      "elapsed_ms": 640,
      "output": {
        "content_type": "text/html",
        "final_url": "https://example.com/",
        "parsed": {
          "markdown": "# Example Domain\n\nThis domain is for use in documentation examples.",
          "parser": "html_dom"
        },
        "status_code": 200,
        "url": "https://example.com/"
      },
      "success": true,
      "url": "https://example.com/"
    },
    {
      "elapsed_ms": 120,
      "error": {
        "code": "upstream_error",
        "message": "The requested data could not be retrieved. Try again later."
      },
      "success": false,
      "url": "https://missing.example/"
    }
  ],
  "stats": {
    "failed": 1,
    "requested": 2,
    "succeeded": 1
  },
  "warnings": [
    "batch_partial_failure"
  ]
}
```
### Illustrative output fields

Derived from the sample above for orientation only. These fields are not a fixed response schema.

| Path | Observed type | Example |
| --- | --- | --- |
| `results` | `array` | 2 items |
| `results` | `array` | 2 items |
| `stats` | `object` | 3 fields |
| `stats.failed` | `integer` | 1 |
| `stats.requested` | `integer` | 2 |
| `stats.succeeded` | `integer` | 1 |
| `warnings` | `array` | 1 items |
| `warnings` | `array` | 1 items |

## Execution behavior

A `200` response completed inline. A `202` response was queued; poll `GET /jobs/{id}` until the job reaches `completed` or `failed`. Use an `Idempotency-Key` when retrying must not create a duplicate logical job.

## Related documentation

- [Authentication](https://docs.upscrape.com/docs/api/authentication)
- [Jobs and results](https://docs.upscrape.com/docs/api/jobs)
- [Errors and retries](https://docs.upscrape.com/docs/api/errors)
- [Idempotency](https://docs.upscrape.com/docs/api/idempotency)
