# Documentation to Markdown & Text (`springlike_meadowland/documentation-content-scraper`) Actor

Convert public documentation and release-note pages into clean Markdown and text for search and RAG workflows. Save one article per page with headings, links, canonical URL, content hash, and fetch time. Bounded same-host crawl with URL-prefix filters.

- **URL**: https://apify.com/springlike\_meadowland/documentation-content-scraper.md
- **Developed by:** [Akshay Aggarwal](https://apify.com/springlike_meadowland) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 saved pages

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

## Documentation to Markdown & Text

Turn public documentation and release-note pages into clean article text and Markdown for search indexes, RAG preparation, and content review. Each saved page includes its source URL, same-host canonical URL, title, heading outline, content hash, links, and fetch time.

### Quick start

```json
{
  "startUrls": [{"url": "https://requests.readthedocs.io/en/latest/user/quickstart/"}],
  "maxPages": 3,
  "maxDepth": 1,
  "includePrefixes": ["https://requests.readthedocs.io/en/latest/user/"],
  "outputFormat": "markdown"
}
```

The dataset contains one row per saved article. A real extraction of the Requests Quickstart page begins:

```json
{
  "url": "https://requests.readthedocs.io/en/latest/user/quickstart/",
  "canonical_url": "https://requests.readthedocs.io/en/latest/user/quickstart/",
  "title": "Quickstart",
  "headings": [
    {"level": 1, "text": "Quickstart", "id": "quickstart"},
    {"level": 2, "text": "Make a Request", "id": "make-a-request"}
  ],
  "text": "Quickstart Eager to get started? This page gives a good introduction in how to get started with Requests. …",
  "markdown": "# Quickstart\n\nEager to get started? This page gives a good introduction in how to get started with Requests. …"
}
```

The complete row also includes a SHA-256 `content_hash`, article `links`, and UTC `fetched_at`. The [preview JSON](examples/requests-quickstart-preview.json) shows representative field values; its content strings and arrays are shortened for readability.

### Inputs and scope

`startUrls` accepts 1–10 public HTTPS documentation pages. `maxPages` defaults to 10 and allows 1–1000 pages across all starts; it counts pages considered, including errors and skips. `maxDepth` defaults to 2, with start pages at depth 0. `includePrefixes` and `excludePrefixes` are optional lists of HTTPS URL prefixes. Crawling stays on each start page's host. Query strings and fragments are removed before page deduplication, so pages whose content depends on a query are outside this product's scope.

The Actor reads server-rendered HTML. It selects the main article body, drops navigation, sidebars, footers, and scripts, and keeps headings, article links, and code blocks. It can process a supplied release-note page as an article. `outputFormat: "text"` saves text while leaving `markdown` empty; the default `markdown` saves both. This is a snapshot of the pages fetched during one run.

Pages that require login, browser rendering, OCR, or a private network are unsupported. Markdown is a readable conversion of common article elements, not a byte-for-byte copy of the site's source. Complex tables and interactive examples may lose layout. Sites may block anonymous requests or change their markup.

### Results, limits, and billing

The dataset contains only successfully extracted pages. `OUTPUT` in the default key-value store reports `fetched`, `saved`, `skipped`, `errors`, `status`, `max_pages`, `max_depth`, `queued_remaining`, and concise per-page errors. A run with page errors may leave a partial dataset. A page cap or spending limit can stop a run before every discovered link is visited. Inspect `OUTPUT` to judge coverage.

The billing unit is one saved page. A page that fails extraction or is skipped is not a result row. The Actor stops adding pages when the configured charge limit is reached. The Apify pricing panel shows the current price before a paid run.

# Actor input Schema

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

One to ten public HTTPS documentation URLs. Crawl stays on each start page's host.

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

Maximum pages considered across all start URLs, including errors and skips.

## `maxDepth` (type: `integer`):

Start pages are depth zero; linked article pages are depth one.

## `includePrefixes` (type: `array`):

Optional public HTTPS URL prefixes to keep the crawl in a documentation path.

## `excludePrefixes` (type: `array`):

Optional public HTTPS URL prefixes to skip.

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

Text is always saved. Text only leaves the markdown field empty.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://requests.readthedocs.io/en/latest/user/quickstart/"
    }
  ],
  "maxPages": 10,
  "maxDepth": 2,
  "outputFormat": "markdown"
}
```

# Actor output Schema

## `results` (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 = {
    "startUrls": [
        {
            "url": "https://requests.readthedocs.io/en/latest/user/quickstart/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("springlike_meadowland/documentation-content-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 = { "startUrls": [{ "url": "https://requests.readthedocs.io/en/latest/user/quickstart/" }] }

# Run the Actor and wait for it to finish
run = client.actor("springlike_meadowland/documentation-content-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 '{
  "startUrls": [
    {
      "url": "https://requests.readthedocs.io/en/latest/user/quickstart/"
    }
  ]
}' |
apify call springlike_meadowland/documentation-content-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,springlike_meadowland/documentation-content-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/dygSg7nCD4JNm9DGj/builds/pirBHrmbHya94awxt/openapi.json
