# Html To Markdown Converter 📄

📄✨ HTML to Markdown Converter transforms web pages into clean, portable Markdown. Simply input a URL to extract content while preserving structure, formatting, and media elements.🔄 Perfect for content repurposing, documentation, and creating readable, platform-independent text from any webpage! 🚀

## Actor Statistics

- Total users: 15
- Monthly users: 4
- Runs succeeded: 100.00%
- Categories: AI, Developer tools, Automation

## Pricing

$10.00/month + usage

## Input Schema

- **startUrls** (type: array): URLs of HTML pages to convert to Markdown

## API example

## Html To Markdown Converter 📄

- **OpenAPI Version:** `3.1.1`
- **API Version:** `0.0`

📄✨ HTML to Markdown Converter transforms web pages into clean, portable Markdown. Simply input a URL to extract content while preserving structure, formatting, and media elements.🔄 Perfect for content repurposing, documentation, and creating readable, platform-independent text from any webpage! 🚀

### Servers

- **URL:** `https://api.apify.com/v2`

### Operations

#### Executes an Actor, waits for its completion, and returns Actor's dataset items in response.

- **Method:** `POST`
- **Path:** `/acts/powerful_bachelor~html-to-markdown-converter/run-sync-get-dataset-items`
- **Tags:** Run Actor

##### Request Body

###### Content-Type: application/json

- **`startUrls`**

  `array` — URLs of HTML pages to convert to Markdown

  **Items:**

  - **`url` (required)**

    `string`, format: `uri`

**Example:**

```
{
  "startUrls": [
    {
      "url": ""
    }
  ]
}
```

##### Responses

###### Status: 200 OK

#### Executes an Actor and returns information about the initiated run in response.

- **Method:** `POST`
- **Path:** `/acts/powerful_bachelor~html-to-markdown-converter/runs`
- **Tags:** Run Actor

##### Request Body

###### Content-Type: application/json

- **`startUrls`**

  `array` — URLs of HTML pages to convert to Markdown

  **Items:**

  - **`url` (required)**

    `string`, format: `uri`

**Example:**

```
{
  "startUrls": [
    {
      "url": ""
    }
  ]
}
```

##### Responses

###### Status: 200 OK

\####### Content-Type: application/json

- **`data`**

  `object`

  - **`actId`**

    `string`

  - **`buildId`**

    `string`

  - **`buildNumber`**

    `string`

  - **`containerUrl`**

    `string`

  - **`defaultDatasetId`**

    `string`

  - **`defaultKeyValueStoreId`**

    `string`

  - **`defaultRequestQueueId`**

    `string`

  - **`finishedAt`**

    `string`, format: `date-time`

  - **`id`**

    `string`

  - **`meta`**

    `object`

    - **`origin`**

      `string`

    - **`userAgent`**

      `string`

  - **`options`**

    `object`

    - **`build`**

      `string`

    - **`diskMbytes`**

      `integer`

    - **`memoryMbytes`**

      `integer`

    - **`timeoutSecs`**

      `integer`

  - **`startedAt`**

    `string`, format: `date-time`

  - **`stats`**

    `object`

    - **`computeUnits`**

      `integer`

    - **`inputBodyLen`**

      `integer`

    - **`rebootCount`**

      `integer`

    - **`restartCount`**

      `integer`

    - **`resurrectCount`**

      `integer`

  - **`status`**

    `string`

  - **`usage`**

    `object`

    - **`ACTOR_COMPUTE_UNITS`**

      `integer`

    - **`DATA_TRANSFER_EXTERNAL_GBYTES`**

      `integer`

    - **`DATA_TRANSFER_INTERNAL_GBYTES`**

      `integer`

    - **`DATASET_READS`**

      `integer`

    - **`DATASET_WRITES`**

      `integer`

    - **`KEY_VALUE_STORE_LISTS`**

      `integer`

    - **`KEY_VALUE_STORE_READS`**

      `integer`

    - **`KEY_VALUE_STORE_WRITES`**

      `integer`

    - **`PROXY_RESIDENTIAL_TRANSFER_GBYTES`**

      `integer`

    - **`PROXY_SERPS`**

      `integer`

    - **`REQUEST_QUEUE_READS`**

      `integer`

    - **`REQUEST_QUEUE_WRITES`**

      `integer`

  - **`usageTotalUsd`**

    `number`

  - **`usageUsd`**

    `object`

    - **`ACTOR_COMPUTE_UNITS`**

      `integer`

    - **`DATA_TRANSFER_EXTERNAL_GBYTES`**

      `integer`

    - **`DATA_TRANSFER_INTERNAL_GBYTES`**

      `integer`

    - **`DATASET_READS`**

      `integer`

    - **`DATASET_WRITES`**

      `integer`

    - **`KEY_VALUE_STORE_LISTS`**

      `integer`

    - **`KEY_VALUE_STORE_READS`**

      `integer`

    - **`KEY_VALUE_STORE_WRITES`**

      `number`

    - **`PROXY_RESIDENTIAL_TRANSFER_GBYTES`**

      `integer`

    - **`PROXY_SERPS`**

      `integer`

    - **`REQUEST_QUEUE_READS`**

      `integer`

    - **`REQUEST_QUEUE_WRITES`**

      `integer`

  - **`userId`**

    `string`

