# markitdown-zh (`ample_jeopardy_l8k/markitdown-zh`) Actor

Convert Chinese Office docs (Word, Excel, PowerPoint, text-based PDFs, and more) into clean Markdown for AI chats, RAG, and notes. Based on Microsoft MarkItDown (MIT). No OCR for scanned or image-only PDFs. $2.99 per 1,000 successful conversions.

- **URL**: https://apify.com/ample_jeopardy_l8k/markitdown-zh.md
- **Developed by:** [Kevin Skill Workshop](https://apify.com/ample_jeopardy_l8k) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.09 / 1,000 document converteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Docs to Markdown (Chinese-friendly) — markitdown-zh

Package version **0.1.1** (PPE: charge `document-converted` on success only).

Convert documents from URLs into clean UTF-8 Markdown, ready for LLMs, RAG pipelines, knowledge bases and note apps.

**Supported:** PDF (text layer), DOCX, XLSX, XLS, PPTX, HTML, CSV, TXT, MD, JSON, XML, PNG/JPG (metadata only).

### Input

| Field | Type | Description |
|---|---|---|
| `fileUrls` | array of URLs (required) | Public links to documents |
| `keepImages` | boolean (default false) | Keep embedded images as base64 data URIs |
| `encoding` | string (optional) | Source encoding for text files, e.g. `gb18030` |
| `maxFileSizeMb` | integer (default 50) | Skip larger files |

```json
{ "fileUrls": ["https://example.com/report.docx"], "keepImages": false }
```

### Output (dataset, one item per URL)

```json
{ "url": "...", "fileName": "report.docx", "status": "success", "markdown": "# ...", "error": null, "errorCode": null, "warnings": [] }
```

Failed files never stop the run; each gets a clear `error` (Chinese diagnostics: encrypted PDF, damaged Office file, scanned PDF needs OCR, wrong encoding…).

### Limits

- No OCR: scanned PDFs / images return a `needs_ocr` error.
- Password-protected files are not processed.
- URLs must be publicly downloadable.

### 中文简介

把网上的中文办公资料（PDF、Word、Excel、PPT、HTML、CSV 等）批量转成 UTF-8 Markdown，适合喂给大模型、做知识库。输入文件链接列表，每个文件输出一条结果（markdown 或中文错误原因：加密、损坏、扫描件需 OCR、编码错误等），单个失败不影响整批。

### Pricing (pay-per-event)

Event: `document-converted` — **One successfully converted document**.

| Tier | Price per 1,000 successful docs |
|---|---|
| FREE | $2.99 |
| BRONZE | $2.69 |
| SILVER | $2.39 |
| GOLD | $2.09 |

- **Success-only charging:** `Actor.charge` runs only after a successful conversion is pushed to the dataset. Failed downloads/conversions are **free**.
- **No start fee.** Platform usage is included in the event price (do not enable a paid `apify-actor-start`).
- **Recommend Max total charge USD** on each run so a long `fileUrls` list cannot overspend; when the limit is reached the Actor stops remaining URLs.

Configure the same event and tier prices in Apify Console → Monetization. Reference: `.actor/pay_per_event.json`.

In Console, set **apify-actor-start** and **apify-default-dataset-item** to **$0** or remove them so users are billed only for `document-converted`.

### 计费说明（按事件）

事件名 `document-converted`：每成功转换并写入 Dataset 的 1 份文档计费一次。失败不计费。无启动费；平台用量已含在事件价里。建议每次运行设置 **Max total charge USD**，触顶后停止处理剩余链接。

档位（每 1000 次成功）：FREE $2.99 · BRONZE $2.69 · SILVER $2.39 · GOLD $2.09。

### License

MIT. Built on the open-source MarkItDown library (MIT, used as a PyPI dependency). See `LICENSE` and `NOTICE`. This Actor is not an official Microsoft product and is not endorsed by Microsoft.

# Actor input Schema

## `fileUrls` (type: `array`):

Public URLs of documents (PDF, DOCX, XLSX, XLS, PPTX, HTML, CSV, TXT, MD, JSON, XML, PNG/JPG).

## `keepImages` (type: `boolean`):

Keep base64 data URIs for images instead of truncating them. Output gets much larger.

## `encoding` (type: `string`):

Optional source encoding for text files, e.g. gb18030. Leave empty to auto-detect.

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

Files larger than this are skipped.

## Actor input object example

```json
{
  "fileUrls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ],
  "keepImages": false,
  "maxFileSizeMb": 50
}
```

# Actor output Schema

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

One dataset item per input URL, with url, fileName, status, markdown, and error when conversion fails.

# 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 = {
    "fileUrls": [
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ample_jeopardy_l8k/markitdown-zh").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 = { "fileUrls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"] }

# Run the Actor and wait for it to finish
run = client.actor("ample_jeopardy_l8k/markitdown-zh").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 '{
  "fileUrls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ]
}' |
apify call ample_jeopardy_l8k/markitdown-zh --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ample_jeopardy_l8k/markitdown-zh"
        }
    }
}
```

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/PyrncNVzS8BomKhjC/builds/1XdZSdUiaJJ48yHBS/openapi.json
