# Tweet / X Thread → Article (Claude, Markdown) (`gochujang/tweet-thread-to-article`) Actor

Convert a Twitter / X thread (URL or pasted text) into a clean Markdown article. Removes '1/N' noise, smooths transitions, adds optional H2 headings, preserves facts and quotes. BYO Anthropic API key. $0.01 per thread.

- **URL**: https://apify.com/gochujang/tweet-thread-to-article.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** AI
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 thread converteds

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

## Tweet / X Thread → Article (Claude)

> Convert a Twitter / X thread (URL or pasted text) into a clean **Markdown article**. Removes '1/N' noise, smooths transitions, adds optional H2 headings, preserves facts and quotes. BYO Anthropic API key. **$0.01 per thread.**

### ⚡ Run in 30 seconds

1. Get a free Anthropic API key at [console.anthropic.com](https://console.anthropic.com)
2. Copy any Twitter/X thread text and paste it into the `threadText` field (more reliable than URL)
3. Click **Start** — returns a polished Markdown article ready to publish

*Tip: pasting thread text directly is more reliable than using the URL, since X rate-limits public scrapers.*

***

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `threadUrl` | string | ``| Twitter / X URL. We try public nitter mirrors; if they fail, paste 'th |
| `threadText` | string |`` | Paste the thread text directly (more reliable than URL). |
| `articleStyle` | string | `essay` | Output format. |
| `addHeadings` | boolean | `true` | Inject ## section headings for blog/newsletter style. |
| `maxWords` | integer | `1500` | Soft cap on article length in words. |
| `model` | string | `claude-opus-4-7` | Claude model to use for thread→article conversion. |
| `anthropicApiKey` | string | `—` | Get one at console.anthropic.com. |
| `userAgent` | string | \`\` | Custom UA for thread URL fetch. |

***

### Why this exists

Twitter/X threads are great for hot takes but terrible for re-reading or sharing. You want them as **articles** — flowing paragraphs without the "1/N" noise, with proper section headings.

Threadreader.app does this but their API is gated. This actor replaces it for $0.01 per thread + Anthropic tokens (~$0.005).

***

### What you get

```json
{
  "thread_url": "https://x.com/balajis/status/...",
  "thread_chars": 3520,
  "article_md": "# Why AI agents will replace SaaS\n\nThe key insight is...\n\n## The new business model\n...\n\n## Implications\n...",
  "article_words": 480,
  "style": "blog",
  "model": "claude-opus-4-7",
  "usage": {"input_tokens": 1240, "output_tokens": 720}
}
```

***

### Two input modes

#### Mode A: paste thread text (recommended — reliable)

```json
{
  "threadText": "1/ The key insight about AI agents is...\n2/ They will replace SaaS because...\n3/ ...",
  "articleStyle": "blog",
  "anthropicApiKey": "sk-ant-..."
}
```

#### Mode B: pass X URL (best-effort via Nitter)

```json
{
  "threadUrl": "https://x.com/balajis/status/1234567890",
  "anthropicApiKey": "sk-ant-..."
}
```

> **URL note:** X.com is hostile to scraping. We try public Nitter mirrors (nitter.net, nitter.privacydev.net, nitter.poast.org). When all mirrors fail (intermittent), paste the text directly via `threadText`. Paste mode is **always reliable**.

***

### Article styles

| `articleStyle` | Output shape |
|---|---|
| `essay` | 3-6 flowing paragraphs (default) |
| `blog` | H2 section headings |
| `newsletter` | TL;DR + 3-5 sections |
| `twitter` | Compress back to a single 280-char tweet |

***

### Quick start

#### Convert a long Balaji thread into a blog post

```json
{
  "threadText": "...",
  "articleStyle": "blog",
  "addHeadings": true,
  "maxWords": 1500,
  "anthropicApiKey": "sk-ant-..."
}
```

#### One-sentence summary back into a tweet

```json
{
  "threadText": "...",
  "articleStyle": "twitter",
  "anthropicApiKey": "sk-ant-..."
}
```

***

### Pricing

**Pay-Per-Event**: `$0.01 per thread` (Apify-side).

Anthropic tokens charged separately:

| Model | Approx Anthropic cost |
|---|---|
| Claude Opus 4.7 | $0.005-0.015 |
| Claude Sonnet 4.6 | $0.001-0.003 |
| Claude Haiku 4.5 | $0.0003-0.001 |

Total typical: $0.011-0.025 per thread.

***

### Use cases

1. **Personal knowledge base** — Save threads you want to re-read later as clean articles in Obsidian / Logseq / Notion
2. **Newsletter aggregation** — Turn a creator's daily threads into a digest
3. **Cross-platform publishing** — Original thread on X, blog post on Substack, all from one input
4. **Research** — Convert deep technical threads into reference material

***

### Setting your Anthropic API key

See [Article Summarizer README](https://apify.com/gochujang/article-summarizer) for the BYO key guide.

***

### Limitations

- **X URL scraping is unreliable.** Use `threadText` for production.
- **Quote-RT context lost.** When a thread quotes other tweets, the quoted content isn't auto-included.
- **No image / media handling.** Images in threads are skipped (text-only).

***

### Related actors (same author)

- [Article Summarizer](https://apify.com/gochujang/article-summarizer) — Short summary instead of full article
- [Web Page → Markdown Converter](https://apify.com/gochujang/web-to-markdown)
- [Web Structured Data Extractor](https://apify.com/gochujang/web-structured-extractor)
- [HTML Metadata Extractor](https://apify.com/gochujang/html-metadata-extractor)

***

### Feedback

A short review helps writers / curators find it: [Leave a review on Apify Store](https://apify.com/gochujang/tweet-thread-to-article#reviews)

**Keywords:** Twitter thread to article, X thread converter, tweet to blog post, content repurposing tool, Twitter scraper, thread summarizer, social media content extraction, newsletter content

# Actor input Schema

## `threadUrl` (type: `string`):

Twitter / X URL. We try public nitter mirrors; if they fail, paste 'threadText' instead.

## `threadText` (type: `string`):

Paste the thread text directly (more reliable than URL).

## `outputFormat` (type: `string`):

How to render the thread: full article, short summary, LinkedIn post, or email newsletter.

## `articleStyle` (type: `string`):

Output sub-style when outputFormat is 'article'.

## `addHeadings` (type: `boolean`):

Inject ## section headings for blog/newsletter style.

## `maxWords` (type: `integer`):

Soft cap on article length in words (article format only).

## `generateSeo` (type: `boolean`):

If enabled, adds seo_title (≤60 chars), seo_description (≤160 chars), seo_keywords (top 5), and suggested_slug to the output.

## `outputLanguage` (type: `string`):

Language for the generated article (e.g. 'Korean', 'Spanish'). Leave blank to use the thread's original language.

## `model` (type: `string`):

Claude model to use for thread→article conversion.

## `anthropicApiKey` (type: `string`):

Get one at console.anthropic.com.

## `userAgent` (type: `string`):

Custom UA for thread URL fetch.

## Actor input object example

```json
{
  "threadUrl": "",
  "threadText": "",
  "outputFormat": "article",
  "articleStyle": "essay",
  "addHeadings": true,
  "maxWords": 1500,
  "generateSeo": false,
  "outputLanguage": "",
  "model": "claude-opus-4-7",
  "userAgent": ""
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/tweet-thread-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("gochujang/tweet-thread-to-article").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 '{}' |
apify call gochujang/tweet-thread-to-article --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gochujang/tweet-thread-to-article"
        }
    }
}
```

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/owy761B4a9g7nP63G/builds/OSWmBFXMGAa8aJN7b/openapi.json
