# Office Text Extractor - DOCX, XLSX, PPTX, ODT, ODP & RTF (`gochujang/docx-text-extractor`) Actor

Extract text and structured JSON from DOCX, XLSX, PPTX, ODT, ODP and RTF files. Includes Word tables, Excel rows, PowerPoint slide text, tables and speaker notes. Batch up to 50 files from direct URLs, Google Drive or Dropbox.

- **URL**: https://apify.com/gochujang/docx-text-extractor.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** AI, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 18 total users, 10 monthly users, 95.2% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 file extracteds

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

## DOCX & Excel Extractor — Word, Spreadsheets, Google Drive, Dropbox

> Extract text from Word .docx, Excel .xlsx, PowerPoint .pptx, OpenDocument .odt/.odp, and .rtf files. DOCX paragraphs/tables and Excel sheet data keep their existing output. PowerPoint includes slide text, tables, and speaker notes. Supports direct URLs, **Google Drive share links**, and **Dropbox URLs**. Batch up to 50 files per run. **$0.005/file** after the existing one-time free allowance.

### ⚡ Run in 30 seconds

Paste a DOCX, XLSX, PPTX, ODT, ODP, or RTF URL and click **Start**:

```
## Word document (direct URL)
https://example.com/report.docx

## Google Drive share link (auto-resolved)
https://drive.google.com/file/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms/view

## Dropbox share link (auto-resolved)
https://www.dropbox.com/s/abc123/data.xlsx?dl=0
```

Perfect companion to **PDF Text Extractor** — same workflow, now for Office documents.

***

### Use cases

- **LLM ingestion**: Extract Word doc content and feed directly into Claude, GPT, or any RAG pipeline
- **Spreadsheet → JSON**: Convert Excel reports into structured JSON for databases or APIs
- **Document processing pipelines**: Batch-convert DOCX/XLSX archives to searchable text
- **Data extraction**: Pull tables from Word documents or rows from Excel sheets
- **Content migration**: Extract content from legacy Office files for CMS import

***

### Output — Word (.docx)

```json
{
  "index": 1,
  "url": "https://example.com/report.docx",
  "file_type": "docx",
  "ok": true,
  "paragraph_count": 42,
  "word_count": 1850,
  "char_count": 11200,
  "heading_count": 8,
  "table_count": 2,
  "full_text": "Executive Summary\n\nThis report covers...",
  "headings": [{"text": "Executive Summary", "level": "Heading 1"}],
  "paragraphs": [{"text": "This report covers...", "style": "Normal"}],
  "tables": [{"table_index": 0, "rows": 5, "cols": 3, "data": [["Name", "Value", "Date"], ...]}],
  "metadata": {"title": "Q3 Report", "author": "John Smith", "created": "2026-01-15T10:00:00"},
  "fetched_at": "2026-08-08T07:00:00Z"
}
```

***

### Output — Excel (.xlsx)

```json
{
  "index": 1,
  "url": "https://example.com/data.xlsx",
  "file_type": "xlsx",
  "ok": true,
  "sheet_count": 3,
  "total_rows": 2500,
  "sheets": [
    {
      "name": "Sales",
      "row_count": 1001,
      "col_count": 8,
      "headers": ["Date", "Product", "Region", "Revenue", "Units", "Cost", "Margin", "Rep"],
      "rows": [["2026-01-01", "Widget A", "North", "5400", "36", "2160", "60%", "Alice"]]
    }
  ],
  "fetched_at": "2026-08-08T07:00:00Z"
}
```

***

### Output — PPTX, ODT, ODP and RTF

These formats reuse `ok`, `type`, `file_type`, `full_text`, text/count fields,
`paragraphs`, `headings`, `tables`, `metadata`, and `error`. Metadata is currently
an empty object for the new formats; DOCX/XLSX output remains unchanged.

- PPTX: text follows slide and shape order, including grouped shapes and table
  rows. `slides` contains `{slide_index, full_text}` entries (1-based).
  `notes` contains `{slide_index, text}` speaker-note entries. Notes also appear
  after each slide in the document-wide `full_text`.
- ODT: paragraph and heading text in document order.
- ODP: paragraph/heading text per slide, with the same `slides` structure.
  ODP speaker notes are not extracted.
- RTF: plain text with formatting controls removed.

Known URL extensions take precedence; MIME type and ZIP container signatures
or the RTF signature support extensionless download links. Unsupported or
unreadable files produce `ok: false` and no `file-extracted` event. The existing
run-start event and one-time free allowance still apply. `summary` omits detailed
arrays and limits new-format `full_text` to 500 characters. Images, charts,
embedded objects and scanned content are not OCRed; layout fidelity is not promised.

