# Office Text Extractor: DOCX, PPTX & XLSX to Markdown & JSON (`best_apis/office-text-extractor`) Actor

Convert Word (DOCX), PowerPoint (PPTX) and Excel (XLSX/CSV) files from URLs into clean Markdown, plain text or structured JSON for LLMs and RAG. Tables, headings, slides and sheets preserved. No API key. $1 per 1,000 documents.

- **URL**: https://apify.com/best_apis/office-text-extractor.md
- **Developed by:** [A Q](https://apify.com/best_apis) (community)
- **Categories:** AI, Developer tools, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## Office Text Extractor: DOCX, PPTX & XLSX to Markdown & JSON

Turn **Word, PowerPoint and Excel files** into clean text for LLMs, RAG pipelines and spreadsheets. Point it at public file URLs and get:

- **DOCX → Markdown / text** with headings, lists, links and tables (powered by Mammoth)
- **PPTX → per-slide text** and a full-deck Markdown document
- **XLSX / CSV / TSV → Markdown tables** plus structured JSON rows (header detection, sheet filter, row caps)
- One row per **document**, **sheet**, **slide**, or every **Excel row**
- File metadata: name, size, SHA-256, word/character counts

Pairs with [PDF Text Extractor](https://apify.com/best_apis/pdf-text-extractor) and [Image to Text OCR](https://apify.com/best_apis/image-to-text-ocr) for a full document suite. No API key. User-supplied documents only — nothing is scraped from third-party sites beyond the URLs you provide.

### Pricing: $1 per 1,000 documents

| Event | Price |
|---|---|
| Document extracted | **$0.001** ($1 / 1,000) |
| Excel rows (per 1,000 rows, row mode only) | **$0.0001** |
| Actor start | $0.0005 per GB (512 MB default) |
| Failed / unsupported files | **free** |

Undercuts typical Office extractors on Apify ($3–10 per 1,000 files). Your Apify maximum cost per run is always respected.

### Input examples

```json
{ "urls": ["https://filesamples.com/samples/document/docx/sample1.docx"] }
```

```json
{ "urls": ["https://example.com/report.xlsx"], "outputMode": "rows", "headerRow": true }
```

```json
{ "urls": ["https://example.com/deck.pptx"], "outputMode": "slide" }
```

### Output

Document rows include `markdown` and/or `text`, plus `sheets` / `slides` when relevant. Failed URLs get a free `status: "failed"` row and are listed in `FAILURES`.

### Changelog

- **1.0.0** — Initial public release: DOCX, PPTX, XLSX, CSV/TSV; document/sheet/slide/rows modes; charge-cap aware.

# Actor input Schema

## `urls` (type: `array`):

Direct links to .docx, .pptx, .xlsx, .xls, .csv or .tsv files. Leave empty for a short public demo.

## `outputMode` (type: `string`):

Document mode covers every file type. Sheet/slide/rows modes are for Excel and PowerPoint when you want finer grains. Price is per document either way (row mode also charges a small per-1k-rows fee).

## `format` (type: `string`):

Markdown keeps headings, lists and tables. Plain text strips markup.

## `includeSheets` (type: `boolean`):

Document mode: also attach each sheet's rows as JSON on the document row.

## `headerRow` (type: `boolean`):

When on, each spreadsheet row becomes an object keyed by the header cells. When off, rows are arrays.

## `sheetNames` (type: `array`):

Optional. Leave empty for every sheet.

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

Cap rows read from each sheet (the document row sets truncated: true when hit).

## `maxFileSizeMb` (type: `integer`):

Larger files are skipped (not charged).

## `maxDocuments` (type: `integer`):

Hard cap for the whole run.

## `proxyConfiguration` (type: `object`):

Optional. Not needed for most public file hosts.

## Actor input object example

```json
{
  "urls": [
    "https://filesamples.com/samples/document/xlsx/sample1.xlsx",
    "https://filesampleshub.com/download/document/pptx/sample1.pptx"
  ],
  "outputMode": "document",
  "format": "markdown",
  "includeSheets": true,
  "headerRow": true,
  "maxRowsPerSheet": 10000,
  "maxFileSizeMb": 50,
  "maxDocuments": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `documents` (type: `string`):

No description

## `content` (type: `string`):

No description

## `rows` (type: `string`):

No description

## `full` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `failures` (type: `string`):

No description

# 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 = {
    "urls": [
        "https://filesamples.com/samples/document/xlsx/sample1.xlsx",
        "https://filesampleshub.com/download/document/pptx/sample1.pptx"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("best_apis/office-text-extractor").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 = { "urls": [
        "https://filesamples.com/samples/document/xlsx/sample1.xlsx",
        "https://filesampleshub.com/download/document/pptx/sample1.pptx",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("best_apis/office-text-extractor").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 '{
  "urls": [
    "https://filesamples.com/samples/document/xlsx/sample1.xlsx",
    "https://filesampleshub.com/download/document/pptx/sample1.pptx"
  ]
}' |
apify call best_apis/office-text-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,best_apis/office-text-extractor"
        }
    }
}
```

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/vjQWgSeBbJcDNJQo9/builds/B7If5t4n5u0VEV6mY/openapi.json
