# DOCX & Excel Extractor — Word & Spreadsheet Text Extraction (`gochujang/docx-text-extractor`) Actor

Extract text, paragraphs, tables, and structured data from Word (.docx) and Excel (.xlsx) files. Supports Google Drive and Dropbox share links. Batch up to 50 files per run. $0.005 per file.

- **URL**: https://apify.com/gochujang/docx-text-extractor.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Developer tools
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

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

> Extract **text, paragraphs, tables, and structured data** from Word documents (.docx) and Excel spreadsheets (.xlsx) — including **Google Drive share links** and **Dropbox URLs**. Batch up to 50 files per run. **$0.005/file.**

### ⚡ Run in 30 seconds

Paste any Word or Excel 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"
}
```

***

### Input options

| Field | Default | Description |
|-------|---------|-------------|
| `urls` | — | List of .docx or .xlsx URLs (up to 50) |
| `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
- **$0.005** per successfully extracted file

Example: 10 Word 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

# Actor input Schema

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

List of .docx or .xlsx URLs to download and extract. Supports Google Drive and Dropbox share links.

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

Single .docx or .xlsx 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).

## `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": [],
  "url": "",
  "outputFormat": "full",
  "maxRowsPerSheet": 1000,
  "limit": 50
}
```

# 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 = {};

// 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 = {}

# 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 '{}' |
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/g29hw3X80Z7jeCVqK/openapi.json
