# Document Text Extractor: DOCX, PPTX, EPUB to Text (No Login) (`eliai/office-document-text-extractor`) Actor

Extract text and Markdown from document file URLs: Word DOCX, PowerPoint PPTX, EPUB, ODT, ODP and RTF, with title, author, dates and word, page, slide and chapter counts. Format is detected from the bytes. No login or API key; failed files are free. Clean JSON for AI agents and RAG pipelines.

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

## Pricing

$2.00 / 1,000 document 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

Turn Word, PowerPoint, EPUB, ODT, ODP and RTF files at any URL into plain text, Markdown and metadata. $0.002 per file, no login or API key, failed files are free.

## Document Text Extractor: DOCX, PPTX, EPUB to Text (No Login)

Document Text Extractor is a **docx to text** and Markdown converter that works from a link. Give it the
URLs of documents and it downloads each file, works out what it really is from its bytes, and returns
the text, a Markdown version with headings, lists and tables kept, and the metadata: title, author,
created and modified dates, word count, and page, slide or chapter count.

It exists because AI agents and LLM tools cannot open these files themselves. A `.docx`, `.pptx` or
`.epub` is a zipped bundle of XML; fetching the URL gives an agent binary noise. One call to this
document text extractor gives it clean JSON it can read, quote and summarise.

| Format | What you get |
|---|---|
| **DOCX** (Word 2007+) | Body text, headings, numbered and bulleted lists, tables, text boxes, footnotes and endnotes. Headers and footers in a separate field. Page count as saved by Word. |
| **PPTX** (PowerPoint 2007+) | Every slide in presentation order, with its title, body text, tables and speaker notes. Hidden slides are marked. |
| **ODT** (LibreOffice / OpenOffice Writer) | Body text, headings, lists, tables, footnotes. |
| **ODP** (LibreOffice / OpenOffice Impress) | Every slide with its title, text and notes. |
| **EPUB** (EPUB 2 and 3 e-books) | Every chapter in reading order, with chapter titles and per-chapter word counts. |
| **RTF** | Text in the right character set (Western, Cyrillic, Japanese and other code pages, and Unicode), headings, tables, footnotes. |

The format is detected from the file's own bytes and zip contents, not the extension, so a Word file
served as `download?id=123` or named `.bin` is still read, and a login page saved as `report.docx` is
reported as "not a document" instead of being charged.

### Input

```json
{ "urls": ["https://example.com/files/q3-report.docx", "https://example.com/files/kickoff.pptx"] }
```

| Field | Type | Notes |
|---|---|---|
| `url` / `urls` | string / string\[] | The files to read, up to 50 per run. **You are charged per file extracted.** `urls` also takes one URL per line. |
| `maxFiles` | integer | Stop after this many files (1 to 50, default 50). Files past it get a free row and are not downloaded. |
| `includeMarkdown` | boolean | Add the `markdown` field. Default `true`. |
| `includeNotes` | boolean | Include the speaker notes of PPTX and ODP slides. Default `true`. Footnotes and endnotes of Word, ODT and RTF documents are always included, under a "Notes" heading at the end. |

Share links are understood: a Google Docs or Google Slides link (shared as "anyone with the link") is
read as a DOCX or PPTX export, a Google Drive file link is read as a direct download, and a Dropbox
`?dl=0` link is switched to `?dl=1`. Redirects are followed, and the file name is taken from the
server's `Content-Disposition` header when there is one.

Run it with no input (`{}`) and it reads a small public sample Word file, for free, so you can see the
output. Unknown input fields are refused for free, so a typo never reads the sample instead of your file.

### Output

One row per file. This is the row for the built-in sample:

