# Incremental Documentation to Markdown (`datalantern/docs-incremental-markdown`) Actor

Export added and changed static documentation pages within a permitted directory. Includes source hashes, resumable cursors and explicit incomplete-scan details.

- **URL**: https://apify.com/datalantern/docs-incremental-markdown.md
- **Developed by:** [Data Lantern](https://apify.com/datalantern) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 verified document (changed or unchanged)s

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

## Incremental documentation to Markdown

Use a final public directory (trailing slash) that you own or have permission to export and store. Set rightsConfirmed to true. The Actor reads static pages and follows ordinary links under the same origin and directory. It checks robots rules for every URL, rejects redirects and private addresses, ignores queries and common binaries, and skips recognized access gates. It does not execute scripts, subscribe, log in, or download external images.

The default input shows a fictional project-owned Markdown example without source requests or named result charges. The sample is labelled and its manifest must not be used for a real site.

First live scan: turn off the sample and submit {"sample":false,"rightsConfirmed":true,"rootUrl":"https://your-host.example/docs/","maxPages":25}, substituting your authorized directory. Read Markdown, source URL, change kind, previous hash and SHA-256 in the default dataset. Use OUTPUT.manifest as the baseline for your next *fresh* scan. Unchanged Markdown produces no dataset item. Missing or inaccessible URLs retain their old hashes: this tool does not infer deletions from an incomplete crawl.

If OUTPUT.checkpoint is present, use it with the same rootUrl in a fresh run to finish remaining pages. Do not also send baseline. A complete checkpoint-free OUTPUT is the normal finish. Each slice has its own dataset; combine the slices using changeId. Do not replay old checkpoints or start parallel runs from one checkpoint. Counters in OUTPUT are cumulative within a scan.

An interrupted run retains DOCS_CURSOR in its own key-value store. Re-entering the same run's storage reconciles a pending change only if the dataset row and, when billing is enabled, the named charge count agree. Ambiguous writes stop for review rather than being retried. A fresh run cannot verify another run's pending write.

Limits: 25 visited pages per slice, up to 100 URLs/hashes per scan, ten-second source deadline per page, 128 KiB robots response, 512 KiB HTML page, 64 KiB Markdown result. Pages exceeding the output limit do not replace an older hash. Navigation and sidebars are excluded. Headings, ordinary links, lists and fenced code are supported. Complex layouts, client-rendered content and CSS visibility may need independent review. Markdown preserves source text and links, and should be treated as untrusted document content.

Verified-document pricing: $2 per 1,000 successfully verified document pages. A new, updated or confirmed unchanged document uses one event. Unchanged pages are billable even when no Markdown row is emitted. Directory-only pages, inaccessible or unconfirmed documents, and the fictional example do not receive this event. No start or default dataset-item fee. The fictional example is free; enable live mode only for content you have permission to process and store.

#### Rechecking a directory

For a new scan, copy both `manifest` and `validators` from the same previous output. When the server confirms an ETag with HTTP 304, the scan reuses the page's previously observed in-scope links to find child pages and records one verified-document event for a confirmed unchanged document; a directory index alone is not billable. `revalidated` counts the pages confirmed this way, including directory indexes. Without a usable ETag the page is fetched normally and compared by its Markdown hash. Use an unfinished `checkpoint` on its own to continue a slice. Old hash-only manifests remain valid for a new scan. A change-only checkpoint from a previous private candidate cannot be resumed under this different billing basis; finish it with its original version or start from a completed manifest. The Actor rejects it before source reads rather than silently changing its charges.

Every page remains subject to robots.txt. A 200 robots policy with explicit remaining freshness can be reused for at most 60 seconds in the same run. Private, no-store or varying page responses do not produce reusable records. The HTTP cache is bounded; entries that would exceed the limit fall back to a full fetch. A failed revisit is listed in errors; it does not prove deletion. A scan that finds no changed pages can still use machine time and make HTTP requests.

#### Which previous pages did this scan confirm?

`OUTPUT.coverage.unvisitedManifestUrls` lists saved URLs that have not been visited in this scan so far. `unconfirmedManifestUrls` lists saved URLs that were attempted but could not confirm their previous contents. Their old hashes are preserved. Neither list is a deletion notice. An unfinished slice can still contain pending URLs.

To check saved pages even after a navigation link has been removed, add `"recheckUnlinked": true` when starting a new scan. The Actor first follows current links, then visits outstanding URLs within the same directory and original page and time limits. The checkpoint carries that choice. With the option omitted, no additional URLs are requested. Confirmed unchanged documents receive a verified-document event. Unsuccessful or unconfirmed checks are free.

Each billable document has an individual pending and confirmed receipt. An unchanged-document receipt is reconciled with its named charge before recovery can advance; an unconfirmed charge stops for inspection. Only directory-only or unsuccessful reads are grouped, so a hard interruption can repeat up to four such unbilled steps. Recovery does not repeat a confirmed document fee.

#### Checking the billable results

`OUTPUT.verifications` lists every confirmed document URL, its content hash, added/updated/unchanged kind, source HTTP status (200 or 304) and check time. The list is cumulative across slices of a scan. `OUTPUT.billingEvent` is `verified-document`; `chargedUnits` reports this run's named-event count. A resumed slice may show receipts from earlier slices, while its own charge count covers only this run. The default dataset remains limited to new and changed Markdown (or the labelled fictional example). A malformed conditional response does not earn a fee and does not replace the old hash.

# Actor input Schema

## `sample` (type: `boolean`):

No external requests or verified-document fees. Turn off to submit your authorized directory.

## `rightsConfirmed` (type: `boolean`):

Confirm permission to export and store pages throughout this directory.

## `rootUrl` (type: `string`):

Final public directory URL ending in /.

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

Visit 1–25 pages in this slice.

## `baseline` (type: `object`):

Pass OUTPUT.manifest from a previous completed scan.

## `checkpoint` (type: `object`):

Resume an unfinished scan using OUTPUT.checkpoint.

## `validators` (type: `object`):

Optional: supply OUTPUT.validators together with its matching manifest to revalidate eligible source pages without downloading their bodies.

## `recheckUnlinked` (type: `boolean`):

After following current links, also check in-scope URLs in the submitted manifest that were not reached. This may add source requests. Omit when resuming a checkpoint; it already records the original choice.

## Actor input object example

```json
{
  "sample": true,
  "rightsConfirmed": false,
  "maxPages": 25
}
```

# Actor output Schema

## `rows` (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 = {
    "sample": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("datalantern/docs-incremental-markdown").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 = { "sample": True }

# Run the Actor and wait for it to finish
run = client.actor("datalantern/docs-incremental-markdown").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 '{
  "sample": true
}' |
apify call datalantern/docs-incremental-markdown --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datalantern/docs-incremental-markdown"
        }
    }
}
```

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/qUl98kIUW4qSYxusL/builds/z7cvZeTIXPV3vcTxg/openapi.json