**Example:**

```
{
  "data": {
    "id": "",
    "actId": "",
    "userId": "",
    "startedAt": "2025-01-08T00:00:00.000Z",
    "finishedAt": "2025-01-08T00:00:00.000Z",
    "status": "READY",
    "meta": {
      "origin": "API",
      "userAgent": ""
    },
    "stats": {
      "inputBodyLen": 2000,
      "rebootCount": 0,
      "restartCount": 0,
      "resurrectCount": 0,
      "computeUnits": 0
    },
    "options": {
      "build": "latest",
      "timeoutSecs": 300,
      "memoryMbytes": 1024,
      "diskMbytes": 2048
    },
    "buildId": "",
    "defaultKeyValueStoreId": "",
    "defaultDatasetId": "",
    "defaultRequestQueueId": "",
    "buildNumber": "1.0.0",
    "containerUrl": "",
    "usage": {
      "ACTOR_COMPUTE_UNITS": 0,
      "DATASET_READS": 0,
      "DATASET_WRITES": 0,
      "KEY_VALUE_STORE_READS": 0,
      "KEY_VALUE_STORE_WRITES": 1,
      "KEY_VALUE_STORE_LISTS": 0,
      "REQUEST_QUEUE_READS": 0,
      "REQUEST_QUEUE_WRITES": 0,
      "DATA_TRANSFER_INTERNAL_GBYTES": 0,
      "DATA_TRANSFER_EXTERNAL_GBYTES": 0,
      "PROXY_RESIDENTIAL_TRANSFER_GBYTES": 0,
      "PROXY_SERPS": 0
    },
    "usageTotalUsd": 0.00005,
    "usageUsd": {
      "ACTOR_COMPUTE_UNITS": 0,
      "DATASET_READS": 0,
      "DATASET_WRITES": 0,
      "KEY_VALUE_STORE_READS": 0,
      "KEY_VALUE_STORE_WRITES": 0.00005,
      "KEY_VALUE_STORE_LISTS": 0,
      "REQUEST_QUEUE_READS": 0,
      "REQUEST_QUEUE_WRITES": 0,
      "DATA_TRANSFER_INTERNAL_GBYTES": 0,
      "DATA_TRANSFER_EXTERNAL_GBYTES": 0,
      "PROXY_RESIDENTIAL_TRANSFER_GBYTES": 0,
      "PROXY_SERPS": 0
    }
  }
}
```

#### Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.

- **Method:** `POST`
- **Path:** `/acts/powerful_bachelor~html-to-markdown-converter/run-sync`
- **Tags:** Run Actor

##### Request Body

###### Content-Type: application/json

- **`startUrls`**

  `array` — URLs of HTML pages to convert to Markdown

  **Items:**

  - **`url` (required)**

    `string`, format: `uri`

**Example:**

```
{
  "startUrls": [
    {
      "url": ""
    }
  ]
}
```

##### Responses

###### Status: 200 OK

### Schemas

#### inputSchema

- **Type:**`object`

* **`startUrls`**

  `array` — URLs of HTML pages to convert to Markdown

  **Items:**

  - **`url` (required)**

    `string`, format: `uri`

**Example:**

```
{
  "startUrls": [
    {
      "url": ""
    }
  ]
}
```

#### runsResponseSchema

- **Type:**`object`