```json
{
  "ok": true,
  "url": "https://raw.githubusercontent.com/apache/poi/trunk/test-data/document/SampleDoc.docx",
  "fileName": "SampleDoc.docx",
  "fileSizeBytes": 11611,
  "contentType": "application/octet-stream",
  "format": "docx",
  "formatName": "Microsoft Word (DOCX)",
  "detectedBy": "zip-content",
  "extensionMatches": true,
  "title": "Test Document",
  "author": "Nick Burch",
  "lastModifiedBy": "Nick Burch",
  "subject": "This is a sample document",
  "description": "This document is used for testing text and metadata extraction",
  "keywords": "Testing Sample",
  "language": null,
  "publisher": null,
  "application": "Microsoft Office Word",
  "createdAt": "2008-01-04T09:10:00.000Z",
  "modifiedAt": "2008-01-04T09:15:00.000Z",
  "wordCount": 31,
  "characterCount": 140,
  "paragraphCount": 6,
  "headingCount": 0,
  "tableCount": 0,
  "pageCount": 2,
  "slideCount": null,
  "chapterCount": null,
  "text": "I am a test document\n\nThis is page 1\n\nI am Calibri (Body) in font size 11\n\nThis is page two\n\nIt’s Arial Black in 16 point\n\nIt’s also in blue",
  "markdown": "I am a test document\n\nThis is page 1\n\nI am Calibri (Body) in font size 11\n\nThis is page two\n\nIt’s Arial Black in 16 point\n\nIt’s also in blue",
  "headerFooterText": null
}
```

| Field | Meaning |
|---|---|
| `ok` | `true` when the text was read, `false` for a free failure row. |
| `url`, `finalUrl`, `fileName`, `fileSizeBytes`, `contentType` | What you asked for, where it ended up after redirects, and what the server sent. |
| `format`, `formatName` | `docx`, `pptx`, `odt`, `odp`, `epub` or `rtf`, and its long name. |
| `detectedBy`, `extensionMatches` | How the format was recognised (`zip-content` or `magic-bytes`), and whether the file name's extension agreed. |
| `title`, `author`, `lastModifiedBy`, `subject`, `description`, `keywords`, `language`, `publisher`, `application` | Document properties as stored in the file; `null` when the file has none. |
| `createdAt`, `modifiedAt` | ISO 8601 dates from the file's properties. |
| `wordCount`, `characterCount`, `paragraphCount`, `headingCount`, `tableCount` | Counted from the extracted text. Chinese, Japanese and Korean characters count as one word each. The headings this Actor adds itself ("Slide 3", "Speaker notes", "Notes") are not counted. |
| `pageCount` | DOCX: the page count Word saved in the file. `null` for other formats. |
| `slideCount`, `slides[]` | PPTX and ODP: each slide's `number`, `title`, `text`, `notes` and `hidden` flag. |
| `chapterCount`, `chapters[]` | EPUB: each chapter's `number`, `title`, `wordCount` and `characterCount`. |
| `text` | The whole document as plain text, paragraphs separated by blank lines. |
| `markdown` | The same with `#` headings, `-` and `1.` lists, tables and slide headings. |
| `headerFooterText` | DOCX: page headers and footers, kept out of `text` so they do not repeat on every page. |
| `emptyText` | `true` when the file was read but holds no text (only images or scanned pages, or slides with nothing written on them). Not charged. |
| `textTruncatedInline`, `textKey`, `textUrl` | Only for very long documents: see Limits. |
| `error`, `errorCode` | On a failure row: a plain reason, and a code such as `encrypted`, `corrupt`, `unsupported`, `not-a-document`, `too-large`, `http-404`, `dns`, `bad-url` or `over-limit`. |

The run's `OUTPUT` record sums it up: files requested, extracted, charged, failed, empty, and the count
per format.

### Pricing

**$0.002 per file extracted**: a file that was downloaded, recognised as one of the six formats, and
whose text was read and saved. No start fee. **1,000 files = $2.00.**

You are not charged for:

- files that fail to download (any HTTP error, DNS failure, timeout, private or internal address);
- password-protected or DRM-locked files;
- damaged or truncated files;
- files in a format it does not read (PDF, XLSX, legacy `.doc`/`.ppt`, images, HTML pages);
- files over the size limit;
- documents that hold no text;
- duplicate URLs in the same run, and files past `maxFiles`;
- the demo run with `{}`.

If you set a max-charge limit, the run stops there: files after it are not downloaded or charged.

### Limits

- **50 MB per file** and **50 files per run**. A bigger file gets a free failure row; it is not
  partly read.
- **Very long documents:** at the default 512 MB memory one part of a document can unpack to 20 MB of
  XML (roughly a million words of plain Word text). Past that the file is refused for free with a
  message to run again with more memory; 1024 MB doubles the limit.
