# PDF to Text API
> Extract text from PDF documents: the complete document text, the text of every page separately, the document metadata (page count, title, author, subject, keywords, creator, producer, creation and modification dates, PDF version, encryption and outline flags), and a full in-document search that returns the matching pages with hit counts and context snippets. Supply a PDF by public URL, base64 or a raw binary request body; only public http/https URLs are accepted and private or internal hosts are blocked. Pure server-side computation (pdf.js, no third-party upstream, no per-page cloud cost). Ideal for document indexing and search, data extraction and ETL, invoice and contract processing, archiving and content pipelines.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/pdftext-api/..."
```

## Pricing
- **Free** (Free) — 7,000 calls/Mo, 2 req/s
- **Basic** ($10/Mo) — 85,000 calls/Mo, 5 req/s
- **Pro** ($30/Mo) — 600,000 calls/Mo, 15 req/s
- **Mega** ($74/Mo) — 3,000,000 calls/Mo, 40 req/s

## Endpoints

### PDF

#### `GET /v1/extract` — Extract full + per-page text

**Parameters:**
- `url` (query, optional, string) — PDF URL (or base64/raw body) Example: `https://example.com/doc.pdf`
- `base64` (query, optional, string) — Base64 PDF data
- `pages` (query, optional, string) — Include per-page text (default true) Example: `true`
- `max_chars` (query, optional, string) — Cap returned text length

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pdftext-api/v1/extract?url=https%3A%2F%2Fexample.com%2Fdoc.pdf&pages=true"
```

#### `GET /v1/info` — PDF metadata

**Parameters:**
- `url` (query, optional, string) — PDF URL (or base64/raw body)
- `base64` (query, optional, string) — Base64 PDF data

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pdftext-api/v1/info"
```

#### `GET /v1/search` — Search text inside the PDF

**Parameters:**
- `q` (query, required, string) — Search query Example: `invoice`
- `url` (query, optional, string) — PDF URL (or base64/raw body)
- `base64` (query, optional, string) — Base64 PDF data
- `case_sensitive` (query, optional, string) — Exact case Example: `false`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pdftext-api/v1/search?q=invoice&case_sensitive=false"
```


---
Marketplace page: https://www.oanor.com/api/pdftext-api
OpenAPI spec: https://www.oanor.com/api/pdftext-api/openapi.json
