# Web2Markdown: Web Page / PDF to Clean Markdown

> Web2Markdown: Web Page / PDF to Clean Markdown is a paid API for AI agents from lin-desk-x402.lindesk.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-12).

Fetches any public web page or PDF by URL and returns clean, LLM-ready Markdown text with title and metadata, billed per-call via x402.

## Facts

- Endpoint: GET https://lin-desk-x402.lindesk.workers.dev/v1/extract?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/web2markdown-web-page-pdf-to-clean-markdown-18cb792a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DXn9wAbe6iTxXr-ReO4CB

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 web2markdown-web-page-pdf-to-clean-markdown-18cb792a
```

Example prompt: Can you fetch the page at https://en.wikipedia.org/wiki/Large_language_model and give me the content as clean Markdown, keeping the hyperlinks?

## When to prefer this

Choose this endpoint when you need to quickly convert any public HTML page or PDF into clean, LLM-ready Markdown without setting up an API key or managing credentials. It is ideal for AI agent pipelines that need on-demand, pay-per-call web content extraction with no subscription overhead. Prefer it over browser automation tools when you just need readable text content rather than interactive page rendering. The optional Chinese script conversion (OpenCC) and hyperlink preservation make it useful for multilingual or link-aware workflows.

## Known failure modes

- URL is not publicly accessible or behind authentication — returns error
- URL points to unsupported content type (e.g. binary file, video) — empty or error response
- PDF is scanned/image-based with no selectable text — returns empty or minimal Markdown
- Network timeout fetching the remote page — may return error or truncated content
- Malformed or invalid URL provided — request fails with validation error
- Payment not received or x402 flow incomplete — 402 response before extraction occurs

## How this service works

Fetch any public web page or PDF and return clean main-content Markdown for AI agents / LLMs (boilerplate, nav and ads removed) plus title & metadata. CJK-aware; optional Simplified<->Traditional (incl. Hong Kong / Taiwan) conversion. Respects robots.txt. $0.002 per call, USDC on Base (x402). Failed extractions are not charged.

## Output

A JSON object containing the extracted Markdown text ('markdown'), page title ('title'), document type ('kind' e.g. 'html' or 'pdf'), character count ('chars'), the resolved final URL ('final_url'), original URL ('url'), metadata object, a boolean indicating if the content was truncated ('truncated'), applied Chinese conversion setting ('zh'), and processing time in milliseconds ('elapsed_ms').

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "url"
     ],
     "properties": {
      "zh": {
       "enum": [
        "none",
        "s2t",
        "t2s",
        "s2hk",
        "s2tw",
        "hk2s",
        "tw2s"
       ],
       "type": "string",
       "description": "Optional Chinese script conversion (OpenCC). Default none"
      },
      "url": {
       "type": "string",
       "description": "Public http(s) URL of an HTML page, PDF or text file"
      },
      "links": {
       "enum": [
        "0",
        "1"
       ],
       "type": "string",
       "description": "Keep hyperlinks in Markdown (1) or not (0, default)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "zh": {
       "type": "string"
      },
      "url": {
       "type": "string"
      },
      "kind": {
       "type": "string"
      },
      "chars": {
       "type": "integer"
      },
      "title": {
       "type": "string"
      },
      "markdown": {
       "type": "string"
      },
      "metadata": {
       "type": "object"
      },
      "final_url": {
       "type": "string"
      },
      "truncated": {
       "type": "boolean"
      },
      "elapsed_ms": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "zh": "none",
  "url": "https://example.com/",
  "kind": "html",
  "chars": 120,
  "title": "Example Domain",
  "markdown": "This domain is for use in documentation examples...",
  "metadata": {},
  "final_url": "https://example.com/",
  "truncated": false,
  "elapsed_ms": 350
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/web2markdown-web-page-pdf-to-clean-markdown-18cb792a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from lin-desk-x402.lindesk.workers.dev](https://www.zero.xyz/host/lin-desk-x402.lindesk.workers.dev/llms.txt)