- A document whose text is too big for one dataset item (over about 9 MB of text) is still read whole:
  the full plain text goes to the run's key-value store, the row holds the first 200,000 characters
  with `textKey` and `textUrl` pointing to the rest, and `markdown` is left out.
- **No PDF.** For PDFs, use our PDF Text Extractor Actor.
- **No spreadsheets** (XLSX, ODS) and no legacy binary Office files (`.doc`, `.ppt`, `.xls` from
  Office 97-2003). They are refused for free with a message saying so.
- No OCR: text inside images and scanned pages is not read.
- `pageCount` is the number Word stored when the file was last saved. Files made by other tools may
  not store it, and then it is `null`.
- Only public files: it does not log in. Private Google Docs or Drive files, and files behind a
  sign-in page, come back as free failure rows.
- With several files, rows can arrive in any order. Match them by `url`.

### Use it from an AI agent

Document Text Extractor works as an LLM tool through Apify's MCP server or the Apify API. An agent
that finds a link to a Word file, a slide deck or an e-book passes the URL and gets the text back as
JSON in the same call, with the Markdown ready to drop into a prompt and the metadata to cite. Send
several URLs in one batch call. Files it cannot read come back as free rows with a reason the agent
can show the user, never as a crash.

### FAQ

**How do I convert a DOCX to text from a URL?** Put the link in `urls` and run. The `text` field holds
the plain text and `markdown` the formatted version. No Word install, no API key.

**Does it work on Google Docs?** Yes, when the document is shared with "anyone with the link". Paste
the normal `/edit` link; it is read as a Word export.

**What happens with a password-protected file?** It is recognised from its bytes and returned as a
free row with `errorCode: "encrypted"`. The password is never asked for.

**Are tracked changes and comments included?** The text is the document as it reads with all changes
accepted: deleted text is left out, and comments are not included.

**Why is `wordCount` different from Word's own count?** Word counts the body only and splits words a
little differently. This count covers everything in `text`, including footnotes and table cells.
Page headers and footers are not counted.

**Can it read PDFs?** No. Use our PDF Text Extractor Actor for PDFs.

# Actor input Schema

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

One public link to a .docx, .pptx, .odt, .odp, .epub or .rtf file. Leave it as the demo, or use "urls" for many files. Google Docs/Slides and Google Drive share links (shared with anyone who has the link) and Dropbox links work too.

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

Many files in one run (batch API), up to 50. When you set this, it is used on its own and the single field above is ignored, so you are only charged for the files you sent. Each file is charged once when text comes out of it.

## `maxFiles` (type: `integer`):

Stop after this many files. Files past the limit are listed as not processed and are not charged.

## `includeMarkdown` (type: `boolean`):

Also return the document as Markdown: headings, lists and tables kept. Turn off for a smaller dataset when you only need plain text.

## `includeNotes` (type: `boolean`):

For PowerPoint and ODP presentations, include each slide's speaker notes.

## Actor input object example

```json
{
  "url": "https://raw.githubusercontent.com/apache/poi/trunk/test-data/document/SampleDoc.docx",
  "urls": [],
  "maxFiles": 50,
  "includeMarkdown": true,
  "includeNotes": true
}
```

# Actor output Schema

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

One row per file with its text, Markdown and metadata. Export as JSON, CSV or Excel from the dataset view.

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

Counts of files extracted, charged, failed and empty, by format.

# 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 = {
    "url": "https://raw.githubusercontent.com/apache/poi/trunk/test-data/document/SampleDoc.docx",
    "urls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("eliai/office-document-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 = {
    "url": "https://raw.githubusercontent.com/apache/poi/trunk/test-data/document/SampleDoc.docx",
    "urls": [],
}

# Run the Actor and wait for it to finish
run = client.actor("eliai/office-document-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 '{
  "url": "https://raw.githubusercontent.com/apache/poi/trunk/test-data/document/SampleDoc.docx",
  "urls": []
}' |
apify call eliai/office-document-text-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,eliai/office-document-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/a42zLOdFpzTiFsl2c/builds/1hOcQjyzzDjJpcWrl/openapi.json
