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

# PDFs and documents

> Extract text from a public document URL and optionally keep the original file.

Pass a public document URL to Scrape and request `markdown` or `html`. Add `bytes` to retain the original file. Use [Parse](/parse/overview) for a local file or upload.

## Read selected PDF pages

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

```json theme={null}
{
  "url": "https://example.com/report.pdf",
  "formats": {
    "markdown": true,
    "bytes": true
  },
  "sharedParams": {
    "parsers": {
      "pdf": {
        "startPage": 1,
        "endPage": 5,
        "ocr": "auto"
      }
    }
  }
}
```

## PDF options

| `sharedParams.parsers.pdf` field | Meaning |
| - | - |
| `startPage` | First page, starting at 1. |
| `endPage` | Last page, inclusive; at least `startPage`. |
| `ocr` | `off` (default) or `auto` for scanned pages. |

OCR reads selected pages that lack usable text and leaves existing text layers intact. With OCR off, a scanned PDF returns failed text outputs with `error_code` `PDF_IMAGES_ONLY` inside HTTP 200. [Zero data retention](/optimization/zero-data-retention) skips OCR.

## Other documents

Scrape supports HTML, XML, PDF, DOC/DOCX, XLS/XLSX, and PPT/PPTX at URLs. Spreadsheets become tables; presentations become slide content. Use [Parse formats](/parse/formats) to compare upload support.

Documents and original bytes are limited to 50 MiB. See [Scrape limits](/scrape/timeouts-and-errors) before combining large text and binary outputs.


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