# AgentWork Web Contents — URL to Markdown

> AgentWork Web Contents — URL to Markdown is a paid API for AI agents from api.agentwork.run, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-29).

Fetches a public URL and returns its content as clean markdown (with JavaScript rendering support), priced per-call via x402 USDC on Base.

## Facts

- Endpoint: GET https://api.agentwork.run/v1/web/contents?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentwork-web-contents-url-to-markdown-746d5783
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-0RcUuR95-AWkpC9VXkSd

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 agentwork-web-contents-url-to-markdown-746d5783
```

Example prompt: Can you fetch the content of https://example.com/article and return it as markdown so I can read it?

## When to prefer this

Choose this endpoint when you need to fetch and convert a live public webpage into clean markdown or plain text for LLM consumption, especially when JavaScript rendering is required. Prefer it over generic scraping services when you want per-call micropayment pricing via x402 USDC with no API key setup, and when you need a content hash for change detection or deduplication downstream.

## Known failure modes

- URL is unreachable or returns non-200 HTTP status — result entry has ok:false
- URL points to non-HTML content that cannot be rendered as markdown
- JavaScript rendering times out for complex single-page apps
- Malformed or invalid URL input causes schema validation error
- Insufficient USDC balance causes x402 payment failure before the call completes

## How this service works

Web read / URL to markdown (batch, JavaScript rendering), PDF text extraction, website change monitoring, prompt-injection check and sanctions screening for agents. From $0.001 per call on Base. x402 USDC, no API key.

## Output

Returns a JSON object with ok status, result count, format used, and an array of results — each containing the URL, page title, full markdown (or plain text) content, and a SHA-256 hash of that content. Also reports how many URLs succeeded, failed, and were charged.

## 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",
     "properties": {
      "url": {
       "type": "string",
       "format": "uri",
       "maxLength": 2048
      },
      "format": {
       "enum": [
        "markdown",
        "text"
       ],
       "type": "string"
      },
      "max_chars": {
       "type": "integer"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "count": 1,
  "failed": 0,
  "format": "markdown",
  "results": [
   {
    "ok": true,
    "url": "https://example.com/",
    "title": "Example Domain",
    "markdown": "# Example Domain\n\nThis domain is for use in illustrative examples.",
    "markdown_sha256": "0000000000000000000000000000000000000000000000000000000000000000"
   }
  ],
  "succeeded": 1,
  "charged_urls": 1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentwork-web-contents-url-to-markdown-746d5783/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentwork.run](https://www.zero.xyz/host/api.agentwork.run/llms.txt)
