# YouTube Video to Article (`hikayatlabs/youtube-video-to-article`) Actor

Transforms YouTube videos into longform blog articles using multimodal LLMs. Extracts video transcripts, interprets content semantically, and synthesizes a coherent longform article.

- **URL**: https://apify.com/hikayatlabs/youtube-video-to-article.md
- **Developed by:** [Hikayat Labs](https://apify.com/hikayatlabs) (community)
- **Categories:** AI, Automation, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $100.00 / 1,000 articles

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## YouTube Video to Article

> ⚠️ **ALPHA SOFTWARE** — Expect breaking changes, bugs, and evolving features. [Report issues →](#your-feedback)

**YouTube Video to Article** transforms YouTube videos into longform articles using multimodal AI. It extracts video transcripts, interprets content semantically, and synthesizes a coherent article.

Works best with educational content, talks, interviews, and explainers.

> **Language support:** Only English is supported at the moment. Videos must have English subtitles or transcripts (manual, not auto-generated). Videos in other languages will return a `NO_TRANSCRIPT` error.

### How it works

Three-stage pipeline:

1. **Extract** — Invoke [YouTube Scraper](https://apify.com/streamers/youtube-scraper) to fetch video metadata and transcript
2. **Interpret** — Semantic analysis of transcript content (key arguments, structure, claims)
3. **Synthesize** — Generate a structured article grounded in the source material

Processing takes ~20–40 seconds per video, depending on transcript length.

### Cost

Pay-per-event pricing:

| Event | Cost |
|-------|------|
| YouTube extraction (via [YouTube Scraper](https://apify.com/streamers/youtube-scraper)) | Billed by that actor — see its pricing |
| Article synthesis | ~$0.1 per article |

### Input

```json
{
  "videoUrls": [
    { "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" },
    { "url": "https://www.youtube.com/watch?v=abc123" }
  ],
  "synthesisTemplate": "article",
  "synthesisGuide": "Write in a neutral journalistic tone",
  "includeExtracted": false,
  "includeInterpretation": false
}
````

#### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `videoUrls` | array | ✅ | — | YouTube video URLs to process. Each item is an object with `url` (required). |
| `synthesisTemplate` | string | No | `"article"` | Preset output style. Options: `article`, `newsletter`, `social_thread`, `none`. |
| `synthesisGuide` | string | No | — | Custom instructions for tone, focus, style. Appended to template instructions. |
| `includeExtracted` | boolean | No | `false` | Include raw extraction data (metadata + transcript) in output. |
| `includeInterpretation` | boolean | No | `false` | Include semantic blueprint in output. |

#### Synthesis Templates

Templates provide base instructions for the LLM. `synthesisGuide` extends or refines them.

| Template | Output style |
|----------|-------------|
| `article` | General purpose — structured with headings, conversational voice |
| `newsletter` | Concise, scannable, hook intro, call-to-action ending |
| `social_thread` | Punchy, short paragraphs, engaging hooks — LinkedIn/Twitter style |
| `none` | No template — only custom `synthesisGuide` (if any) is sent |

### Output

Each processed video produces one dataset item:

```json
{
  "sourceUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Generated Article Title",
  "body": "## Markdown article content...",
  "wordCount": 1250,
  "error": null,
  "errorMessage": null
}
```

| Field | Description |
|-------|-------------|
| `sourceUrl` | Original YouTube video URL |
| `title` | Generated article title (plain text) |
| `body` | Full article body in **markdown** |
| `wordCount` | Word count of generated article |
| `error` | Error code if failed: `SCRAPE_FAILED`, `NO_TRANSCRIPT`, `INTERPRETATION_FAILED`, `LLM_ERROR`, `TIMEOUT`, `CONFIG_ERROR`, `INTERNAL_ERROR` |
| `errorMessage` | Detailed error description |
| `extracted` | *(only if `includeExtracted: true`)* Raw video metadata and transcript |
| `interpretation` | *(only if `includeInterpretation: true`)* Semantic blueprint |

Failed videos still produce a dataset item with `error` and `errorMessage` populated. The actor continues processing remaining URLs.

### API Usage

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("actor-id").call(
    run_input={
        "videoUrls": [{"url": "https://www.youtube.com/watch?v=EXAMPLE"}],
        "synthesisTemplate": "article"
    }
)

for item in client.dataset(run["defaultDatasetId"]).list_items().items:
    print(item["title"], item["wordCount"])
```

```javascript
import { ApifyClient } from "apify-client";

const client = new ApifyClient({ token: "YOUR_API_TOKEN" });
const run = await client
  .actor("actor-id")
  .call({
    videoUrls: [{ url: "https://www.youtube.com/watch?v=EXAMPLE" }],
    synthesisTemplate: "article",
  });

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const item of items) {
  console.log(item.title, item.wordCount);
}
```

```bash
apify call actor-id \
  '{"videoUrls":[{"url":"https://www.youtube.com/watch?v=EXAMPLE"}],"synthesisTemplate":"article"}'
```

### FAQ

**What videos work best?** Educational content, talks, interviews, explainers, and any video with a clear English transcript. Music videos and content without English subtitles won't produce useful results.

**What if a video has no English transcript?** The actor returns a `NO_TRANSCRIPT` error for that video and continues processing the rest. Auto-generated subtitles are not used — only manual subtitles are accepted.

**Does it support other languages?** Not yet. The actor currently only processes English transcripts. Support for additional languages is planned.

**Can I customize the output?** Yes — use `synthesisTemplate` for a preset style and `synthesisGuide` for custom instructions on tone, structure, and focus.

**What if a video fails?** The actor continues processing remaining URLs. Check `error` and `errorMessage` in the output for details.

**Can I automate runs?** Yes. Use Apify scheduling, webhooks, or the API.

### Your Feedback

This is alpha software. Bug reports and feature requests help us improve:

- 🐛 [Create an issue](https://apify.com/hikayatlabs/youtube-video-to-article/issues) with the run ID, input parameters, and expected vs actual behavior

***

**By Hikayat Labs**

# Actor input Schema

## `videoUrls` (type: `array`):

One or more YouTube video URLs to process. Each URL can optionally override the global style and output settings. Only English is supported — videos must have manual English subtitles or transcripts. Videos in other languages will fail with a NO\_TRANSCRIPT error.

## `sourceDataset` (type: `string`):

Select an existing dataset to process instead of scraping URLs. The dataset items must be raw output from a YouTube scraper Actor.

## `synthesisTemplate` (type: `string`):

Choose a preset style for the output. The template sets the base instructions sent to the LLM. Per-URL overrides take precedence.

## `synthesisGuide` (type: `string`):

Optional instructions for the LLM on tone, focus, and style (e.g. 'Write in a neutral journalistic tone, focus on factual content, preserve the speaker's key insights').

## `includeExtracted` (type: `boolean`):

If enabled, the output for each URL will include an <code>extracted</code> field containing the raw video metadata and transcript.

## `includeInterpretation` (type: `boolean`):

If enabled, the output for each URL will include an <code>interpretation</code> field containing the semantic blueprint generated from the video transcript.

## Actor input object example

```json
{
  "videoUrls": [
    {
      "url": "https://www.youtube.com/watch?v=EXAMPLE"
    }
  ],
  "synthesisTemplate": "article",
  "includeExtracted": false,
  "includeInterpretation": false
}
```

# Actor output Schema

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

Dataset containing generated articles with source URLs, titles, bodies, word counts, and processing status

# 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 = {
    "videoUrls": [
        {
            "url": "https://www.youtube.com/watch?v=EXAMPLE"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hikayatlabs/youtube-video-to-article").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 = { "videoUrls": [{ "url": "https://www.youtube.com/watch?v=EXAMPLE" }] }

# Run the Actor and wait for it to finish
run = client.actor("hikayatlabs/youtube-video-to-article").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videoUrls": [
    {
      "url": "https://www.youtube.com/watch?v=EXAMPLE"
    }
  ]
}' |
apify call hikayatlabs/youtube-video-to-article --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=hikayatlabs/youtube-video-to-article",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Video to Article",
        "description": "Transforms YouTube videos into longform blog articles using multimodal LLMs. Extracts video transcripts, interprets content semantically, and synthesizes a coherent longform article.",
        "version": "0.0",
        "x-build-id": "KbyUmrd0UIwb7iRHb"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/hikayatlabs~youtube-video-to-article/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-hikayatlabs-youtube-video-to-article",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/hikayatlabs~youtube-video-to-article/runs": {
            "post": {
                "operationId": "runs-sync-hikayatlabs-youtube-video-to-article",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/hikayatlabs~youtube-video-to-article/run-sync": {
            "post": {
                "operationId": "run-sync-hikayatlabs-youtube-video-to-article",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "videoUrls": {
                        "title": "YouTube Video URLs",
                        "type": "array",
                        "description": "One or more YouTube video URLs to process. Each URL can optionally override the global style and output settings. Only English is supported — videos must have manual English subtitles or transcripts. Videos in other languages will fail with a NO_TRANSCRIPT error.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "sourceDataset": {
                        "title": "Source Dataset",
                        "type": "string",
                        "description": "Select an existing dataset to process instead of scraping URLs. The dataset items must be raw output from a YouTube scraper Actor."
                    },
                    "synthesisTemplate": {
                        "title": "Synthesis Template",
                        "enum": [
                            "article",
                            "article_short",
                            "article_long",
                            "newsletter",
                            "newsletter_short",
                            "social_thread",
                            "none"
                        ],
                        "type": "string",
                        "description": "Choose a preset style for the output. The template sets the base instructions sent to the LLM. Per-URL overrides take precedence.",
                        "default": "article"
                    },
                    "synthesisGuide": {
                        "title": "Synthesis Guide",
                        "type": "string",
                        "description": "Optional instructions for the LLM on tone, focus, and style (e.g. 'Write in a neutral journalistic tone, focus on factual content, preserve the speaker's key insights')."
                    },
                    "includeExtracted": {
                        "title": "Include Raw Extraction Output",
                        "type": "boolean",
                        "description": "If enabled, the output for each URL will include an <code>extracted</code> field containing the raw video metadata and transcript.",
                        "default": false
                    },
                    "includeInterpretation": {
                        "title": "Include Semantic Interpretation",
                        "type": "boolean",
                        "description": "If enabled, the output for each URL will include an <code>interpretation</code> field containing the semantic blueprint generated from the video transcript.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
