# agentutility — convert-html-to-markdown

> agentutility — convert-html-to-markdown 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 URL or raw HTML string into clean Markdown text, returning title, markdown content, and character counts.

## Facts

- Endpoint: POST https://x402.agentutility.ai/convert-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/agentutility-convert-html-to-markdown-55d9bfaa
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_eb3cJlhOh6fnjQDhpTy9-

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 agentutility-convert-html-to-markdown-55d9bfaa -d '<json body>'
```

Example prompt: Fetch the page at https://en.wikipedia.org/wiki/Markdown and convert it to clean markdown — keep the links but drop the images.

## When to prefer this

Use this endpoint when you need to convert a live webpage or a raw HTML string into clean, LLM-friendly Markdown — especially for feeding web content into AI pipelines, documentation tools, or summarization workflows. It's ideal when you want configurable control over whether links and images are retained. Prefer this over generic scraping endpoints when you specifically need Markdown output with character-count metadata and no signup or API key overhead.

## Known failure modes

- URL is unreachable or returns a non-200 status — server may return an error or empty markdown
- Mutually exclusive inputs: supplying both 'url' and 'html' simultaneously causes a validation error
- Page behind a login wall or bot protection may return incomplete or empty HTML
- Very large HTML pages may produce oversized markdown responses or time out
- Invalid HTML may produce malformed or unexpected 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 with the page title, full markdown-formatted content, the source URL that was fetched, the original HTML character count, and the resulting markdown character count. Markdown preserves headings, lists, links, and images by default (configurable).

## 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/agentutility-convert-html-to-markdown-55d9bfaa/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)