Parsing dependencies: python-pptx (MIT), odfpy (used under its Apache-2.0
licence option), and striprtf (BSD-3-Clause). Data comes only from user-supplied
files; no additional network data source is used.

### Input options

| Field | Default | Description |
|-------|---------|-------------|
| `urls` | — | List of .docx/.xlsx/.pptx/.odt/.odp/.rtf URLs (up to 50) |
| `urlsText` | empty | File URLs pasted one per line, merged with `urls` |
| `url` | — | Single file URL (shortcut when `urls` is empty) |
| `outputFormat` | `full` | `full` includes all text/tables/rows; `summary` returns metadata + truncated text |
| `maxRowsPerSheet` | `1000` | Max rows per sheet for Excel files (up to 100,000) |
| `limit` | `50` | Max files per run |

***

### Pricing

- **$0.001** flat per run start
- **First file per account is free** (once, not per run)
- **$0.005** per successfully extracted file (after the free tier)

Example: after your first free file, 10 documents = **$0.051**

***

### Supported formats

| Format | Extension | Notes |
|--------|-----------|-------|
| Word 2007+ | `.docx` | Full text, paragraphs, headings, tables, metadata |
| Excel 2007+ | `.xlsx` | All sheets, headers, rows as JSON arrays |

> Legacy `.doc` (pre-2007 binary format) is not supported. Convert to `.docx` first using Word or LibreOffice.

***

### See also

- **[PDF Text Extractor](https://apify.com/gochujang/pdf-text-extractor)** — Same workflow for PDFs, including OCR for scanned documents
- **[Image OCR Extractor](https://apify.com/gochujang/image-ocr-extractor)** — Extract text from images using Tesseract OCR

**Keywords:** DOCX extractor, Word to text, document parser, text extraction, NLP pipeline, Word file reader, .docx converter, Google Drive, Dropbox, batch document processing

***

### Related actors

- [Excel Extractor](https://apify.com/gochujang/excel-extractor) — .xlsx and .xls to JSON, same URL + Drive/Dropbox pattern for spreadsheet extraction
- [PDF Text Extractor](https://apify.com/gochujang/pdf-text-extractor) — PDF parsing including OCR for scanned documents alongside DOCX extraction
- [Image OCR Extractor](https://apify.com/gochujang/image-ocr-extractor) — Tesseract OCR for image-only content that can't be extracted by DOCX/PDF parsers

### Feedback

If this actor powers your document pipeline, a review helps others find it: [Leave a review on Apify Store](https://apify.com/gochujang/docx-text-extractor#reviews)

# Actor input Schema

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

List of .docx, .xlsx, .pptx, .odt, .odp or .rtf URLs to download and extract. Supports Google Drive and Dropbox share links.

## `urlsText` (type: `string`):

Alternative to the URLs list — paste multiple .docx/.xlsx/.pptx/.odt/.odp/.rtf URLs, one per line. Merged with 'urls' if both provided.

## `url` (type: `string`):

Single .docx, .xlsx, .pptx, .odt, .odp or .rtf URL. Used when 'urls' is empty.

## `outputFormat` (type: `string`):

full: include all text, paragraphs, tables, and rows. summary: metadata + truncated text only (faster, smaller output).

## `includeMetadata` (type: `boolean`):

Include document metadata: author, created date, last modified date, last modified by. Always included for DOCX files.

## `changeDetection` (type: `boolean`):

Compare document content hash against the previous run stored in KVS. Sets content_changed=true and is_new_document=true on each output record. Use with a named Key-Value Store to persist state across runs.

## `telegramBotToken` (type: `string`):

Optional. Telegram bot token (from @BotFather). When changeDetection=true and a document changes, sends a Telegram alert.

## `telegramChatId` (type: `string`):

Optional. Telegram chat/channel ID to send alerts to. Required when telegramBotToken is set.

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

For Excel files: maximum rows to extract per sheet.

## `limit` (type: `integer`):

Maximum files to process (max 50).

## Actor input object example

```json
{
  "urls": [
    "https://calibre-ebook.com/downloads/demos/demo.docx"
  ],
  "urlsText": "",
  "url": "",
  "outputFormat": "full",
  "includeMetadata": true,
  "changeDetection": false,
  "maxRowsPerSheet": 1000,
  "limit": 50
}
```

# Actor output Schema

## `results` (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://calibre-ebook.com/downloads/demos/demo.docx"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/docx-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://calibre-ebook.com/downloads/demos/demo.docx"] }

# Run the Actor and wait for it to finish
run = client.actor("gochujang/docx-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://calibre-ebook.com/downloads/demos/demo.docx"
  ]
}' |
apify call gochujang/docx-text-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gochujang/docx-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/54UKu9FllzMfPeEFO/builds/30gzVyYThjpnXMcyA/openapi.json
