# Extract Page

Capture one public webpage and return data shaped by a caller-provided JSON Schema or fields shorthand. Deterministic extraction (metadata, evidence graph, filtered URL enumeration) runs first; internal AI resolves remaining fields per the ai mode (never/auto/always), grounded to captured page content.

- Platform: [Universal Web](https://docs.upscrape.com/docs/platforms/web)
- Capability ID: `web.page.extract`
- 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":{"ai":"never","fields":{"canonical_url":"canonical url of the page","description":"short page description","title":"page title"},"url":"https://example.com/"},"capability":"web.page.extract"}'
```

## Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `ai` | `string` | No | Extraction mode. never: deterministic only. auto: deterministic first, internal AI only for unresolved fields (degrades gracefully when AI is unavailable). always: deterministic plus AI. Defaults to auto when fields is used, otherwise never. |
| `ai_enabled` | `boolean` | No | Deprecated alias for ai: always. Prefer the ai parameter. |
| `fields` | `object` | No | Shorthand alternative to output_schema: field name mapped to a natural-language description of what to extract. Compiled into a schema internally. Provide exactly one of output_schema or fields. |
| `instructions` | `string` | No | Optional extraction guidance. Do not include secrets. |
| `output_schema` | `object` | No | JSON Schema object describing the desired data shape. Property descriptions double as per-field extraction hints. Constraints such as items.pattern filter deterministic URL enumeration. Provide exactly one of output_schema or fields. |
| `url` | `string` | Yes | Public http(s) URL to extract from. |

### Example input

```json
{
  "ai": "never",
  "fields": {
    "canonical_url": "canonical url of the page",
    "description": "short page description",
    "title": "page title"
  },
  "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.extract/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.extract/llm.md)
