# url2md

> url2md is a paid API for AI agents from url2md.io, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Converts any URL (static HTML, JavaScript-rendered pages, or PDFs) into clean Markdown text suitable for AI agent consumption

## Facts

- Endpoint: GET https://url2md.io/v1/md
- 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/url2md-8e8669dc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sfa9eyeimCUVP6uiCuLFY

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 url2md-8e8669dc
```

Example prompt: Can you fetch the content of https://en.wikipedia.org/wiki/Markdown and give it to me as clean Markdown so I can process it with my AI?

## When to prefer this

Choose url2md when you need to reliably convert any arbitrary URL — including JavaScript-rendered single-page apps and PDFs — into clean, AI-ready Markdown with a single HTTP call. It is especially valuable when you need structured metadata alongside the text (title, word count, token estimate, timing). Prefer it over general-purpose scrapers when you need consistent Markdown output without HTML noise, and when you need robots.txt-compliant fetching. The per-call USDC micro-payment model via x402 makes it practical for on-demand agent use without subscriptions.

## Known failure modes

- URL is blocked by robots.txt for the url2md user-agent token — returns an error indicating crawl disallowed
- URL is unreachable or times out — returns a fetch error
- JavaScript rendering fails or times out for dynamic pages — may return partial or empty markdown
- Payment via x402 protocol is rejected or underfunded — call is not processed
- URL returns non-HTML/non-PDF content type that cannot be converted — returns a content-type warning or error
- Redirects exceed limits or produce a redirect loop — returns a redirect error

## How this service works

PDFs, JavaScript pages and ordinary HTML as clean Markdown. Pays a page's x402 toll for you. Follows robots.txt.

## Output

A JSON object containing the converted Markdown string, page title, word count, estimated token count, detected language, source type (static/JS-rendered/PDF), fetch and render timing breakdown, charset, final URL after redirects, redirect chain, content type, canonical URL, and any warnings encountered during conversion.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "format": "uri",
       "maxLength": 2048,
       "description": "Absolute http(s) URL to convert; percent-encode it in the query string. http and https only, no credentials in the URL, no private, loopback or internal hosts, and the port must be one Cloudflare proxies (80, 443, 8080, 8443, 8880, 2052/2053/2082/2083/2086/2087/2095/2096). robots.txt is honoured for the user-agent token url2md."
      },
      "format": {
       "enum": [
        "json",
        "markdown"
       ],
       "type": "string",
       "description": "json: the whole result object. markdown: the markdown body alone, sent as text/markdown. Omit it and the format follows the Accept header (text/markdown → markdown), else json."
      },
      "render": {
       "enum": [
        "auto",
        "static",
        "browser"
       ],
       "type": "string",
       "default": "auto",
       "description": "auto: static first, browser only when the page looks client-rendered. static: never use a browser. browser: always render in a headless browser."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "url",
      "finalUrl",
      "source",
      "markdown",
      "words",
      "tokensEstimate",
      "fetchedAt",
      "timing",
      "render",
      "warnings"
     ],
     "properties": {
      "url": {
       "type": "string",
       "description": "the URL as asked for"
      },
      "lang": {
       "type": [
        "string",
        "null"
       ]
      },
      "title": {
       "type": [
        "string",
        "null"
       ],
       "description": "also sent percent-encoded as X-Url2md-Title"
      },
      "words": {
       "type": "integer",
       "description": "also sent as X-Url2md-Words"
      },
      "render": {
       "type": "object",
   
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "url": "https://example.com",
  "lang": null,
  "title": "Example Domain",
  "words": 24,
  "render": {
   "mode": "auto",
   "reasons": [],
   "escalated": false
  },
  "source": "static",
  "timing": {
   "fetchMs": 268,
   "totalMs": 412,
   "renderMs": null,
   "convertMs": 3,
   "browserMsUsed": null
  },
  "charset": "utf-8",
  "finalUrl": "https://example.com/",
  "markdown": "# Example Domain\n\nThis domain is for use in documentation examples without needing permission. Avoid use in operations.\n\n[Learn more](https://iana.org/domains/example)",
  "warnings": [],
  "canonical": null,
  "fetchedAt": "2026-09-06T03:45:14.033Z",
  "redirects": [],
  "contentType": "text/html",
  "description": null,
  "contentSignal": null,
  "tokensEstimate": 42
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/url2md-8e8669dc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from url2md.io](https://www.zero.xyz/host/url2md.io/llms.txt)
