# X Article to Markdown Converter (`khadinakbar/x-article-to-markdown-scraper`) Actor

Convert X long-form Articles to Markdown from status URLs or tweet IDs. TwitterAPI.io primary, GetXAPI fallback. Cookie-free, MCP-ready.

- **URL**: https://apify.com/khadinakbar/x-article-to-markdown-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Social media, AI, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $8.00 / 1,000 article converted to markdowns

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

## Convert X (Twitter) long-form Articles to Markdown

This Actor returns one dataset row per X Article wrapper: Markdown body, optional YAML front matter, title, author, cover image, and word counts. Researchers, content teams, and AI agents use it to archive or summarize long-form X Articles from status URLs or tweet IDs — cookie-free and MCP-ready.

### Best fit for this Actor

- Best fit when you already have `https://x.com/{user}/status/{id}` links (or bare tweet IDs) that open a long-form X Article.
- Designed for Markdown export into RAG, newsletters, Obsidian/Notion, or LLM summarization.
- Works well for mixed batches: Article wrappers convert to `COMPLETE` rows; ordinary tweets surface as clear `VALID_EMPTY` diagnostics.

Start with [X Tweet Scraper](https://apify.com/khadinakbar/x-tweet-scraper) to discover status URLs, then pass those wrappers here. Continue with [X Post Detail Scraper](https://apify.com/khadinakbar/x-post-detail-scraper) when you need the short post card instead of the Article body.

### Workflow: status URL to Markdown archive

An analyst starts with Decentralised.co Article status URLs, keeps images and YAML front matter enabled, then exports one Markdown document per Article — title, author, published time, ~1,500-word body, and source URL — ready to schedule into a research vault or feed an agent.

### Quick start input

```json
{
  "articleUrls": [
    "https://x.com/Decentralisedco/status/1905545699552375179"
  ],
  "includeImages": true,
  "includeMetadata": true
}
```

`articleUrls` accepts status URLs (`x.com` or `twitter.com`) or numeric tweet IDs that wrap an Article. Prefer the status wrapper that opens the Article in a browser.

### Input reference

| Field | Type | What it controls |
|---|---|---|
| `articleUrls` | array\[string] | Required. Status URLs or tweet IDs that wrap long-form Articles. Prefill uses a known public Article wrapper. |
| `includeImages` | boolean | Default `true`. Embeds image/GIF blocks as `![](url)` in Markdown. |
| `includeMetadata` | boolean | Default `true`. Prepends YAML front matter (`title`, `author`, `published_at`, `url`, `description`). |
| `providerOrder` | array\[string] | Default `["twitterapi", "getxapi"]`. Ordered managed-provider try list. |

Owner-managed API keys power the run. Store users provide Article wrappers only — no provider keys in input.

### What data you receive

One dataset item equals one input URL or ID. Successful conversions include identity, metadata, and the Markdown body. Diagnostic rows keep provenance when a tweet is not an Article wrapper.

```json
{
  "articleId": "QXJ0aWNsZUVudGl0eToxOTA1NTQxMTM5MTQ0Mjk4NDk4",
  "tweetId": "1905545699552375179",
  "sourceUrl": "https://x.com/Decentralisedco/status/1905545699552375179",
  "url": "https://x.com/Decentralisedco/status/1905545699552375179",
  "title": "When Tokens Burn",
  "authorName": "DCo",
  "publishedAt": "Fri Mar 28 09:01:12 +0000 2025",
  "description": "Breaking down how crypto protocols approach revenue and cash flow…",
  "coverImage": "https://pbs.twimg.com/media/GnHXrznXUAEs-v5.jpg",
  "markdown": "---\ntitle: \"When Tokens Burn\"\nauthor: \"DCo\"\n…\n---\n\n# When Tokens Burn\n\n…",
  "wordCount": 1497,
  "characterCount": 10472,
  "provider": "twitterapi.io",
  "outcome": "COMPLETE",
  "scrapedAt": "2025-03-28T12:00:00.000Z"
}
```

| Field | Description |
|---|---|
| `articleId` | Provider article entity ID when available |
| `tweetId` | Wrapper tweet ID |
| `sourceUrl` / `url` | Input or resolved status URL |
| `title`, `authorName`, `publishedAt`, `description`, `coverImage` | Article metadata |
| `markdown` | Full Markdown (optional YAML front matter) |
| `wordCount`, `characterCount` | Body size helpers |
| `provider` | `twitterapi.io` or `getxapi` |
| `outcome` | `COMPLETE`, `VALID_EMPTY`, or `UPSTREAM_FAILED` |
| `errorType` | Optional diagnostic code such as `NOT_ARTICLE` |

### Use through the API

```bash
curl -s -X POST "https://api.apify.com/v2/acts/khadinakbar~x-article-to-markdown-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "articleUrls": ["https://x.com/Decentralisedco/status/1905545699552375179"],
    "includeImages": true,
    "includeMetadata": true
  }'
```

When the Actor completes, read the default dataset:

```bash
curl -s "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=$APIFY_TOKEN&format=json"
```

### Use with AI agents through Apify MCP

> Convert these X Article status URLs to Markdown with YAML front matter and images. Return title, author, wordCount, sourceUrl, and markdown for each COMPLETE row. Treat VALID\_EMPTY rows as finished scope, then move to the next URL.

Inspect the terminal outcome (`OUTPUT` / `RUN_SUMMARY`), read the dataset, keep `sourceUrl` for provenance, and cap `articleUrls` to control cost. Client setup: <https://mcp.apify.com>.

### Connect the workflow

- Start with [X Tweet Scraper](https://apify.com/khadinakbar/x-tweet-scraper) to search or collect status URLs, then pass Article wrappers here.
- Pair it with [X Post Detail Scraper](https://apify.com/khadinakbar/x-post-detail-scraper) when the next step is the short post card rather than long-form Markdown.
- For video long-form text on YouTube, continue with [YouTube Transcript Extractor](https://apify.com/khadinakbar/youtube-transcript-extractor).

### Pricing

This Actor uses Pay per event plus Apify platform usage. Open the live Pricing tab for current event details, and use Apify run cost controls to keep the workflow aligned with your budget.

| Event | When charged |
|---|---|
| `apify-actor-start` | Once when the Actor starts (memory-scaled) |
| `article-converted` | Once per successfully converted Article (`COMPLETE` row) |

`VALID_EMPTY` and upstream diagnostic rows stay outside the `article-converted` event. A typical one-Article run is the start fee plus the primary conversion event shown on the Pricing tab.

### Best results

- Provide the status URL that opens the Article in a browser, including a clear tweet ID.
- Start with a focused list when validating a new source set; diagnostic rows keep mixed batches readable.
- Keep `includeMetadata` enabled when feeding Obsidian, Notion, or RAG pipelines that expect title/author/url in front matter.
- Set `includeImages: false` when you only need text for LLM context windows.

### Builder's note

I designed this Actor around status-wrapper tweet IDs after I found that long-form Article bodies are richest through TwitterAPI.io’s article route, with GetXAPI as the ordered fallback. In my testing, that provider path produced stable Markdown blocks (headers, lists, media) without asking Store users for X cookies.

### Responsible use

Use for public or authorized content and follow X/Twitter terms plus applicable laws. This Actor transforms Article content returned by third-party data providers into Markdown for legitimate research and automation workflows.

# Actor input Schema

## `articleUrls` (type: `array`):

List of X status URLs or numeric tweet IDs that wrap long-form X Articles. Example: 'https://x.com/user/status/1905545699552375179' or '1905545699552375179'. This actor uses provider APIs (TwitterAPI.io primary, GetXAPI fallback) and does not require X cookies.

## `includeImages` (type: `boolean`):

When true, image/gif blocks are included in Markdown as ![](url). Set false for text-only output. Defaults to true.

## `includeMetadata` (type: `boolean`):

When true, prepend YAML front matter (title, author, published\_at, url, description) to the markdown body. Defaults to true.

## `providerOrder` (type: `array`):

Ordered list of providers to try per tweet ID. Supported values: twitterapi, getxapi. Defaults to \[twitterapi, getxapi].

## Actor input object example

```json
{
  "articleUrls": [
    "https://x.com/Decentralisedco/status/1905545699552375179"
  ],
  "includeImages": true,
  "includeMetadata": true,
  "providerOrder": [
    "twitterapi",
    "getxapi"
  ]
}
```

# Actor output Schema

## `output` (type: `string`):

Terminal outcome envelope.

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

Dataset API URL for saved Markdown rows.

## `runSummary` (type: `string`):

Outcome, articlesProcessed, articlesFailed counts.

# 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 = {
    "articleUrls": [
        "https://x.com/Decentralisedco/status/1905545699552375179"
    ],
    "providerOrder": [
        "twitterapi",
        "getxapi"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/x-article-to-markdown-scraper").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 = {
    "articleUrls": ["https://x.com/Decentralisedco/status/1905545699552375179"],
    "providerOrder": [
        "twitterapi",
        "getxapi",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/x-article-to-markdown-scraper").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 '{
  "articleUrls": [
    "https://x.com/Decentralisedco/status/1905545699552375179"
  ],
  "providerOrder": [
    "twitterapi",
    "getxapi"
  ]
}' |
apify call khadinakbar/x-article-to-markdown-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khadinakbar/x-article-to-markdown-scraper"
        }
    }
}

```

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/JVA8Zq9xRniz2cuwR/builds/NtElgmIihCKNnbzlI/openapi.json
