# PDF to Markdown API: Word, PowerPoint & Excel for AI Agents (`emttn/document-markdown`) Actor

PDF to markdown API: turn PDF, Word, PowerPoint and Excel URLs into markdown for AI agents and RAG, payable per request via x402. PDFs come back as plain text page by page; Office files keep headings, lists and tables. Charged per document delivered; failed documents are free.

- **URL**: https://apify.com/emttn/document-markdown.md
- **Developed by:** [Frameskim Tools](https://apify.com/emttn) (community)
- **Categories:** AI, Agents, Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 document delivered as markdowns

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

## Document to Markdown for AI Agents

Give it the URLs of PDF, Word (DOCX), PowerPoint (PPTX) or Excel (XLSX) files and get each one back as clean markdown, for AI agents and RAG pipelines that need the text of a document, not a file. You get one dataset item per document.

- Reads public URLs only, and respects robots.txt for every document and every redirect. It identifies itself as `FrameskimFetch`.
- Word and PowerPoint files keep headings, lists and tables as markdown; Excel sheets become tables.
- PDFs come back as plain text, page by page, without tables. A PDF's title is the one in its metadata, or `null`.
- Documents up to 10 MB; no OCR, so scanned PDFs are not supported.
- Charged per document delivered (current prices are on the Pricing tab); documents that fail, are too big, scanned, damaged or not allowed by robots.txt are free.

More: [Document to Markdown on frameskim.dev](https://frameskim.dev/document-markdown)

### What you get

```json
{
  "url": "https://example.com/report.pdf",
  "type": "pdf",
  "title": "Annual Report",
  "markdown": "# Annual Report\n\n...",
  "truncated": false
}
```

- `type` is `pdf`, `docx`, `pptx` or `xlsx`; `title` is the document's own title, or `null`.
- `truncated` is `true` when the markdown passed 500,000 characters and was cut.
- A document that could not be delivered has `error` instead of `markdown`, with the reason, and is not charged.
- The run's status message says how many documents were delivered and failed, and why the run stopped early, if it did.
- If nothing is delivered, the run still ends as succeeded: each document that failed is in the dataset with its `error`, the status message gives the first reason, and nothing was charged.

### Input

| Field | What it does |
|---|---|
| `urls` | From 1 to 50 URLs of PDF, DOCX, PPTX or XLSX files. A repeated URL is read once. |

### Limits

- 10 MB per document, 30 s per download attempt and 120 s to convert it. A download that runs out of time, cannot connect or gets a server error is tried once more on a new connection; if that fails too, the document fails and is not charged.
- One document at a time, so a run of 50 large documents can reach its time limit; the documents done by then are delivered and charged, and the message says why it stopped.
- Set a maximum charge per run to cap spending: the run stops before a document that would pass it.

Not affiliated with Microsoft; Word, PowerPoint and Excel are trademarks of Microsoft Corporation, named here only for the file formats this actor reads.

### Support

Every error says what was wrong. For anything else, see https://frameskim.dev/terms.

### Terms and privacy

Document to Markdown for AI Agents is operated by Emttn LLC and is not affiliated with, endorsed by or sponsored by the sites whose documents it reads. You need a lawful basis to fetch, copy and use each document you list, and you are responsible for following each document's license, its site's terms, copyright and privacy law; a public document or a `robots.txt` allow is not a license to its content. The markdown is an automatic extraction and may be incomplete or inaccurate. Terms: https://frameskim.dev/terms. Privacy: https://frameskim.dev/privacy. Questions: support@frameskim.dev.

# Actor input Schema

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

Public http or https URLs of PDF, DOCX, PPTX or XLSX files, from 1 to 50. Each document delivered as markdown is one document event.

## `failWhenEmpty` (type: `boolean`):

Internal: the run ends as failed, instead of succeeded with error items, when no document is delivered. Used by health checks.

## Actor input object example

```json
{
  "urls": [
    "https://www.rfc-editor.org/rfc/rfc9309.pdf"
  ],
  "failWhenEmpty": false
}
```

# Actor output Schema

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

Dataset items: url, type, title, markdown and truncated; documents that could not be delivered carry an error and are not charged.

# 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://www.rfc-editor.org/rfc/rfc9309.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("emttn/document-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 = { "urls": ["https://www.rfc-editor.org/rfc/rfc9309.pdf"] }

# Run the Actor and wait for it to finish
run = client.actor("emttn/document-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 '{
  "urls": [
    "https://www.rfc-editor.org/rfc/rfc9309.pdf"
  ]
}' |
apify call emttn/document-markdown --silent --output-dataset

```

## MCP server setup

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