# Reading a document in parts

> mdapi.io - Minimal Data API I/O: a content transformation layer primitive for AI systems.
>
> Transforms files and webpages into AI-ready Markdown and structured data, optimized for LLM efficiency and token usage.

Walking a large document part by part: the range a conversion reports, the headers carrying it, and `part=N`.

A conversion self-describes its part range, so a large document can be walked part by part without converting it again. The two headers are on every response; the same pair sits in the JSON body under `parts`.

- `parts.count` / `X-MDAPI-Parts` - How many parts the document has - the range `part` accepts
- `parts.unit` / `X-MDAPI-Part-Unit` - What a part is: `page`, `slide`, `sheet`, `chapter`, or `a4` (one A4 sheet of text)
- `parts.listed` - A book's inventory, in document order. It can name more entries than `parts.count`: a clamped book keeps its whole listing, so the tail is listed but not addressable
- `parts.truncated` - The document was cut while it was built: an archive entry cap, a reader's own cap (rows, cells, slides, text) or the output budget. The answer carries the beginning of the real content, never a fabricated tail. Present only when true
- `parts.names` / `parts.sizes` - `result=meta` only: the title of each part, and its size in chars, tokens and bytes - what fits a context window, reported with no content returned

`result=meta` reports the same range with no content returned - ask for it first when the size of the answer matters more than the answer.

The unit is decided by the format, not chosen by the caller:

- `page` - formats: PDF. What one unit is: One page. Every page carries its own heading, so a page range is a part range
- `slide` - formats: Presentations (PPTX, PPT, POT, PPS, ODP). What one unit is: One slide, in document order
- `sheet` - formats: Spreadsheets (XLSX, XLS, XLSM, XLSB, ODS, ET, Numbers, DTA). What one unit is: One sheet, carrying its own name as the heading
- `chapter` - formats: Books - EPUB and the archives (ZIP, TAR, 7z, and the compression family once it is unwrapped). What one unit is: One entry of the book. `.tar.zst`, `.tar.xz`, `.tar.bz2` and `.tar.gz` expand to the same book as a plain `.zip`, and so does a compressed file opened from a data URI - one entry, one unit, whatever the transport
- `a4` - formats: Anything else with a text layer and no natural boundary - DOCX, DOC, ODT, RTF, text and code, CSV/TSV, JSON/YAML, HTML, images. What one unit is: One A4 sheet of text: 2500 characters, the density of a page at 12pt. It is also the fallback when a format has a boundary of its kind but its markdown carries none, so `parts.unit` is always the truth to read

A part carries the document's front matter in front of it - the title, the metadata block and a book's `## Contents` listing, everything before the first unit - so a single part is readable on its own, without a second request for the context. This is what `parts.sizes` measures: each size is what `part=N` alone returns, front matter included, so the sizes add up to a little more than the whole document rather than exactly to it. A part of an A4 document has no front matter to carry and gets a generated `## Part N` heading instead.

## Links

- **About service:** https://mdapi.io/about
- **Privacy:** https://mdapi.io/privacy
- **Contact:** https://mdapi.io/contact
- **Agent entry point:** https://mdapi.io/AGENTS.md or https://mdapi.io/agents.md or https://mdapi.io/agent.md
- **Agent access:** https://mdapi.io/auth.md
- **API documentation and conversion:** https://mdapi.io
- **MCP server manifest:** https://mdapi.io/mcp
- **Health check:** https://mdapi.io/health
- **Documentation index:** https://mdapi.io/llms.txt
- **Full API documentation:** https://mdapi.io/llms-full.txt
- **AI discovery:** https://mdapi.io/.well-known/ai-discovery.json or https://mdapi.io/ai-discovery.json
- **AI Agent discovery:** https://mdapi.io/.well-known/agent.json or https://mdapi.io/agent.json
- **A2A Agent card:** https://mdapi.io/.well-known/agent-card.json or https://mdapi.io/agent-card.json
- **ACP manifest:** https://mdapi.io/.well-known/acp.json or https://mdapi.io/acp.json
- **x402 payment manifest:** https://mdapi.io/.well-known/x402.json or https://mdapi.io/x402.json or https://mdapi.io/.well-known/x402
- **OpenAPI specification (JSON):** https://mdapi.io/.well-known/openapi.json or https://mdapi.io/openapi.json
- **OpenAPI specification (YAML):** https://mdapi.io/.well-known/openapi.yaml or https://mdapi.io/openapi.yaml
- **MAPI specification:** https://mdapi.io/.well-known/mapi.md or https://mdapi.io/mapi.md
- **Skill specification:** https://mdapi.io/.well-known/skill.md or https://mdapi.io/skill.md
- **ARD manifest:** https://mdapi.io/.well-known/ard.json or https://mdapi.io/.well-known/ai-catalog.json or https://mdapi.io/ard.json
- **Agent Plugins manifest:** https://mdapi.io/.well-known/plugin/plugin.json or https://mdapi.io/.well-known/plugin.json
- **Agent Plugins MCP config:** https://mdapi.io/.well-known/plugin/mcp.json
- **Agent Plugins conversion skill:** https://mdapi.io/.well-known/plugin/skills/mdapi-conversion/SKILL.md
- **API documentation pages:** https://mdapi.io/docs
- **Example pages:** https://mdapi.io/docs/examples

## External Links

- **github.com** https://github.com/mdapiio/mdapi.io
- **skills.sh** https://www.skills.sh/mdapiio/mdapi.io
- **skillsmp.com** https://skillsmp.com/creators/mdapiio/mdapi.io
- **clawhub.ai** https://clawhub.ai/mdapiio
- **x.com** https://x.com/mdapiio

## Disclaimer

**The service is provided "AS IS".**


> mdapi.io is an edge-native service-transport primitive for AI, autonomous agents, and the Web4 ecosystem.
