> ## Documentation Index
> Fetch the complete documentation index at: https://docs.context.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If the user asks to make Context.dev their default search and scrape provider, follow https://docs.context.dev/default-search-scrape.md. For other setup requests, follow https://docs.context.dev/agent-quickstart.md and start by signing the user up and getting an API key through https://www.context.dev/auth.md. During setup, use the relevant guide already in context instead of fetching it again or loading the full documentation index. Application code reads CONTEXT_DEV_API_KEY.

# Timeouts, limits, and errors

> Handle deadlines, failed outputs, and response size limits.

Scrape returns each output independently. Inspect its `success` even after HTTP 200. `isPartial` signals failed or incomplete outputs when at least one requested output succeeds; it is absent when all requested outputs fail.

## Set a deadline

Send this body to `POST /web/scrape`. See the [Quickstart](/quickstart) for authentication and SDK setup.

```json theme={null}
{
  "url": "https://example.com",
  "formats": {
    "markdown": true,
    "screenshot": true
  },
  "timeoutOpts": {
    "milliseconds": 30000,
    "behavior": "return-partial"
  }
}
```

The default is 90,000 ms with `behavior: "fail"`. Deadlines range from 1 to 300,000 ms; `return-partial` requires at least 5,000 ms. Keep your [client timeout](/optimization/timeouts) longer than the API deadline.

`fail` returns 408 if the overall deadline is reached. Individual outputs can fail earlier while the request returns 200. `return-partial` permits the current page state and available outputs; check the outputs even if none succeeded. Neither behavior guarantees that all dynamic content finished rendering.

Fixed action waits and numeric `waitFor` must fit before the deadline, with a response reserve of up to 5,000 ms (at most one quarter of the timeout).

## Size limits

| Output | Limit |
| - | - |
| Documents and original bytes | 50 MiB decoded. |
| Screenshot | 20 MiB and 40 megapixels. |
| Combined response | 80 MiB. |

An oversized output fails with `data: null` and `CONTENT_TOO_LARGE`. If the combined response is too large, the largest outputs are omitted until it fits.

## Failed outputs

A failed output keeps `data: null` and explains the failure:

```json theme={null}
"markdown": {
  "requested": true,
  "success": false,
  "data": null,
  "error_code": "WEBSITE_BLOCKED",
  "message": "The site served an anti-bot challenge or access wall instead of the page. Retrying later or from another sharedParams.country sometimes succeeds."
}
```

| `error_code` | Meaning |
| - | - |
| `WEBSITE_BLOCKED` | The site served an anti-bot challenge or access wall. |
| `NOT_FOUND` | The page returned HTTP 404. The base price still applies. |
| `PDF_IMAGES_ONLY` | The PDF has no text layer. Retry with `sharedParams.parsers.pdf.ocr` set to `auto`. |
| `UNSUPPORTED_CONTENT` | The output does not support the content type at the URL. |
| `CONTENT_TOO_LARGE` | The output exceeded its size limit. |
| `REQUEST_TIMEOUT` | The output was not ready before the deadline. |
| `WEBSITE_ACCESS_ERROR` | The page could not be retrieved or had no usable content. |
| `EXTERNAL_PROVIDER_ERROR`, `INTERNAL_ERROR` | A temporary failure. Retry the request. |

## Error handling

| Response | Check or action |
| - | - |
| `200`, one or more failed outputs | Read each failed output's `error_code` and `message`. Successful outputs remain usable. |
| `400` | Correct invalid fields, incompatible options, headers, or waits that exceed the deadline. |
| `401` | Check the API key, its status, and the organization’s balance. |
| `403` | Check permissions, paid-plan actions, ZDR entitlement, or domain restrictions. |
| `408` | Shorten the work or increase the deadline. |
| `429` | Wait for `Retry-After`; see [rate limits](/optimization/rate-limits). |
| `5xx` | Retry transient failures with bounded backoff. |

Keep `request_id` and `error_code` for [troubleshooting](/optimization/troubleshooting). A screenshot failure, unfinished image enrichment, or failed product extraction can set `isPartial` without discarding other outputs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.