# Word, PowerPoint, Excel and EPUB to Markdown for AI (`alvin_tom/office-docs-to-markdown`) Actor

Turn DOCX, PPTX, XLSX and EPUB links into clean Markdown and RAG-ready chunks. Built for AI agents and LLM pipelines: one call, clean JSON, pay per document.

- **URL**: https://apify.com/alvin_tom/office-docs-to-markdown.md
- **Developed by:** [Alvin Tom](https://apify.com/alvin_tom) (community)
- **Categories:** AI, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 documents

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Word, PowerPoint, Excel and EPUB to Markdown for AI

Give it links to **.docx, .pptx, .xlsx or .epub** files, get back **clean Markdown** and **RAG-ready chunks**. Made for AI agents and LLM pipelines.

### What you get per file

- `fileType`: docx, pptx, xlsx or epub (detected from the file itself, not the link)
- `markdown`: headings, lists and tables kept; slides and sheets become sections
- `chunks`: pieces of about `chunkSize` characters, ready for embeddings
- `charCount`, `chunkCount`, `error`

### Input

```json
{ "fileUrls": ["https://example.org/report.docx"], "chunkSize": 1500, "chunkOverlap": 150 }
```

### Pricing

Pay per document converted (`document` event). Failed files are not charged, and the run stops cleanly when your spending limit is reached.

### Use cases

- Load Word reports, slide decks, spreadsheets and e-books into a RAG pipeline
- Let an AI agent read an Office file link in the middle of a task
- Turn Excel sheets into Markdown tables an LLM can read
- Batch-convert a folder of documents into clean text

### Output example

```json
{
  "itemType": "document",
  "url": "https://calibre-ebook.com/downloads/demos/demo.docx",
  "fileType": "docx", "charCount": 11146, "chunkCount": 10, "error": null,
  "markdown": "Demonstration of DOCX support in calibre\n\n...",
  "chunks": [{ "index": 0, "chars": 1403, "text": "Demonstration of DOCX support..." }],
  "bigFile": false
}
```

### Price examples

| What you read | You pay |
|---|---|
| 1 file, any length | $0.003 |
| 1,000 files | $3 |

Plus a tiny start fee ($0.00005) per run.

### Use it from code or an AI agent

Python (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("alvin_tom/office-docs-to-markdown").call(run_input={"fileUrls": ["https://calibre-ebook.com/downloads/demos/demo.docx"]})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["url"], item.get("fileType"), item.get("charCount"))
```

AI agents: add this Actor as a tool in Claude, Cursor or any MCP client through Apify's MCP server (`https://mcp.apify.com/?tools=alvin_tom/office-docs-to-markdown`). The agent passes links and gets clean JSON back.

### FAQ

**Old .doc, .ppt or .xls files?** Not yet. Save them as .docx, .pptx or .xlsx first.

**Are images inside the file read?** No, only the text and tables.

**Can I send a file instead of a link?** Give any public link, for example a file in an Apify key-value store or cloud storage.

### Good to know

- Big Excel files: each sheet is read row by row, up to `maxRowsPerSheet` rows (default 20,000, max 100,000). Longer sheets are cut and the item gets `truncated: true`.
- Limits: 60 MB per file, public http(s) links only (every redirect is checked too). Other file types are refused.
- We don't keep your files: each file is converted in memory and only the result goes to your dataset.

Support: open an issue on this Actor. Replies come from an AI assistant.

### Large documents

Results up to about 8 MB come back as one dataset item. Bigger ones switch to big-file mode on their own: the full Markdown (and tables) are saved in the run's key-value store, the document item gives `markdownKey`/`markdownUrl`, and each chunk becomes its own dataset item (`itemType: "chunk"`). Filter on `itemType` to tell them apart.

# Actor input Schema

## `fileUrls` (type: `array`):

Public http(s) links to .docx, .pptx, .xlsx or .epub files. One output item per file.

## `chunkSize` (type: `integer`):

Split the Markdown into chunks of about this many characters for RAG. 0 turns chunking off.

## `chunkOverlap` (type: `integer`):

Characters repeated between neighbouring chunks.

## `maxRowsPerSheet` (type: `integer`):

Excel only: rows read from each sheet. Bigger sheets are cut and the item gets truncated: true.

## Actor input object example

```json
{
  "fileUrls": [
    "https://calibre-ebook.com/downloads/demos/demo.docx"
  ],
  "chunkSize": 1500,
  "chunkOverlap": 150,
  "maxRowsPerSheet": 20000
}
```

# Actor output Schema

## `results` (type: `string`):

One item per file, with the text and an error field if it failed

## `bigFiles` (type: `string`):

Markdown and tables of very large files

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "fileUrls": [
        "https://calibre-ebook.com/downloads/demos/demo.docx"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("alvin_tom/office-docs-to-markdown").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "fileUrls": ["https://calibre-ebook.com/downloads/demos/demo.docx"] }

# Run the Actor and wait for it to finish
run = client.actor("alvin_tom/office-docs-to-markdown").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "fileUrls": [
    "https://calibre-ebook.com/downloads/demos/demo.docx"
  ]
}' |
apify call alvin_tom/office-docs-to-markdown --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,alvin_tom/office-docs-to-markdown"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/UgrWjis1PZWMfzzgL/builds/q7LWtwRqx9t304qcL/openapi.json
