SFOLN

Demos / Website to Markdown Crawler (llms.txt)

Keep a support assistant in sync with your help centre

Larkspur sells invoicing software and runs a public help centre that its support team edits every week. The chat assistant on the site answered from a copy of those articles that someone exported by hand months ago, so it kept quoting rules that had changed. Here the help centre itself is the source: every night it is crawled into clean Markdown, one record per article, and only the pages whose text changed are embedded again. The assistant answers from the current text and links the article and section it used.

Workflow

Where the API sits

  1. Trigger

    Nightly schedule

    At 02:00 the schedule starts a crawl of the help centre's host, release notes excluded.

  2. API call

    Crawl to Markdown

    The sitemap is read first, then links. Each article comes back as one record with markdown, title, url, wordCount and tokenEstimate; pages without readable text are listed and not charged.

    sfoln/website-to-markdown

  3. Your logic

    Chunk and index what changed

    The indexer hashes each page's Markdown, splits changed and new pages at their headings and embeds those chunks with the page URL attached.

  4. Result

    Answers with sources

    The assistant retrieves the matching chunks and cites the article and section each statement comes from.

Wired as a schedule with a webhook: an Apify schedule starts the crawl at 02:00, and when the run succeeds a webhook calls the team's indexer with the dataset. The indexer, the vector store and the language model are the team's own; the API delivers the pages. A help centre of 2,000 articles runs the same way with a higher maxPagesPerSite.

Result

The nightly sync and an answer drawn from it

Knowledge syncHelp centrelast run Thu 12 Nov 02:00 · 11 s

Pages in the index

9

6 release notes left out by pattern

Words · tokens

3,349·5,481

31 chunks in the vector index

Changed or new

2

7 chunks embedded, 24 kept

Skipped

1

Status page: no text in the HTML

help.larkspur-billing.example · run of Thu 12 Nov 02:00
PageURL pathFound viaWordsTokensChunksSince last night
Larkspur Help Centre/start961681Unchanged
Refund a payment/billing/refundssitemap1482114Changed: re-embedded
Edit or void a sent invoice/billing/edit-sent-invoicesitemap4126553Unchanged
Accepted payment methods/billing/payment-methodssitemap5389215Unchanged
Payment reminders/billing/payment-reminderssitemap3675833Unchanged
Users and roles/account/users-and-rolessitemap4547424Unchanged
Two-factor authentication/account/two-factorsitemap3014762Unchanged
VAT rates and reverse charge/taxes/vat-ratessitemap6891,1646Unchanged
Export to your accounting software/integrations/accounting-exportlink3445613New: embedded
System status/statuslink———Skippedneeds JavaScript
Run nowNine pages delivered and charged; the skipped page and the summary row cost nothing.
Knowledge syncRefund a paymentChanged148 words

/billing/refunds · markdown

# Refund a payment

You can refund any payment made by card or bank debit, in full or in part, from the invoice it belongs to.

## Time limit

A payment can be refunded up to **90 days** after it was received. After that the refund button is disabled; send the money by bank transfer and record it as a credit note instead.

## How to refund

1. Open the invoice and choose **Payments**.
2. Select the payment and click **Refund**.
3. Enter the amount. Leave it unchanged for a full refund.
4. Add a reason. Your customer sees it on the refund receipt.

## When the money arrives

| Payment method | Usual time |
| --- | --- |
| Card | 5 to 10 business days |
| Bank debit | 3 to 5 business days |

## Fees

The processing fee of the original payment is not returned. Partial refunds can be made several times until the full amount is reached.
 ## Time limit
 
-A payment can be refunded up to **60 days** after it was received.
+A payment can be refunded up to **90 days** after it was received.

The help-centre editor raised the refund window on Wednesday afternoon. The nightly run picked the change up; only this page's four chunks were embedded again.

Support chatlarkspur-billing.exampleThu 12 Nov 09:12
  1. Customer · Halden Print Works

    A client paid the same invoice twice by card about ten weeks ago. Can I still refund one of the payments from Larkspur, and how long until they get the money?
  2. Retrieval · knowledge index

    3 chunks above the relevance threshold, from 3 pages:

    • Refund a payment› Time limithelp.larkspur-billing.example/billing/refunds
    • Refund a payment› When the money arriveshelp.larkspur-billing.example/billing/refunds
    • Users and roles› What each role can dohelp.larkspur-billing.example/account/users-and-roles
  3. Larkspur assistant

    Yes. A payment can be refunded up to 90 days after it was received, and ten weeks is 70 days, so the refund button is still active for about 20 more days.

    1. Open the invoice, choose Payments, select the duplicate payment and click Refund. Leave the amount unchanged for a full refund.

    2. A card refund usually arrives in 5 to 10 business days.

    3. The processing fee of the original payment is not returned.

    4. Refunds need the Owner or Accountant role. If the button is missing, ask your account owner.

    Sourcessynced Thu 12 Nov 02:00

    • Refund a payment› Time limithelp.larkspur-billing.example/billing/refunds
    • Refund a payment› When the money arriveshelp.larkspur-billing.example/billing/refunds
    • Users and roles› What each role can dohelp.larkspur-billing.example/account/users-and-roles
