# Markdown to HTML Converter - GitHub-Flavored (`maximedupre/markdown-to-html-converter`) Actor

Convert Markdown text or public Markdown URLs into embeddable HTML fragments or complete HTML documents. Get generated HTML, a download link, heading anchors, a document outline, and rendering choices in your dataset.

- **URL**: https://apify.com/maximedupre/markdown-to-html-converter.md
- **Developed by:** [Maxime Dupré](https://apify.com/maximedupre) (community)
- **Categories:** Developer tools, AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.01 / 1,000 html conversions

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

### 📝 Markdown to HTML for docs and pages

Developers, docs teams, and automation builders can turn Markdown into an embeddable HTML fragment or a complete HTML document. Submit Markdown text or a public Markdown URL and get generated HTML, a download link, heading anchors, a document outline, and rendering choices in your dataset.

**Try these workflows**

- Turn Markdown text into an embeddable HTML fragment with **[Markdown to HTML Converter](https://apify.com/maximedupre/markdown-to-html-converter/examples/markdown-to-html-converter)**.
- Convert a public GitHub Markdown file into HTML with **[GitHub Markdown to HTML](https://apify.com/maximedupre/markdown-to-html-converter/examples/github-markdown-to-html)**.
- Build a standalone HTML page with a title and CSS using **[Markdown to HTML with CSS](https://apify.com/maximedupre/markdown-to-html-converter/examples/markdown-to-html-with-css)**.
- Create a complete HTML document from Markdown with **[Markdown to HTML Document](https://apify.com/maximedupre/markdown-to-html-converter/examples/markdown-to-html-document)**.
- Convert a public Markdown file URL into HTML with **[Markdown URL to HTML](https://apify.com/maximedupre/markdown-to-html-converter/examples/markdown-url-to-html)**.

#### 📦 HTML conversion results

Each successful conversion is saved as one dataset row. The row keeps the submitted source, generated HTML, a downloadable HTML file, the heading outline, content sizes, and the rendering choices used for that conversion. URL sources also include the final URL after redirects.

#### ▶️ Choose a Markdown source and result

1. Choose whether to use Markdown documents or public Markdown URLs.
2. Choose an embeddable fragment or a standalone HTML document.
3. Fill the matching source field. For a URL choice, use a public URL that returns Markdown.
4. Set the optional title, theme, CSS, Markdown dialect, or code highlighting options.
5. Run the Actor and open the default dataset to view the HTML and its metadata.

#### ⚙️ Input

The input form lets you choose the source type and the HTML shape. Fields that do not match your result type are ignored.

**Input fields**

| Field | Type | What it does |
| --- | --- | --- |
| `resultType` | string | Chooses Markdown documents or public Markdown URLs, and an embeddable fragment or standalone HTML document. |
| `markdownDocuments` | array of strings | One or more Markdown documents for the two Markdown content choices. Each item creates one result. Ignored for URL choices. |
| `markdownDocuments[]` | string | One Markdown document. |
| `markdownUrls` | array of objects | One or more public URLs that return Markdown for the two URL choices. Each item creates one result. Ignored for Markdown choices. |
| `markdownUrls[].url` | string | One public URL that returns Markdown. |
| `documentTitle` | string | Sets the title of a standalone HTML document. Ignored for fragments. |
| `presentationTheme` | string | Chooses the built-in theme or an unstyled standalone document. Ignored for fragments. |
| `customCss` | string | Adds CSS to a standalone document. Leave it empty to use only the selected theme. Ignored for fragments. |
| `markdownDialect` | string | Chooses GitHub-Flavored Markdown or standard Markdown behavior. |
| `syntaxHighlighting` | boolean | Highlights fenced code blocks when a language is supplied. |

**Input example**

This example is copied from the successful default-input QA run:

```json
{
  "resultType": "markdownFragment",
  "markdownDocuments": [
    "# Hello\n\nThis is a Markdown document."
  ],
  "presentationTheme": "default",
  "markdownDialect": "github",
  "syntaxHighlighting": false
}
```

#### 🧾 Output

The tables below cover the four output shapes defined by the public dataset schema. A genuine current-beta row follows each shape when one is available.

**Markdown source to an embeddable fragment**

| Field | Type | What it does |
| --- | --- | --- |
| `source` | object | Describes the submitted Markdown source. |
| `source.type` | string | Source type, `markdown`. |
| `source.value` | string | Submitted Markdown content. |
| `html` | string | Generated embeddable HTML fragment. |
| `downloadUrl` | string | Apify storage URL for the generated HTML file. |
| `outline` | array | Headings in document order. |
| `outline[].level` | number | Heading level from 1 to 6. |
| `outline[].text` | string | Visible heading text. |
| `outline[].anchor` | string | Unique anchor used to link to the heading. |
| `contentSize` | object | Measured source and HTML sizes. |
| `contentSize.sourceBytes` | number | Size of the source content in bytes. |
| `contentSize.htmlBytes` | number | Size of the generated HTML in bytes. |
| `rendering` | object | Rendering choices used for the conversion. |
| `rendering.format` | string | HTML shape, `fragment`. |
| `rendering.markdownDialect` | string | Markdown behavior used, `github` or `standard`. |
| `rendering.syntaxHighlighting` | boolean | Whether code highlighting was enabled. |

**Genuine current-beta row**

```json
{
  "source": {
    "type": "markdown",
    "value": "# Hello\n\nThis is a Markdown document."
  },
  "html": "<h1 id=\"hello\"><a class=\"anchor\" href=\"#hello\">#</a>Hello</h1>\n<p>This is a Markdown document.</p>\n",
  "outline": [
    {
      "level": 1,
      "text": "Hello",
      "anchor": "hello"
    }
  ],
  "rendering": {
    "format": "fragment",
    "markdownDialect": "github",
    "syntaxHighlighting": false
  },
  "contentSize": {
    "sourceBytes": 37,
    "htmlBytes": 99
  },
  "downloadUrl": "https://api.apify.com/v2/key-value-stores/ID7HbRGxi1c8mmIrb/records/markdown-1-5a516c8638953a14.html?signature=zDUriazGvtf3sYOHILaT"
}
```

**Public Markdown URL to an embeddable fragment**

| Field | Type | What it does |
| --- | --- | --- |
| `source` | object | Describes the public Markdown URL. |
| `source.type` | string | Source type, `url`. |
| `source.value` | string | Submitted public Markdown URL. |
| `source.finalUrl` | string | URL reached after redirects. |
| `html` | string | Generated embeddable HTML fragment. |
| `downloadUrl` | string | Apify storage URL for the generated HTML file. |
| `outline` | array | Headings in document order. |
| `outline[].level` | number | Heading level from 1 to 6. |
| `outline[].text` | string | Visible heading text. |
| `outline[].anchor` | string | Unique anchor used to link to the heading. |
| `contentSize` | object | Measured source and HTML sizes. |
| `contentSize.sourceBytes` | number | Size of the source content in bytes. |
| `contentSize.htmlBytes` | number | Size of the generated HTML in bytes. |
| `rendering` | object | Rendering choices used for the conversion. |
| `rendering.format` | string | HTML shape, `fragment`. |
| `rendering.markdownDialect` | string | Markdown behavior used, `github` or `standard`. |
| `rendering.syntaxHighlighting` | boolean | Whether code highlighting was enabled. |

**Genuine current-beta row**

```json
{
  "source": {
    "type": "url",
    "value": "https://raw.githubusercontent.com/markedjs/marked/master/README.md",
    "finalUrl": "https://raw.githubusercontent.com/markedjs/marked/master/README.md"
  },
  "html": "<a href=\"https://marked.js.org\">\n  \n</a>\n\n<h1 id=\"marked\"><a class=\"anchor\" href=\"#marked\">#</a>Marked</h1>\n<p><a href=\"https://www.npmjs.com/package/marked\"></a>\n<a href=\"https://packagephobia.now.sh/result?p=marked\"></a>\n<a href=\"https://www.npmjs.com/package/marked\"></a>\n<a href=\"https://github.com/markedjs/marked/actions\"></a>\n<a href=\"https://snyk.io/test/npm/marked\"></a>\n<a href=\"https://inspect.software/software/markedjs/marked\"></a></p>\n<ul>\n<li>⚡ built for speed</li>\n<li>⬇️ low-level compiler for parsing markdown without caching or blocking for long periods of time</li>\n<li>⚖️ light-weight while implementing all markdown features from the supported flavors &amp; specifications</li>\n<li>🛠️ easily adaptable with <a href=\"https://marked.js.org/using_advanced#extensions\">custom extensions</a></li>\n<li>🌐 works in a browser, on a server, or from a command line interface (CLI)</li>\n</ul>\n<h2 id=\"demo\"><a class=\"anchor\" href=\"#demo\">#</a>Demo</h2>\n<p>Check out the <a href=\"https://marked.js.org/demo/\">demo page</a> to see Marked in action ⛹️</p>\n<h2 id=\"docs\"><a class=\"anchor\" href=\"#docs\">#</a>Docs</h2>\n<p>Our <a href=\"https://marked.js.org\">documentation pages</a> are also rendered using marked 💯</p>\n<p>Also read about:</p>\n<ul>\n<li><a href=\"https://marked.js.org/using_advanced\">Options</a></li>\n<li><a href=\"https://marked.js.org/using_pro\">Extensibility</a></li>\n</ul>\n<h2 id=\"compatibility\"><a class=\"anchor\" href=\"#compatibility\">#</a>Compatibility</h2>\n<p><strong>Node.js:</strong> Only <a href=\"https://nodejs.org/en/about/releases/\">current and LTS</a> Node.js versions are supported. End of life Node.js versions may become incompatible with Marked at any point in time.</p>\n<p><strong>Browser:</strong> <a href=\"https://developer.mozilla.org/en-US/docs/Glossary/Baseline/Compatibility\">Baseline Widely Available</a></p>\n<h2 id=\"installation\"><a class=\"anchor\" href=\"#installation\">#</a>Installation</h2>\n<p><strong>CLI:</strong></p>\n<pre><code class=\"language-sh\">npm install -g marked</code></pre>\n<p><strong>In-browser:</strong></p>\n<pre><code class=\"language-sh\">npm install marked</code></pre>\n<h2 id=\"usage\"><a class=\"anchor\" href=\"#usage\">#</a>Usage</h2>\n<h3 id=\"warning-marked-does-not-sanitize-the-output-html-please-use-a-sanitize-library-like-dompurify-recommended-sanitize-html-or-insane-on-the-output-html\"><a class=\"anchor\" href=\"#warning-marked-does-not-sanitize-the-output-html-please-use-a-sanitize-library-like-dompurify-recommended-sanitize-html-or-insane-on-the-output-html\">#</a>Warning: 🚨 Marked does not <a href=\"https://marked.js.org/using_advanced#options\">sanitize</a> the output HTML. Please use a sanitize library, like <a href=\"https://github.com/cure53/DOMPurify\">DOMPurify</a> (recommended), <a href=\"https://github.com/apostrophecms/sanitize-html\">sanitize-html</a> or <a href=\"https://github.com/bevacqua/insane\">insane</a> on the <em>output</em> HTML! 🚨</h3>\n<pre><code>DOMPurify.sanitize(marked.parse(`&lt;img src=\"x\" onerror=\"alert('not happening')\"&gt;`));</code></pre>\n<p><strong>CLI</strong></p>\n<pre><code class=\"language-bash\"># Example with stdin input\n$ marked -o hello.html\nhello world\n^D\n$ cat hello.html\n&lt;p&gt;hello world&lt;/p&gt;</code></pre>\n<pre><code class=\"language-bash\"># Print all options\n$ marked --help</code></pre>\n<p><strong>Node.js</strong></p>\n<pre><code class=\"language-js\">import { marked } from 'marked';\nconst html = marked.parse('# Marked in Node.js');\nconsole.log(html);</code></pre>\n<p><strong>Browser</strong></p>\n<pre><code class=\"language-html\">&lt;!doctype html&gt;\n&lt;html&gt;\n&lt;head&gt;\n  &lt;meta charset=\"utf-8\"/&gt;\n  &lt;title&gt;Marked in the browser&lt;/title&gt;\n&lt;/head&gt;\n&lt;body&gt;\n  &lt;div id=\"content\"&gt;&lt;/div&gt;\n  &lt;script src=\"https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js\"&gt;&lt;/script&gt;\n  &lt;script&gt;\n    document.getElementById('content').innerHTML =\n      marked.parse('# Marked in the browser\\n\\nRendered by **marked**.');\n  &lt;/script&gt;\n&lt;/body&gt;\n&lt;/html&gt;</code></pre>\n<p>or import esm module</p>\n<pre><code class=\"language-html\">&lt;script type=\"module\"&gt;\n  import { marked } from \"https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js\";\n  document.getElementById('content').innerHTML =\n    marked.parse('# Marked in the browser\\n\\nRendered by **marked**.');\n&lt;/script&gt;</code></pre>\n<h2 id=\"license\"><a class=\"anchor\" href=\"#license\">#</a>License</h2>\n<p>Copyright (c) 2018+, MarkedJS. (MIT License)\nCopyright (c) 2011-2018, Christopher Jeffrey. (MIT License)</p>\n",
  "outline": [
    {
      "level": 1,
      "text": "Marked",
      "anchor": "marked"
    },
    {
      "level": 2,
      "text": "Demo",
      "anchor": "demo"
    },
    {
      "level": 2,
      "text": "Docs",
      "anchor": "docs"
    },
    {
      "level": 2,
      "text": "Compatibility",
      "anchor": "compatibility"
    },
    {
      "level": 2,
      "text": "Installation",
      "anchor": "installation"
    },
    {
      "level": 2,
      "text": "Usage",
      "anchor": "usage"
    },
    {
      "level": 3,
      "text": "Warning: 🚨 Marked does not sanitize the output HTML. Please use a sanitize library, like DOMPurify (recommended), sanitize-html or insane on the output HTML! 🚨",
      "anchor": "warning-marked-does-not-sanitize-the-output-html-please-use-a-sanitize-library-like-dompurify-recommended-sanitize-html-or-insane-on-the-output-html"
    },
    {
      "level": 2,
      "text": "License",
      "anchor": "license"
    }
  ],
  "rendering": {
    "format": "fragment",
    "markdownDialect": "github",
    "syntaxHighlighting": false
  },
  "contentSize": {
    "sourceBytes": 3505,
    "htmlBytes": 4575
  },
  "downloadUrl": "https://api.apify.com/v2/key-value-stores/YEPnlSehV9CYlBiZE/records/markdown-1-8cd8d17725a79216.html?signature=O9Q1g6hw1xzdnpmQ66S1"
}
```

**Markdown source to a standalone HTML document**

| Field | Type | What it does |
| --- | --- | --- |
| `source` | object | Describes the submitted Markdown source. |
| `source.type` | string | Source type, `markdown`. |
| `source.value` | string | Submitted Markdown content. |
| `html` | string | Generated complete HTML document. |
| `downloadUrl` | string | Apify storage URL for the generated HTML file. |
| `outline` | array | Headings in document order. |
| `outline[].level` | number | Heading level from 1 to 6. |
| `outline[].text` | string | Visible heading text. |
| `outline[].anchor` | string | Unique anchor used to link to the heading. |
| `contentSize` | object | Measured source and HTML sizes. |
| `contentSize.sourceBytes` | number | Size of the source content in bytes. |
| `contentSize.htmlBytes` | number | Size of the generated HTML in bytes. |
| `rendering` | object | Rendering choices used for the conversion. |
| `rendering.format` | string | HTML shape, `document`. |
| `rendering.markdownDialect` | string | Markdown behavior used, `github` or `standard`. |
| `rendering.syntaxHighlighting` | boolean | Whether code highlighting was enabled. |
| `rendering.presentationTheme` | string | Built-in theme or `unstyled` presentation. |
| `rendering.documentTitle` | string | Title set for the complete document when supplied. |
| `rendering.customCssApplied` | boolean | Whether custom CSS was added to the document. |

**Genuine current-beta row**

````json
{
  "source": {
    "type": "markdown",
    "value": "# Styled Guide\n\nA complete document with a fenced code example.\n\n```js\nconst answer = 42;\n```"
  },
  "html": "<!doctype html>\n<html lang=\"en\"><head><meta charset=\"utf-8\"><title>Markdown Guide</title><style>body { color: #333; }</style></head><body><h1 id=\"styled-guide\"><a class=\"anchor\" href=\"#styled-guide\">#</a>Styled Guide</h1>\n<p>A complete document with a fenced code example.</p>\n<pre><code class=\"language-js\">const answer = 42;</code></pre>\n</body></html>",
  "outline": [
    {
      "level": 1,
      "text": "Styled Guide",
      "anchor": "styled-guide"
    }
  ],
  "rendering": {
    "format": "document",
    "markdownDialect": "github",
    "syntaxHighlighting": false,
    "presentationTheme": "unstyled",
    "documentTitle": "Markdown Guide",
    "customCssApplied": true
  },
  "contentSize": {
    "sourceBytes": 93,
    "htmlBytes": 354
  },
  "downloadUrl": "https://api.apify.com/v2/key-value-stores/djgepJZN7SoeKeHfz/records/markdown-1-0791a98650d1ca3b.html?signature=3AEyKcwirCKshOPXU6gX"
}
````

**Public Markdown URL to a standalone HTML document**

| Field | Type | What it does |
| --- | --- | --- |
| `source` | object | Describes the public Markdown URL. |
| `source.type` | string | Source type, `url`. |
| `source.value` | string | Submitted public Markdown URL. |
| `source.finalUrl` | string | URL reached after redirects. |
| `html` | string | Generated complete HTML document. |
| `downloadUrl` | string | Apify storage URL for the generated HTML file. |
| `outline` | array | Headings in document order. |
| `outline[].level` | number | Heading level from 1 to 6. |
| `outline[].text` | string | Visible heading text. |
| `outline[].anchor` | string | Unique anchor used to link to the heading. |
| `contentSize` | object | Measured source and HTML sizes. |
| `contentSize.sourceBytes` | number | Size of the source content in bytes. |
| `contentSize.htmlBytes` | number | Size of the generated HTML in bytes. |
| `rendering` | object | Rendering choices used for the conversion. |
| `rendering.format` | string | HTML shape, `document`. |
| `rendering.markdownDialect` | string | Markdown behavior used, `github` or `standard`. |
| `rendering.syntaxHighlighting` | boolean | Whether code highlighting was enabled. |
| `rendering.presentationTheme` | string | Built-in theme or `unstyled` presentation. |
| `rendering.documentTitle` | string | Title set for the complete document when supplied. |
| `rendering.customCssApplied` | boolean | Whether custom CSS was added to the document. |

#### 💳 Pricing

**Pricing event**

The `markdown-to-html-conversion` event is charged once for each Markdown document successfully converted to HTML. Failed conversions are not charged. The current event price is shown in the Apify pricing panel.

#### 🔌 Integrations

Use the Apify dataset, API, schedules, webhooks, and standard exports to pass generated HTML to another step.

https://www.youtube.com/watch?v=bNACk1\_S\_6w\&list=PLObrtcm1Kw6MUrlLNDbK9QRg8VDJg0gOW\&index=4

#### ❓ FAQ

##### Can I convert a Markdown file from a URL?

Yes. Choose a public URL option and submit a URL that returns Markdown. The output keeps the submitted URL and the final URL after redirects. Login-gated or private URLs are outside the scope of this Actor.

##### What is the difference between a fragment and a document?

A fragment is ready to place inside an existing page. A standalone document includes the HTML document structure and can use a title, a built-in theme or an unstyled presentation, and custom CSS.

##### Does the output include heading links?

Yes. Each heading in the HTML gets a unique anchor, and `outline` lists its level, text, and anchor. Repeated headings get unique anchors.

##### Does it sanitize unsafe Markdown HTML?

Unsafe raw HTML and scriptable content are sanitized by default. This is not an audited security boundary for hostile anonymous content, so add your own sanitizer and content security policy when needed.

##### Can I highlight code?

Yes. Turn on Syntax highlighting. The setting is recorded in `rendering.syntaxHighlighting`.

##### Can I convert an ordinary HTML page or a private URL?

No. The URL choices are for public URLs that return Markdown. This Actor does not render browser pages or log in to private sites.

##### How is pricing counted?

One event covers each Markdown document successfully converted to HTML. Failed conversions are not charged.

### 📝 Changelog

**v0.0** (26-09-2026)

- Initial release.

### 🆘 Support

For issues, questions, or feature requests, [file a ticket](https://console.apify.com/actors/maximedupre~markdown-to-html-converter/issues) and I'll fix or implement it in less than 24h 🫡

### 🔗 Related Actors

- [Markdownify MCP Server](https://apify.com/maximedupre/markdownify-mcp-server): Convert public webpage URLs to Markdown before sending selected content to this Actor.
- [Webpage Text Extractor](https://apify.com/maximedupre/webpage-text-extractor): Extract readable Markdown from a public page before converting or reviewing it.
- [Readability Analyzer](https://apify.com/maximedupre/readability-analyzer): Check the text in a converted document for reading difficulty after the HTML run.
- [Markdown to HTML Converter - GitHub-Flavored, Safe](https://apify.com/eliai/markdown-to-html): Compare another hosted Markdown-to-HTML workflow when you need GitHub-Flavored output.
- [Markdown to HTML Converter — Bulk](https://apify.com/hipersoft/markdown-to-html): Compare a bulk Markdown-to-HTML workflow when you need to process multiple Markdown inputs.

**Made with ❤️ by Maxime Dupré**

# Actor input Schema

## `resultType` (type: `string`):

Choose whether to use Markdown documents or public Markdown URLs, and whether to create an embeddable fragment or a standalone HTML document. Each choice reads one or more items from its matching source field.

## `markdownDocuments` (type: `array`):

For `Embeddable fragment from Markdown content` and `Standalone HTML document from Markdown content`, enter one or more Markdown documents. Each item creates one result. This field is ignored for public URL choices.

## `markdownUrls` (type: `array`):

For `Embeddable fragment from a public URL` and `Standalone HTML document from a public URL`, enter one or more public URLs that return Markdown. Each URL creates one result. This field is ignored for Markdown content choices.

## `documentTitle` (type: `string`):

For the two standalone HTML document choices, set the title shown in the document. This field is ignored for embeddable fragment choices.

## `presentationTheme` (type: `string`):

For the two standalone HTML document choices, choose the built-in theme or leave the document unstyled. This field is ignored for embeddable fragment choices.

## `customCss` (type: `string`):

For the two standalone HTML document choices, add CSS to a styled document. Leave this blank to use only the selected theme. This field is ignored for embeddable fragment choices.

## `markdownDialect` (type: `string`):

Choose GitHub-Flavored Markdown or standard Markdown.

## `syntaxHighlighting` (type: `boolean`):

Highlight fenced code blocks when a language is provided.

## Actor input object example

```json
{
  "resultType": "markdownFragment",
  "markdownDocuments": [
    "# Hello\n\nThis is a Markdown document."
  ],
  "presentationTheme": "default",
  "markdownDialect": "github",
  "syntaxHighlighting": false
}
```

# Actor output Schema

## `results` (type: `string`):

Open the generated HTML conversion results in the default dataset.

# 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 = {
    "resultType": "markdownFragment",
    "markdownDocuments": [
        "# Hello\n\nThis is a Markdown document."
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/markdown-to-html-converter").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 = {
    "resultType": "markdownFragment",
    "markdownDocuments": ["""# Hello

This is a Markdown document."""],
}

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/markdown-to-html-converter").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 '{
  "resultType": "markdownFragment",
  "markdownDocuments": [
    "# Hello\\n\\nThis is a Markdown document."
  ]
}' |
apify call maximedupre/markdown-to-html-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,maximedupre/markdown-to-html-converter"
        }
    }
}
```

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/CM26sIJjfoPiNGe3a/builds/hjNSvIGVefPfPP4kv/openapi.json
