# Archive Page

Archive one public webpage into durable offline artifacts for saved-page collections. Returns best-effort self-contained HTML and ZIP snapshots with CSS/images/fonts/media/scripts rewritten or packed, plus optional PDF when a Chrome/Chromium backend is configured.

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

## Request

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

```bash
curl -X POST https://data.upscrape.com/execute \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"formats":["single_html","zip"],"include_scripts":false,"url":"https://example.com/"},"capability":"web.page.archive"}'
```

## Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `formats` | `array<string>` | No | Archive artifact formats to return. single_html is a self-contained HTML snapshot, zip contains index.html plus local assets, and pdf requires a configured Chrome/Chromium backend. If a requested single_html artifact is too large for the worker-result budget and zip was not requested, the module may return a zip fallback. |
| `include_scripts` | `boolean` | No | Preserve external and inline scripts. Defaults to false because archived arbitrary JavaScript should only be replayed in a sandboxed viewer. |
| `max_asset_bytes` | `integer` | No | Requested maximum bytes to download for a single CSS/image/font/script/media asset. The module may clamp this lower to keep the worker result under platform size limits. |
| `max_total_asset_bytes` | `integer` | No | Requested maximum bytes to download across all archived assets. The module may clamp this lower to keep the worker result under platform size limits. |
| `url` | `string` | Yes | Public http(s) URL to archive. |

### Example input

```json
{
  "formats": [
    "single_html",
    "zip"
  ],
  "include_scripts": false,
  "url": "https://example.com/"
}
```

## Response

Successful output is returned in `results[0].data`. Raw platform output is intentionally open-ended and may evolve with the upstream source.

No committed sample output is available for this capability.


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

See [jobs and results](https://docs.upscrape.com/docs/api/jobs), [errors and retries](https://docs.upscrape.com/docs/api/errors), and [idempotency](https://docs.upscrape.com/docs/api/idempotency).

## Machine-readable contract

- [Capability OpenAPI 3.1](https://docs.upscrape.com/docs/platforms/web/web.page.archive/openapi.json)
- [Platform OpenAPI 3.1](https://upscrape.com/scrapers/web/openapi.json)
- [Focused coding-agent prompt](https://upscrape.com/scrapers/web/capabilities/web.page.archive/llm.md)