Before Wednesday's edit the article said 60 days. An assistant reading the old export would have refused this refund.

Highlighted values are read from the API response. The data is a sample in the API's real output shape; names and figures are illustrative.

Call

The call behind it

One request with this input produces the 11 records the screen above is drawn from. Prices are the ones on the API page; records that fail or come back empty are not charged.

Input · POST /v2/actors/sfoln~website-to-markdown/run-sync-get-dataset-items
{
  "startUrls": [
    "https://help.larkspur-billing.example"
  ],
  "maxPagesPerSite": 500,
  "crawlScope": "host",
  "excludePatterns": [
    "*/release-notes/*"
  ]
}
First record of 11
Response · record 1 of 11 · sample data
{
  "input": "https://help.larkspur-billing.example",
  "recordType": "page",
  "position": 1,
  "url": "https://help.larkspur-billing.example/",
  "requestedUrl": "https://help.larkspur-billing.example/",
  "title": "Larkspur Help Centre",
  "siteName": "Larkspur Help Centre",
  "description": "Guides for sending invoices, taking payments and managing your Larkspur account.",
  "language": "en",
  "publishedAt": null,
  "canonicalUrl": "https://help.larkspur-billing.example/",
  "depth": 0,
  "discoveredVia": "start",
  "referrer": null,
  "markdown": "# Larkspur Help Centre\n\nGuides for sending invoices, taking payments and managing your account.\n\n## Billing\n\n- [Refund a payment](https://help.larkspur-billing.example/billing/refunds)\n- [Edit or void a sent invoice](https://help.larkspur-billing.example/billing/edit-sent-invoice) …",
  "markdownTruncated": false,
  "wordCount": 96,
  "tokenEstimate": 168,
  "contentStatus": "ok",
  "status": "ok",
  "charged": true,
  "chargedEvent": "crawled-page",
  "source": "website",
  "fetchedAt": "2026-11-12T02:00:03.000Z"
}
Charged eventCountPriceTotal
Crawled page
crawled-page
9$0.0015$0.0135
This run$0.0135

Fields

Which output fields do the work

Output fieldUsed for
markdownThe text that is chunked at its headings and embedded; tables survive as Markdown tables, menus and footers are already removed.
url canonicalUrl titleStored with every chunk and shown as the source link under an answer.
wordCount tokenEstimateSync report and chunk sizing: a page under the chunk limit stays in one piece.
contentStatus status errorPages that could not be read (js_required, blocked) are listed in the sync report instead of silently missing from the index.
discoveredVia depthShows whether an article is in the sitemap or only reachable by a link, which the help-centre editor can fix.
resultsDelivered pagesFailed pagesFiltered stopReasonThe summary row drives the headline numbers and tells a complete crawl (end) from one that hit a limit.
llmsFullTxtOne file with every page's Markdown, kept as the nightly snapshot for comparing versions.

All output fields are listed on the API page.

Build

Build it

The schedule starts the crawl with the input above. When the run succeeds, a webhook calls this handler with the run's dataset ID; it re-indexes only the pages whose Markdown changed. store, embed and splitAtHeadings are your own code.

Node.js · webhook after the nightly run
import { createHash } from 'node:crypto';

export async function onCrawlSucceeded({ resource }) {
  const res = await fetch(`https://api.apify.com/v2/datasets/${resource.defaultDatasetId}/items`, {
    headers: { Authorization: `Bearer ${process.env.APIFY_TOKEN}` },
  });
  const rows = await res.json();
  const summary = rows.find((r) => r.recordType === 'summary');
  if (summary?.stopReason !== 'end') return alertTeam('Help-centre crawl incomplete', summary);

  const seen = new Set();
  for (const page of rows.filter((r) => r.recordType === 'page' && r.contentStatus === 'ok')) {
    seen.add(page.url);
    const hash = createHash('sha256').update(page.markdown).digest('hex');
    if (await store.hashOf(page.url) === hash) continue; // unchanged since last night

    const chunks = splitAtHeadings(page.markdown, { maxTokens: 400 });
    await store.replacePage(page.url, { title: page.title, hash }, await embed(chunks));
  }
  await store.deletePagesNotIn(seen); // articles removed from the help centre
}

// To start a crawl on demand instead of on the schedule:
// POST https://api.apify.com/v2/actors/sfoln~website-to-markdown/runs
  • No browser is used: an article that only appears after JavaScript runs comes back as js_required and is not charged.
  • Start the crawl at the help centre's own address. With crawlScope: "host" the marketing site on the main domain is left out.
  • The crawl is polite by design, at most two requests per second per host, so a large help centre takes minutes, not seconds.

Authentication, the MCP endpoint and the asynchronous variant are on the API page.

More

Other things teams build with it

  • Product documentation for a coding assistant, as Markdown pages or one llms-full.txt file
  • Migrating a blog or docs site to a new CMS with the content as Markdown
  • An internal search over several partner or supplier sites
  • Publishing llms.txt for your own site so AI agents can read it

All demos · Website to Markdown Crawler (llms.txt): prices, input and output · /actors/website-to-markdown.json carries this demo as demo