* **`data`**

  `object`

  - **`actId`**

    `string`

  - **`buildId`**

    `string`

  - **`buildNumber`**

    `string`

  - **`containerUrl`**

    `string`

  - **`defaultDatasetId`**

    `string`

  - **`defaultKeyValueStoreId`**

    `string`

  - **`defaultRequestQueueId`**

    `string`

  - **`finishedAt`**

    `string`, format: `date-time`

  - **`id`**

    `string`

  - **`meta`**

    `object`

    - **`origin`**

      `string`

    - **`userAgent`**

      `string`

  - **`options`**

    `object`

    - **`build`**

      `string`

    - **`diskMbytes`**

      `integer`

    - **`memoryMbytes`**

      `integer`

    - **`timeoutSecs`**

      `integer`

  - **`startedAt`**

    `string`, format: `date-time`

  - **`stats`**

    `object`

    - **`computeUnits`**

      `integer`

    - **`inputBodyLen`**

      `integer`

    - **`rebootCount`**

      `integer`

    - **`restartCount`**

      `integer`

    - **`resurrectCount`**

      `integer`

  - **`status`**

    `string`

  - **`usage`**

    `object`

    - **`ACTOR_COMPUTE_UNITS`**

      `integer`

    - **`DATA_TRANSFER_EXTERNAL_GBYTES`**

      `integer`

    - **`DATA_TRANSFER_INTERNAL_GBYTES`**

      `integer`

    - **`DATASET_READS`**

      `integer`

    - **`DATASET_WRITES`**

      `integer`

    - **`KEY_VALUE_STORE_LISTS`**

      `integer`

    - **`KEY_VALUE_STORE_READS`**

      `integer`

    - **`KEY_VALUE_STORE_WRITES`**

      `integer`

    - **`PROXY_RESIDENTIAL_TRANSFER_GBYTES`**

      `integer`

    - **`PROXY_SERPS`**

      `integer`

    - **`REQUEST_QUEUE_READS`**

      `integer`

    - **`REQUEST_QUEUE_WRITES`**

      `integer`

  - **`usageTotalUsd`**

    `number`

  - **`usageUsd`**

    `object`

    - **`ACTOR_COMPUTE_UNITS`**

      `integer`

    - **`DATA_TRANSFER_EXTERNAL_GBYTES`**

      `integer`

    - **`DATA_TRANSFER_INTERNAL_GBYTES`**

      `integer`

    - **`DATASET_READS`**

      `integer`

    - **`DATASET_WRITES`**

      `integer`

    - **`KEY_VALUE_STORE_LISTS`**

      `integer`

    - **`KEY_VALUE_STORE_READS`**

      `integer`

    - **`KEY_VALUE_STORE_WRITES`**

      `number`

    - **`PROXY_RESIDENTIAL_TRANSFER_GBYTES`**

      `integer`

    - **`PROXY_SERPS`**

      `integer`

    - **`REQUEST_QUEUE_READS`**

      `integer`

    - **`REQUEST_QUEUE_WRITES`**

      `integer`

  - **`userId`**

    `string`

**Example:**

```
{
  "data": {
    "id": "",
    "actId": "",
    "userId": "",
    "startedAt": "2025-01-08T00:00:00.000Z",
    "finishedAt": "2025-01-08T00:00:00.000Z",
    "status": "READY",
    "meta": {
      "origin": "API",
      "userAgent": ""
    },
    "stats": {
      "inputBodyLen": 2000,
      "rebootCount": 0,
      "restartCount": 0,
      "resurrectCount": 0,
      "computeUnits": 0
    },
    "options": {
      "build": "latest",
      "timeoutSecs": 300,
      "memoryMbytes": 1024,
      "diskMbytes": 2048
    },
    "buildId": "",
    "defaultKeyValueStoreId": "",
    "defaultDatasetId": "",
    "defaultRequestQueueId": "",
    "buildNumber": "1.0.0",
    "containerUrl": "",
    "usage": {
      "ACTOR_COMPUTE_UNITS": 0,
      "DATASET_READS": 0,
      "DATASET_WRITES": 0,
      "KEY_VALUE_STORE_READS": 0,
      "KEY_VALUE_STORE_WRITES": 1,
      "KEY_VALUE_STORE_LISTS": 0,
      "REQUEST_QUEUE_READS": 0,
      "REQUEST_QUEUE_WRITES": 0,
      "DATA_TRANSFER_INTERNAL_GBYTES": 0,
      "DATA_TRANSFER_EXTERNAL_GBYTES": 0,
      "PROXY_RESIDENTIAL_TRANSFER_GBYTES": 0,
      "PROXY_SERPS": 0
    },
    "usageTotalUsd": 0.00005,
    "usageUsd": {
      "ACTOR_COMPUTE_UNITS": 0,
      "DATASET_READS": 0,
      "DATASET_WRITES": 0,
      "KEY_VALUE_STORE_READS": 0,
      "KEY_VALUE_STORE_WRITES": 0.00005,
      "KEY_VALUE_STORE_LISTS": 0,
      "REQUEST_QUEUE_READS": 0,
      "REQUEST_QUEUE_WRITES": 0,
      "DATA_TRANSFER_INTERNAL_GBYTES": 0,
      "DATA_TRANSFER_EXTERNAL_GBYTES": 0,
      "PROXY_RESIDENTIAL_TRANSFER_GBYTES": 0,
      "PROXY_SERPS": 0
    }
  }
}
```

