# AI Content Transformation Engine - Rewrite at Scale (`ntriqpro/content-factory`) Actor

Bulk rewrite, summarize, and transform content. Convert blog posts, articles, and documents across different formats and tones.

- **URL**: https://apify.com/ntriqpro/content-factory.md
- **Developed by:** [daehwan kim](https://apify.com/ntriqpro) (community)
- **Categories:** AI, Automation
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event + usage

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## 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

## Content Factory — AI Content Transformation Engine

Give it any text. Get back a report, quiz, flashcard deck, podcast script, slide outline, mind map, or audio — in one API call.

No OpenAI API key. No external service. Powered by local AI running on dedicated hardware. **Zero per-token cost.**

### Use Cases

- **EdTech platforms** — Auto-generate quiz questions and flashcards from course material
- **Content teams** — Convert blog drafts into podcast scripts or slide decks
- **E-learning** — Create Q\&A pairs and study materials from textbooks or docs
- **Internal tools** — Generate structured reports from meeting notes or research
- **AI workflows** — Plug into Apify pipelines for multi-step content transformation

### Tools at a Glance

| Tool | Output | Price |
|------|--------|-------|
| `qa_generate` | Q\&A pairs from text | $0.15 |
| `report` | Structured report with sections | $0.12 |
| `quiz` | Multiple-choice questions | $0.15 |
| `flashcards` | Front/back flashcard deck | $0.15 |
| `mindmap` | Hierarchical mind map JSON | $0.08 |
| `data_table` | Structured data table | $0.15 |
| `slide_deck` | Slide-by-slide outline | $0.20 |
| `podcast_script` | Host/guest dialogue script | $0.18 |
| `tts_generate` | Audio file (MP3) from text | $0.05 |

### Installation

```bash
npm install
```

### Usage

#### Via Apify API

```javascript
const run = await Apify.call('ntriqpro/content-factory', {
  toolName: 'qa_generate',
  input: { text: 'Your text here', language: 'en' }
});
  }
}
```

#### Tool Reference

##### 1. QA Generate

Generate question-answer pairs from text.

```javascript
{
  "toolName": "qa_generate",
  "input": {
    "text": "Machine learning is a subset of AI...",
    "language": "en"  // optional, default: "en"
  }
}
```

**Response:**

```json
{
  "status": "ok",
  "model": "qwen2.5-7b",
  "qa_pairs": [
    { "question": "What is machine learning?", "answer": "..." },
    { "question": "How does ML differ from AI?", "answer": "..." }
  ],
  "processing_time_ms": 2345
}
```

##### 2. Report

Generate formatted reports in three styles: blog, briefing, or study guide.

```javascript
{
  "toolName": "report",
  "input": {
    "text": "Python is a programming language...",
    "style": "blog",  // "blog" | "briefing" | "study_guide"
    "language": "en"  // optional, default: "en"
  }
}
```

**Response:**

```json
{
  "status": "ok",
  "model": "qwen2.5-7b",
  "report": "# Python Programming\n\n## Introduction\n...",
  "style": "blog",
  "processing_time_ms": 3456
}
```

##### 3. Quiz

Generate quiz questions with multiple choice options.

```javascript
{
  "toolName": "quiz",
  "input": {
    "text": "The solar system consists of...",
    "language": "en"  // optional, default: "en"
  }
}
```

**Response:**

```json
{
  "status": "ok",
  "model": "qwen2.5-7b",
  "quiz_questions": [
    {
      "question": "How many planets are in our solar system?",
      "options": ["8", "9", "10", "7"],
      "correct_answer": "8"
    }
  ],
  "processing_time_ms": 2100
}
```

##### 4. Flashcards

Generate flashcard decks for learning.

```javascript
{
  "toolName": "flashcards",
  "input": {
    "text": "Photosynthesis is the process...",
    "language": "en"  // optional, default: "en"
  }
}
```

**Response:**

```json
{
  "status": "ok",
  "model": "qwen2.5-7b",
  "flashcards": [
    {
      "front": "What is photosynthesis?",
      "back": "The process by which plants convert light energy..."
    }
  ],
  "processing_time_ms": 1987
}
```

##### 5. Mindmap

Generate Mermaid mind map diagrams.

```javascript
{
  "toolName": "mindmap",
  "input": {
    "text": "Web development involves frontend and backend...",
    "language": "en"  // optional, default: "en"
  }
}
```

**Response:**

```json
{
  "status": "ok",
  "model": "qwen2.5-7b",
  "mindmap": "mindmap\n  root((Web Development))\n    Frontend\n      HTML\n      CSS\n      JavaScript",
  "format": "mermaid",
  "processing_time_ms": 1876
}
```

##### 6. Data Table

Extract structured data into tables.

```javascript
{
  "toolName": "data_table",
  "input": {
    "text": "Japan: Capital Tokyo, Population 125M. Korea: Capital Seoul, Population 50M.",
    "language": "en"  // optional, default: "en"
  }
}
```

**Response:**

```json
{
  "status": "ok",
  "model": "qwen2.5-7b",
  "data_table": {
    "columns": ["Country", "Capital", "Population"],
    "rows": [
      ["Japan", "Tokyo", "125M"],
      ["Korea", "Seoul", "50M"]
    ]
  },
  "processing_time_ms": 1654
}
```

##### 7. Slide Deck

Generate presentation slide decks.

```javascript
{
  "toolName": "slide_deck",
  "input": {
    "text": "Digital transformation has three phases...",
    "language": "en"  // optional, default: "en"
  }
}
```

**Response:**

```json
{
  "status": "ok",
  "model": "qwen2.5-7b",
  "slides": [
    {
      "slide_number": 1,
      "title": "Digital Transformation",
      "content": "An overview of modern business...",
      "notes": "Speaker notes..."
    }
  ],
  "processing_time_ms": 3210
}
```

##### 8. Podcast Script

Generate conversational podcast scripts.

```javascript
{
  "toolName": "podcast_script",
  "input": {
    "text": "Artificial intelligence is changing...",
    "language": "en"  // optional, default: "en"
  }
}
```

**Response:**

```json
{
  "status": "ok",
  "model": "qwen2.5-7b",
  "script": "[Host]: Welcome to the AI podcast...\n[Guest]: Thanks for having me...",
  "format": "conversational",
  "processing_time_ms": 4123
}
```

##### 9. TTS Generate

Generate natural speech audio from text.

```javascript
{
  "toolName": "tts_generate",
  "input": {
    "text": "Hello, this is a test message.",
    "voice": "af_heart",  // optional, default: "af_heart"
    "speed": 1.0  // optional, 0.5-2.0, default: 1.0
  }
}
```

**Response:**

```json
{
  "status": "ok",
  "model": "kokoro",
  "audio_url": "https://vision.ntriq.co.kr/audio/...",
  "voice": "af_heart",
  "speed": 1.0,
  "duration_seconds": 3.2,
  "processing_time_ms": 2456
}
```

### Pricing

Free plan: each run returns up to 25 results. Paid Apify plans receive the full result set.

Optimized based on cloud performance testing. Processing times range from 263ms (TTS) to 54s (Slide Deck).

| Tool | Price | Processing Time |
|------|-------|-----------------|
| tts\_generate | $0.05 | ~260ms |
| mindmap | $0.08 | ~17s |
| report | $0.12 | ~28s |
| qa\_generate | $0.15 | ~36s |
| quiz | $0.15 | ~36s |
| flashcards | $0.15 | ~36s |
| data\_table | $0.15 | ~36s |
| podcast\_script | $0.18 | ~53s |
| slide\_deck | $0.20 | ~54s |

### Environment Variables

```bash
NTRIQ_AI_URL=https://vision.ntriq.co.kr  # default: https://vision.ntriq.co.kr
```

### Development

```bash
## Run tests
npm test

## Lint
npm run lint
```

### License

MIT

***

### 🔗 Related Actors by ntriqpro

Build your data pipeline with the ntriqpro Actor suite:

- [**pdf-to-markdown**](https://apify.com/ntriqpro/pdf-to-markdown) — Office to Markdown — Document Extractor
- [**video-intelligence-analyzer**](https://apify.com/ntriqpro/video-intelligence-analyzer) — Video & Image AI
- [**resume-parser**](https://apify.com/ntriqpro/resume-parser) — ATS Resume Parser

### ⭐ Love it? Leave a Review

Your rating helps other professionals discover this actor. [Rate it here](https://apify.com/ntriqpro/content-factory/reviews).

### Disclaimer

**GENERAL DISCLAIMER**: This is an AI-powered tool. Output may contain errors, inaccuracies, or omissions. Do not rely on output for legal, medical, or financial decisions without independent professional review. We provide no warranty, express or implied, regarding the accuracy, completeness, or fitness for any particular purpose of the generated output.

# Actor input Schema

## `toolName` (type: `string`):

Content tool to run: report (blog/briefing/study guide), qa\_generate (Q\&A pairs), quiz, flashcards, mindmap, data\_table, slide\_deck, podcast\_script, tts\_generate. Free plan: each run returns up to 25 results. Paid Apify plans receive the full result set.

## `input` (type: `object`):

Parameters for the selected tool. For most tools: provide 'text' (source content) and 'language' (e.g. 'en'). For report: also 'style' (blog/briefing/study\_guide). For tts\_generate: 'text' and 'voice' (e.g. 'af\_heart').

## `action` (type: `string`):

Optional: 'get\_tools' to list available tools and their parameters, 'list\_voices' to see TTS voices. Leave empty to run a tool using toolName + input above.

## Actor input object example

```json
{
  "toolName": "report",
  "input": {
    "text": "Artificial intelligence is transforming industries by automating repetitive tasks, enhancing decision-making, and enabling new capabilities. Machine learning models can now recognize images, translate languages, and generate human-like text. Businesses are adopting AI to improve customer service, optimize supply chains, and accelerate research and development.",
    "style": "blog",
    "language": "en"
  }
}
```

# Actor output Schema

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

No description

# 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 = {
    "toolName": "report",
    "input": {
        "text": "Artificial intelligence is transforming industries by automating repetitive tasks, enhancing decision-making, and enabling new capabilities. Machine learning models can now recognize images, translate languages, and generate human-like text. Businesses are adopting AI to improve customer service, optimize supply chains, and accelerate research and development.",
        "style": "blog",
        "language": "en"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ntriqpro/content-factory").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 = {
    "toolName": "report",
    "input": {
        "text": "Artificial intelligence is transforming industries by automating repetitive tasks, enhancing decision-making, and enabling new capabilities. Machine learning models can now recognize images, translate languages, and generate human-like text. Businesses are adopting AI to improve customer service, optimize supply chains, and accelerate research and development.",
        "style": "blog",
        "language": "en",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("ntriqpro/content-factory").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 '{
  "toolName": "report",
  "input": {
    "text": "Artificial intelligence is transforming industries by automating repetitive tasks, enhancing decision-making, and enabling new capabilities. Machine learning models can now recognize images, translate languages, and generate human-like text. Businesses are adopting AI to improve customer service, optimize supply chains, and accelerate research and development.",
    "style": "blog",
    "language": "en"
  }
}' |
apify call ntriqpro/content-factory --silent --output-dataset

```

## MCP server setup

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

```

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/0lVtCZpYKQBwzw1oJ/builds/tmkbcZESwPHazafL9/openapi.json
