# Convert a web page to Markdown for LLMs

**Use case:** 

Convert one public HTTPS web page into clean Markdown for an LLM, RAG index or summarizer. This example reads the Wikipedia article on Markdown and returns its title, the main content as Markdown with headings, links, lists and code blocks, character counts and a truncation flag at the 20,000-character budget. Static HTML only: no JavaScript rendering, login or OCR. Replace the URL with your page.

## Input

```json
{
  "url": "https://en.wikipedia.org/wiki/Markdown",
  "format": "markdown",
  "maxChars": 20000
}
```

## Output

```json
{
  "url": {
    "label": "Url",
    "format": "string"
  },
  "status": {
    "label": "Status",
    "format": "string"
  },
  "documentType": {
    "label": "Document type",
    "format": "string"
  },
  "title": {
    "label": "Title",
    "format": "string"
  },
  "outputCharacters": {
    "label": "Output characters",
    "format": "integer"
  },
  "textTruncated": {
    "label": "Text truncated",
    "format": "boolean"
  },
  "pageCount": {
    "label": "Page count",
    "format": "integer"
  },
  "content": {
    "label": "Content",
    "format": "string"
  },
  "warnings": {
    "label": "Warnings",
    "format": "array"
  },
  "error": {
    "label": "Error",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The PDF to Text & HTML to Markdown for LLMs and RAG Actor is ready to run with the inputs already set for "Convert a web page to Markdown for LLMs". [Sign up or log in](https://console.apify.com/create-task-from-example/4qki4xbDrcjefPTOO) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Convert a web page to Markdown for LLMs" task

The PDF to Text & HTML to Markdown for LLMs and RAG Actor will start running based on the input automatically. You can also change all the input fields, like single document url, output format, and more, to match your specific use case.

### 3. Receive the "Convert a web page to Markdown for LLMs" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as url, status, document type, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Convert a web page to Markdown for LLMs" task via API](https://apify.com/textokit/document-to-llm-markdown.md).

## FAQ

### Does it render JavaScript pages?

No. It downloads the static HTML once, without JavaScript rendering, cookies or login. Pages that build their content in the browser can return little or no text.

### What does the Markdown keep from the page?

Headings, links, lists and code blocks from the main content, where extraction supports them. Navigation, scripts and common page furniture are removed. Main-content detection is heuristic, so quality varies by site.

### How much does one web page cost?

USD 0.005 per successfully extracted page. Failed downloads and failed extractions are not charged. The character budget, 20,000 by default and up to 200,000, only limits the returned text.

## About this Actor

This example demonstrates how to use [PDF to Text & HTML to Markdown for LLMs and RAG](https://apify.com/textokit/document-to-llm-markdown.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/textokit/document-to-llm-markdown.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/textokit/document-to-llm-markdown.md

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`).
