# HTML to Markdown Converter

> HTML to Markdown Converter is a paid API for AI agents from x402.agentutility.ai, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-31).

Converts a webpage URL or raw HTML string into clean Markdown text, preserving links and images optionally

## Facts

- Endpoint: POST https://x402.agentutility.ai/html-to-markdown?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/html-to-markdown-converter-b3a580a9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hsCPIQu57jBZ_r4R3EgGF

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 html-to-markdown-converter-b3a580a9 -d '<json body>'
```

Example prompt: Can you fetch the Wikipedia page for Markdown at https://en.wikipedia.org/wiki/Markdown and convert it to Markdown — keep the links but drop the images?

## When to prefer this

Use this endpoint when you need to convert a live webpage or raw HTML into Markdown quickly and cheaply ($0.005/call) without managing a headless browser or HTML parser yourself. Ideal for RAG pipelines, documentation archiving, content ingestion, and any workflow that needs readable structured text from web pages. Prefer this over building custom parsers when you want link/image control and a clean title+body output with no signup friction.

## Known failure modes

- URL is unreachable or returns a non-200 status — conversion fails with fetch error
- Provided URL redirects to a login wall or paywalled content — returns empty or login-page markdown
- Mutually exclusive fields 'url' and 'html' both provided — validation error
- Neither 'url' nor 'html' provided — missing required field error
- HTML is malformed or empty — may return empty or minimal markdown output

## How this service works

817 pay-per-call APIs for AI agents. Every endpoint is POST /<name> and is payable in USDC over x402 on Base and Solana — no signup, no API key, just pay-per-call. GET https://x402.agentutility.ai/ returns the same catalog as machine-readable JSON.

## Output

Returns a JSON object containing the extracted page title, the full Markdown-formatted content, the original source URL, the character count of the original HTML, and the character count of the resulting Markdown.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "properties": {
      "url": {
       "type": "string",
       "description": "Page URL to fetch and convert. Server follows redirects. Mutually exclusive with 'html'."
      },
      "html": {
       "type": "string",
       "description": "Raw HTML to convert. Mutually exclusive with 'url' — supply one."
      },
      "user_agent": {
       "type": "string",
       "description": "Optional User-Agent header sent when fetching 'url'. Default is a generic browser UA."
      },
      "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."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "title": {
       "type": "string"
      },
      "markdown": {
       "type": "string"
      },
      "html_chars": {
       "type": "integer"
      },
      "source_url": {
       "type": "string"
      },
      "markdown_chars": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "title": "Markdown",
  "markdown": "# Markdown\n\nMarkdown is a lightweight markup language...",
  "html_chars": 32418,
  "source_url": "https://en.wikipedia.org/wiki/Markdown",
  "markdown_chars": 5421
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/html-to-markdown-converter-b3a580a9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentutility.ai](https://www.zero.xyz/host/x402.agentutility.ai/llms.txt)
