# HTML to Markdown Converter

> HTML to Markdown Converter is a paid API for AI agents from x402-deployer.x402-deployer.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Converts raw HTML or a webpage URL into clean Markdown, stripping boilerplate like navigation, scripts, and ads while preserving semantic content.

## Facts

- Endpoint: POST https://x402-deployer.x402-deployer.workers.dev/convert-html-to-markdown
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-64e3b54f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Z5Wa5ej9G8VCxC6I4uMIF

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-deployer-x402-deployer-workers-dev-64e3b54f -d '<json body>'
```

Example prompt: Convert this HTML page at https://en.wikipedia.org/wiki/Large_language_model into clean Markdown — strip out the nav, ads, and scripts, but keep all the headings, tables, code blocks, and links so I can feed it into my RAG pipeline.

## When to prefer this

Use this endpoint when you need to feed web content into an LLM or vector database and want clean, boilerplate-free Markdown. Ideal for RAG pipelines, LLM context preparation, or any workflow where raw HTML noise would degrade downstream NLP quality. Prefer this over generic scrapers when semantic structure (headings, tables, code blocks) must be preserved in Markdown form.

## Known failure modes

- Invalid or unreachable URL returns an error indicating the page could not be fetched
- Malformed HTML may result in incomplete or garbled Markdown output
- Very large HTML documents may time out or be truncated
- Pages behind authentication or paywalls will fail to fetch
- Rate limiting or payment issues result in HTTP 402 payment required errors

## How this service works

Convert HTML to Markdown. Strips nav, scripts, ads, and other boilerplate. Preserves headings, lists, tables, code blocks, links, and images. Accepts raw HTML or a URL. Returns clean Markdown ideal for LLM context windows or RAG ingestion.

## Output

Returns clean Markdown text derived from the input HTML or URL, with boilerplate (navigation bars, scripts, ads, footers) removed and semantic content (headings, lists, tables, code blocks, links, images) preserved and properly formatted.

## Example request

```json
{
 "input": {
  "body": {
   "html": "<html><head><title>Test Page</title><script>console.log('ad');</script></head><body><nav>Navigation</nav><h1>Main Content</h1><p>This is a test paragraph with a <a href=\"https://example.com\">link</a>.</p><img src=\"test.jpg\" alt=\"test image\"><footer>Footer</footer></body></html>",
   "include_links": true,
   "include_images": true
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 }
}
```

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "properties": {
      "html": {
       "type": "string",
       "description": "Raw HTML to convert. Mutually exclusive with 'url' — supply one."
      },
      "url": {
       "type": "string",
       "description": "Page URL to fetch and convert. Server follows redirects. Mutually exclusive with 'html'."
      },
      "include_links": {
       "type": "boolean",
       "description": "Keep hyperlinks as Markdown [text](href). Default true. Set false for prose-only output."
      },
      "include_images": {
       "type": "boolean",
       "description": "Keep images as Markdown ![alt](src). Default true."
      },
      "user_agent": {
       "type": "string",
       "description": "Optional User-Agent header sent when fetching 'url'. Default is a generic browser UA."
      }
     }
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "source_url": {
       "type": "string"
      },
      "title": {
       "type": "string"
      },
      "markdown": {
       "type": "string"
      },
      "markdown_chars": {
       "type": "integer"
      },
      "html_chars": {
       "type": "integer"
      }
     }
    }
   },
   "required": [
    "type"
   ]
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-64e3b54f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-deployer.x402-deployer.workers.dev](https://www.zero.xyz/host/x402-deployer.x402-deployer.workers.dev/llms.txt)
