# Article Text and Markdown Extractor - JSONL Export (`variable_mitts/article-text-markdown-extractor`) Actor

Extract article text and Markdown from supplied public pages. Export JSONL with source URLs and quality flags for downstream content pipelines.

- **URL**: https://apify.com/variable_mitts/article-text-markdown-extractor.md
- **Developed by:** [Dhan sites](https://apify.com/variable_mitts) (community)
- **Categories:** AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.64 / 1,000 usable article extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Article Text and Markdown Extractor - JSONL Export

Extract article text and Markdown from supplied public pages. Export JSONL with source URLs and quality flags for downstream content pipelines.

### Start in one run

The prefilled form is a synthetic, offline HTML example. Click Start, then open START_HERE.md and the default dataset. No API keys, proxy subscriptions or external AI calls are needed.

For real websites, clear HTML pages, enter Public page URLs and confirm permission. Do not supply both sources. For HTML from another workflow, supply `htmlPages` objects with `url` and `html`. Inline URL values are provenance labels only.

```json
{
  "htmlPages": [
    {
      "url": "https://example.com/article",
      "html": "<html><head><title>Planning a dental appointment</title><meta name=\"author\" content=\"Demo Editor\"></head><body><nav>Home | Services | Contact</nav><article><h1>Planning a dental appointment</h1><p>The clinic team explains how routine appointments are organized. Patients can request a convenient time and receive clear preparation instructions. The reception team answers practical questions before each visit. </p><h2>Before your visit</h2><p>The practice team explains how routine appointments are organized. Patients can request a convenient time and receive clear preparation instructions. The reception team answers practical questions before each visit. </p></article><footer>Site navigation</footer></body></html>"
    }
  ],
  "maxPages": 3,
  "minCharacters": 200
}
```

### Results and workflow

Uses Trafilatura 2.3.1 to extract body text, Markdown and heuristic title/author/date/language metadata. Keeps a SHA-256 hash of the extracted text; hashes identify output text, not the original HTML. Metadata may be missing or wrong. No embeddings, semantic citation verification, text-completeness guarantee or extraction from PDFs. DOCUMENTS.jsonl uses text and url fields ready for typical RAG imports. Thin-content flags cannot detect every partially rendered page.

REPORT contains per-page rows and counts. The dataset includes unsuccessful pages so the workflow can route them to a fallback. `checked` means HTML parsing completed; it does not mean every desired field or all page content was found. Review `quality_flags`, `error`, `usable` and the coverage counts before importing data.

### Pricing and limits

Base launch price: $0.8 per 1,000 billable pages. No run-start or automatic dataset-row fee. Only extracted pages meeting minCharacters count once. Empty, thin and failed pages are uncharged; their diagnostics remain in the dataset and REJECTS. Processing is capped before extraction according to the spending limit; remaining pages are disclosed as pending. Subscription discounts: Bronze 10%, Silver 15%, Gold/Platinum/Diamond 20%.

Maximum 20 starting URLs or 50 inline HTML pages, 50 processed pages, 500 KB per inline page and 2 MB combined inline HTML. Fetched responses are capped at 2 MB. The network budget is 65 seconds plus the current bounded request; run timeout is 120 seconds. A page or time cap means partial coverage, never a full-site claim. Contact-link discovery is limited to three links per supplied page and one level. Requested memory is restricted to 256–512 MB.

### What this does not do

Static public HTML only: no browser rendering, login, CAPTCHA bypass, proxy rotation, search discovery or hidden private data. Robots restrictions are respected. Requests stay on exact input hosts and their www variants; private, reserved and mixed-DNS destinations are blocked, including redirects. No external contact links are fetched. Only process data you are entitled to use. This product does not send outreach.

### Troubleshooting

Invalid input: choose exactly one input source and check limits. HTTP/robots errors: inspect the row and use a permitted source. Empty/thin article: use a rendered HTML snapshot from an authorized upstream tool; increasing a threshold cannot recover missing content. No contacts observed: check whether details are rendered by JavaScript, obfuscated or only in images. Report an issue with run ID and a small non-sensitive example; do not post tokens or private source HTML.

### Implementation credits

Built with the Apify Python SDK. Article extraction uses [Trafilatura](https://github.com/adbar/trafilatura), Apache-2.0. No claim of affiliation with sites being processed or guaranteed completeness.

### Who is this for?

Content and RAG teams extracting article text from known public URLs. Review quality flags before sending extracted content to downstream tools.

### Frequently asked questions

#### Does this bypass paywalls or guarantee full article extraction?

No. It processes supported accessible pages and reports quality observations. Page structure, access restrictions and JavaScript rendering can limit extraction. Review the output instead of assuming every URL produced a complete article.

#### How do I try it before using my full input?

Open the Input tab, review the prefilled example, and run a small batch with a spending limit. Inspect the dataset and report before increasing the batch. Examples can incur the documented inspection or analysis fee; an execution marked successful can still contain rejected records or incomplete coverage.

#### Can I use the Actor through an API or on a schedule?

Yes. Use Apify's [Actor API](https://docs.apify.com/api/v2/acts-run-sync-get-dataset-items-post) or [schedules](https://docs.apify.com/platform/schedules). Keep credentials private and use the documented input fields. The pricing and limits below apply to API runs too.

### Related tools for the next step

- [RAG Dataset Cleaner - Text Deduplication and Source URLs](https://apify.com/variable_mitts/rag-dataset-cleaner-evidence)
- [RAG Text Chunker - Source Offsets and Verbatim Chunks](https://apify.com/variable_mitts/citation-span-text-chunker)

# Actor input Schema

## `startUrls` (type: `array`):

Optional alternative to HTML pages. Supply 1–20 public URLs; clear HTML pages first. Static HTML only.

## `htmlPages` (type: `array`):

Alternative to public URLs. Supply objects with url and html. URLs are provenance labels and are not fetched. Clear this array when using Public page URLs. Maximum 50 pages, 500 KB per page, 2 MB combined.

## `maxPages` (type: `integer`):

Shared cap across supplied pages and discovered contact pages. Time and spending caps may stop earlier.

## `permissionConfirmed` (type: `boolean`):

Required only in public-URL mode. Respect the website terms and applicable rights. Offline HTML demo needs no network access.

## `minCharacters` (type: `integer`):

Shorter extraction is flagged thin_content, excluded from DOCUMENTS.jsonl and not charged. This is a heuristic, not a completeness guarantee.

## Actor input object example

```json
{
  "htmlPages": [
    {
      "url": "https://example.com/article",
      "html": "<html><head><title>Planning a dental appointment</title><meta name=\"author\" content=\"Demo Editor\"></head><body><nav>Home | Services | Contact</nav><article><h1>Planning a dental appointment</h1><p>The clinic team explains how routine appointments are organized. Patients can request a convenient time and receive clear preparation instructions. The reception team answers practical questions before each visit. </p><h2>Before your visit</h2><p>The practice team explains how routine appointments are organized. Patients can request a convenient time and receive clear preparation instructions. The reception team answers practical questions before each visit. </p></article><footer>Site navigation</footer></body></html>"
    }
  ],
  "maxPages": 3,
  "permissionConfirmed": false,
  "minCharacters": 200
}
```

# Actor output Schema

## `file0` (type: `string`):

No description

## `file1` (type: `string`):

No description

## `file2` (type: `string`):

No description

## `file3` (type: `string`):

No description

## `rows` (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 = {
    "htmlPages": [
        {
            "url": "https://example.com/article",
            "html": "<html><head><title>Planning a dental appointment</title><meta name=\"author\" content=\"Demo Editor\"></head><body><nav>Home | Services | Contact</nav><article><h1>Planning a dental appointment</h1><p>The clinic team explains how routine appointments are organized. Patients can request a convenient time and receive clear preparation instructions. The reception team answers practical questions before each visit. </p><h2>Before your visit</h2><p>The practice team explains how routine appointments are organized. Patients can request a convenient time and receive clear preparation instructions. The reception team answers practical questions before each visit. </p></article><footer>Site navigation</footer></body></html>"
        }
    ],
    "maxPages": 3,
    "minCharacters": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("variable_mitts/article-text-markdown-extractor").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 = {
    "htmlPages": [{
            "url": "https://example.com/article",
            "html": "<html><head><title>Planning a dental appointment</title><meta name=\"author\" content=\"Demo Editor\"></head><body><nav>Home | Services | Contact</nav><article><h1>Planning a dental appointment</h1><p>The clinic team explains how routine appointments are organized. Patients can request a convenient time and receive clear preparation instructions. The reception team answers practical questions before each visit. </p><h2>Before your visit</h2><p>The practice team explains how routine appointments are organized. Patients can request a convenient time and receive clear preparation instructions. The reception team answers practical questions before each visit. </p></article><footer>Site navigation</footer></body></html>",
        }],
    "maxPages": 3,
    "minCharacters": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("variable_mitts/article-text-markdown-extractor").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 '{
  "htmlPages": [
    {
      "url": "https://example.com/article",
      "html": "<html><head><title>Planning a dental appointment</title><meta name=\\"author\\" content=\\"Demo Editor\\"></head><body><nav>Home | Services | Contact</nav><article><h1>Planning a dental appointment</h1><p>The clinic team explains how routine appointments are organized. Patients can request a convenient time and receive clear preparation instructions. The reception team answers practical questions before each visit. </p><h2>Before your visit</h2><p>The practice team explains how routine appointments are organized. Patients can request a convenient time and receive clear preparation instructions. The reception team answers practical questions before each visit. </p></article><footer>Site navigation</footer></body></html>"
    }
  ],
  "maxPages": 3,
  "minCharacters": 200
}' |
apify call variable_mitts/article-text-markdown-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,variable_mitts/article-text-markdown-extractor"
        }
    }
}
```

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/QPxHEvpr1elXmbJB4/builds/BQRjM9jUzJhVvGtnL/openapi.json
