# Chinese Simplified/Traditional Converter & Pinyin Toolkit (`digital-tools/chinese-text-toolkit`) Actor

Bulk convert Simplified ↔ Traditional Chinese (Taiwan, Hong Kong variants with phrase conversion), generate pinyin with tones or initials, segment Chinese words and extract keywords. Fast offline API, no external calls. 简繁转换 拼音 分词.

- **URL**: https://apify.com/digital-tools/chinese-text-toolkit.md
- **Developed by:** [凡 方](https://apify.com/digital-tools) (community)
- **Categories:** Developer tools, AI, Integrations
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

### What does Chinese Text Toolkit do?

**Chinese Text Toolkit** processes Chinese text in bulk:

- 🔄 **Simplified ↔ Traditional conversion** (OpenCC), including **Taiwan** and **Hong Kong** standards and **phrase-level conversion** (e.g. 软件 → 軟體, 信息 → 資訊)
- 🔤 **Pinyin** with tone marks (zhōng wén), tone numbers (zhong1 wen2), no tones, or initials (zw)
- ✂️ **Word segmentation** (jieba)
- 🏷️ **Keyword extraction** (TF-IDF)

简繁转换、拼音、分词、关键词提取，一次搞定。

Use it as a **Simplified to Traditional Chinese converter**, **Chinese to Pinyin API**, **Chinese tokenizer** or **Chinese keyword extractor** for thousands of texts at once.

### Why use it?

- ⚡ **Fast and offline** – everything runs inside the Actor, no third-party APIs, no rate limits.
- 🌏 **Correct regional variants** – choose Mainland, Taiwan or Hong Kong Traditional.
- 🧩 **One call, many tools** – convert, romanize, segment and tag in a single run.
- 💸 **Pay per text** – one price per input string, no matter which features you turn on.
- 🤖 **Agent and automation friendly** – use it from Make, Zapier, n8n, the API or the Apify MCP server to localize product listings, subtitles, SEO slugs or search indexes.

### How to use it

1. Add your strings to **Texts** (one item per text, up to 100,000 characters each).
2. Choose a **Script conversion** and **Pinyin style**.
3. Turn on **Word segmentation** or **Keywords** if needed.
4. Click **Start** and download the results.

#### Input example

```json
{
  "texts": ["我们正在开发一个软件，用于处理简体中文和繁体中文的转换。"],
  "conversion": "s2twp",
  "pinyin": true,
  "pinyinStyle": "tone",
  "segment": true,
  "keywords": 5
}
```

#### Output example

```json
{
  "index": 0,
  "input": "我们正在开发一个软件，用于处理简体中文和繁体中文的转换。",
  "converted": "我們正在開發一個軟體，用於處理簡體中文和繁體中文的轉換。",
  "conversion": "s2twp",
  "pinyin": "wǒ men zhèng zài kāi fā yí gè ruǎn jiàn yòng yú chǔ lǐ jiǎn tǐ zhōng wén hé fán tǐ zhōng wén de zhuǎn huàn",
  "pinyinInitials": "wmzzkfygrjyyclj...",
  "words": ["我们", "正在", "开发", "一个", "软件", "，", "用于", "处理", "简体中文", "和", "繁体中文", "的", "转换", "。"],
  "keywords": ["简体中文", "繁体中文", "软件", "转换", "开发"],
  "characterCount": 28,
  "hanziCount": 26
}
```

### How much does it cost?

This Actor uses **pay-per-event (PPE)** pricing: you pay only for results, and the Apify platform compute it uses is already included.

| Event | Price | Per 1,000 |
|---|---|---|
| Text processed | **$0.0005** per text | **$0.50** per 1,000 texts |
| Actor start | $0.0005 per run | – |

One price per text, whichever features (conversion, pinyin, segmentation, keywords) you turn on. For example, 1,000 texts cost about **$0.50**. The Actor start fee is charged once per run (one event per GB of memory; the default memory setting counts as one). You can set a **maximum cost per run** in the run options and the Actor stops cleanly when it is reached. Apify's free plan includes $5 of monthly credit, enough to try it at no cost.

### Use cases

- Localize e-commerce listings and apps for Taiwan / Hong Kong
- Generate pinyin for names, SEO-friendly URL slugs and search indexes
- Pre-process Chinese text for NLP, RAG or LLM pipelines
- Language-learning content with tone-marked pinyin

### FAQ

**Which conversion modes are supported?** All OpenCC modes: s2t, t2s, s2tw, tw2s, s2twp (with Taiwan phrases), tw2sp, s2hk, hk2s and more.

**Are polyphonic characters handled?** Pinyin is generated word by word, so common words get the correct reading (e.g. 银行 yín háng).

### Other tools by Digital-Tools

- [Webpage to Markdown for LLMs & RAG](https://apify.com/Digital-Tools/webpage-to-markdown) – Convert any web page URL into clean, LLM-ready Markdown.
- [URL Metadata & Open Graph Link Preview Extractor](https://apify.com/Digital-Tools/url-metadata-extractor) – Get title, description, preview image, favicon, canonical URL, Open Graph, Twitter Card, RSS feeds and JSON-LD schema from any list of URLs.
- [Broken Link Checker - Find 404s & Dead Links](https://apify.com/Digital-Tools/broken-link-checker) – Crawl a website and check every internal and external link for 404s, 5xx errors, timeouts and redirects.
- [Sitemap URL Extractor - Get All URLs from sitemap.xml](https://apify.com/Digital-Tools/sitemap-url-extractor) – Extract every URL from a website's XML sitemaps.
- [RSS & Atom Feed Reader - Parse Any Feed to JSON](https://apify.com/Digital-Tools/rss-feed-reader) – Read RSS, Atom and RDF feeds in bulk and get clean JSON: title, link, date, author, categories, summary, full content, images and podcast enclosures.
- [SSL Certificate & DNS Checker - Bulk Domain Expiry Monitor](https://apify.com/Digital-Tools/ssl-dns-checker) – Check SSL/TLS certificates and DNS records for many domains at once: expiry date, days left, issuer, SANs, TLS version, validity, plus A, AAAA, CNAME, MX, NS, TXT, CAA, SOA, SPF and DMARC.
- [PDF, Word, PowerPoint & Excel to Text Extractor](https://apify.com/Digital-Tools/document-to-text) – Extract text from PDF, DOCX, PPTX and XLSX files by URL.

Questions or feature requests? Use the **Issues** tab.

# Actor input Schema

## `texts` (type: `array`):

Chinese texts to process. Each string becomes one result.

## `conversion` (type: `string`):

OpenCC conversion profile.

## `pinyin` (type: `boolean`):

Add pinyin romanization and initials.

## `pinyinStyle` (type: `string`):

How pinyin is written.

## `segment` (type: `boolean`):

Split text into words (jieba).

## `keywords` (type: `integer`):

Extract top N keywords (TF-IDF). 0 = off.

## Actor input object example

```json
{
  "texts": [
    "我们正在开发一个软件，用于处理简体中文和繁体中文的转换。",
    "歡迎使用繁體中文轉換工具"
  ],
  "conversion": "s2t",
  "pinyin": true,
  "pinyinStyle": "tone",
  "segment": false,
  "keywords": 0
}
```

# Actor output Schema

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

Dataset with one item per processed input.

# 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 = {
    "texts": [
        "我们正在开发一个软件，用于处理简体中文和繁体中文的转换。",
        "歡迎使用繁體中文轉換工具"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("digital-tools/chinese-text-toolkit").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 = { "texts": [
        "我们正在开发一个软件，用于处理简体中文和繁体中文的转换。",
        "歡迎使用繁體中文轉換工具",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("digital-tools/chinese-text-toolkit").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 '{
  "texts": [
    "我们正在开发一个软件，用于处理简体中文和繁体中文的转换。",
    "歡迎使用繁體中文轉換工具"
  ]
}' |
apify call digital-tools/chinese-text-toolkit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,digital-tools/chinese-text-toolkit"
        }
    }
}
```

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/HYrITEcTREKIeyNV8/builds/9sMaWYuGFkACUlSOy/openapi.json