## 📄 HTML to Markdown Converter

The HTML to Markdown Converter is a powerful tool that transforms any HTML webpage into clean, well-formatted Markdown. Simply provide the URL of the webpage you want to convert, and this actor will extract the content, process it intelligently, and deliver a polished Markdown file that preserves the structure and meaning of the original content.

### 🔄 Markdown Conversion Features

The HTML to Markdown Converter handles various HTML elements with specialized rules:

- **Headings**: Converts h1-h6 tags to equivalent Markdown headings
- **Lists**: Preserves ordered and unordered lists with proper formatting
- **Tables**: Maintains table structure with column alignment
- **Code Blocks**: Preserves code blocks with language syntax highlighting
- **Images**: Converts images with alt text and absolute URLs
- **Links**: Ensures all links are properly formatted with absolute URLs
- **Emphasis**: Preserves bold, italic, and other text formatting
- **Blockquotes**: Maintains blockquote formatting
- **Media Elements**: Creates Markdown-friendly references for videos, audio, and other media
- **Interactive Elements**: Provides descriptive text for forms, buttons, and other interactive components

### 🤔 Why convert HTML to Markdown?

Converting HTML to Markdown offers numerous benefits:

- 📝 **Simplicity**: Transform complex HTML into clean, readable text
- 🔄 **Portability**: Use the content across different platforms and tools
- 📊 **Content Focus**: Strip away unnecessary styling and scripts
- 🖋️ **Easy Editing**: Modify content in any text editor without HTML knowledge
- 📚 **Documentation**: Create documentation from existing web content
- 📱 **Accessibility**: Improve content readability for screen readers and assistive technologies

### 🚀 Main Features

HTML to Markdown Converter includes powerful features to ensure high-quality conversions:

- **Smart Content Extraction**: Automatically identifies and extracts the main content from webpages
- **Relative URL Resolution**: Converts all relative URLs to absolute URLs for proper linking
- **Table Support**: Preserves table structures with proper Markdown formatting
- **Code Block Preservation**: Maintains code blocks with language syntax highlighting
- **Image Handling**: Converts images with proper alt text and source URLs
- **Video & Media Embedding**: Creates Markdown-friendly references for videos and embedded content
- **Interactive Element Conversion**: Transforms buttons, forms, and other interactive elements
- **Social Media Embed Handling**: Properly references social media posts from platforms like Twitter/X, Instagram, etc.
- **Custom Styling Rules**: Applies consistent formatting for headings, lists, emphasis, and more

### 🛠️ How to use the HTML to Markdown Converter

Using the HTML to Markdown Converter is straightforward:

1. 🔑 Create a free Apify account (if you don't have one)
2. 🔍 Open the HTML to Markdown Converter actor
3. ✏️ Enter the URL(s) of the webpage(s) you want to convert
4. 🚀 Click "Save & Start" and wait for the conversion to complete
5. 💾 Download your Markdown files or access them via the provided links

### 📈 How many pages can you convert?

The converter can process multiple pages in a single run. The number of pages you can convert depends on your Apify subscription plan and the complexity of the webpages. For large-scale conversion projects, consider using a higher-tier plan.

### ⚖️ Is it legal to convert webpages to Markdown?

The converter only processes publicly available content and transforms it into a different format. However, be mindful of copyright restrictions when using the converted content, especially for commercial purposes. Always respect the original content's terms of use and attribution requirements.

### 📝 Input parameters

The actor accepts a JSON array of objects, each containing a `url` property.

Example input:

```json
{
    "startUrls": [
        {
            "url": "https://example.com/page-to-convert"
        },
        {
            "url": "https://another-example.com/another-page"
        }
    ]
}
```

### Output Example

The actor provides detailed information about each processed URL:

````json
{
"url": "https://example.com/page-to-convert",
"markdown": "https://api.apify.com/v2/key-value-stores/markdown-store/records/example.com.md",
"title": "Example Page Title",
"fileName": "example.com.md",
"htmlLength": 45678,
"markdownLength": 12345,
"error": null,
"success": true,
"processedAt": "2023-09-15T14:25:30.000Z"
}```
````

### 🚀 Unlock Content Flexibility

HTML to Markdown Converter is an essential tool for content creators, developers, and anyone who needs to repurpose web content. Whether you're creating documentation, preparing content for a CMS, or archiving web pages in a more readable format, this converter offers a comprehensive and efficient solution. If you have any feedback or run into issues, please don't hesitate to reach out through the Actor's Issues tab in the Apify Console. Happy converting! 🎉
