---
title: Unified Document Extraction
slug: extract-unified
url: https://apyverse.com/macht/service/extract-unified
provider: Macht_of_El_Dorado
categories: [Ingestion Kit, Output Kit, Media Kit]
tags: [document-extraction, markdown-conversion, ocr, pdf-parsing, spreadsheet-extraction, document-ai]
auth: api_key
version: 1.0
service_type: sync
endpoints: 1
atoms: 1000
mcp: true
---

# Unified Document Extraction

Extract documents from a URL into per-unit Markdown with metadata and OCR diagnostics. Useful for indexing PDFs, slides, sheets, scans, and mixed-format files.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyverse.com/macht/extract-unified` | What it does Extracts a document from the provided URL and returns the content as per-unit Markdown… | 1000 |

## Endpoint reference

### Extract a document into per-unit Markdown

`POST https://api.eu.apyverse.com/macht/extract-unified` · 1000 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `filename` | body | string | no | Optional. Used only as an extension hint for plain-text containers (.csv, .tsv, .md) and image naming. Example: `Safety Handbook.pdf`. |
| `mime_type` | body | string | no | MIME type hint. Never trusted — routing uses the type detected from content. Example: `application/pdf`. |
| `presigned_url` | body | string (uri) | yes | S3 presigned GET URL (or any http/https URL). Fetched as-is; may exceed 2,048 characters. Never logged. |

#### Quickstart

Send a document URL for extraction and get back structured content.

```bash
curl -X POST "https://api.eu.apyverse.com/macht/extract-unified" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "presigned_url": "https://example-bucket.s3.amazonaws.com/safety-handbook.pdf?X-Amz-Signature=example"
  }'
```

#### What you'll get back

Returns a JSON object with a `data` object. `data` includes `units` (the extracted content in document order), `metadata` (the detected MIME type and model), and `diagnostics` (OCR/image processing counts).

```json
{
  "data": {
    "units": [],
    "metadata": {
      "detected_mime_type": "application/pdf",
      "model": "..."
    },
    "diagnostics": {
      "ocr_attempted": false,
      "embedded_images_total": 0,
      "embedded_images_ocrd": 0,
      "embedded_images_skipped_decorative": 0
    }
  }
}
```

## About

## What it does
Unified Document Extraction turns a document URL into per-unit Markdown, with each page, slide, sheet, image, or section returned as its own record. Send a `presigned_url`, and you get structured text back in document order.

Use the optional `filename` as an extension hint for plain-text containers such as `.csv`, `.tsv`, and `.md`, and `mime_type` when you have a content-type hint. The extractor determines the real file type from the content, then routes each unit as `native`, `ocr`, `mixed_ocr`, `native_plus_embedded_ocr`, or `blank`.

The response includes `units`, `metadata`, and `diagnostics`. Each unit carries its `index`, `kind`, `label`, `markdown`, `route`, `language`, and any `warnings`, so you can preserve reading order and handle OCR fallbacks or hidden content explicitly. `metadata` reports the detected MIME type and extraction model, while `diagnostics` tells you whether OCR was attempted and how many embedded images were OCR’d, skipped as decorative, or left unprocessed.

Use Unified Document Extraction when you need to ingest reports, slide decks, spreadsheets, scans, or mixed-format files into downstream search, summarization, review, or indexing pipelines.

## Usage

Base URL: `https://api.eu.apyverse.com` (default region — see
`GET https://apyverse.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyverse.com/macht/service/extract-unified
