# LayerCity HTML Extractor

> LayerCity HTML Extractor is a paid API for AI agents from api.layercity.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-13).

Converts raw HTML into clean plain text and Markdown with metadata (title, description, headings, links, word count, reading time) for LLM consumption

## Facts

- Endpoint: POST https://api.layercity.com/extract?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/layercity-html-extractor-247ff5f7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lH_qG6gUnwZvF7Y8qJLvz

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 layercity-html-extractor-247ff5f7 -d '<json body>'
```

Example prompt: I have this raw HTML from a webpage — can you strip it down to clean plain text and markdown, and also pull out the title, meta description, headings, links, word count, and reading time so I can feed it to an LLM?

## When to prefer this

Choose this endpoint when you already have raw HTML in hand and need it converted to clean, LLM-ready text and markdown — especially when you need structured metadata like headings, links, word count, and reading time alongside the content. It does not fetch URLs itself, so pair it with a separate fetcher. Prefer it over general-purpose HTML parsers when the output needs to be immediately usable by an LLM without further cleaning.

## Known failure modes

- HTML exceeds 2 MB limit — request rejected
- Malformed or empty HTML body — may return empty fields or error
- Missing 'html' field in request body — validation error
- Extremely sparse or non-semantic HTML (e.g. pure JavaScript apps) — plain text and markdown may be nearly empty

## How this service works

HTML to clean text and markdown for LLMs: returns title, meta description, plain text, markdown, headings, links, word count and reading time. Caller supplies the HTML; no fetching.

## Output

Returns a structured object containing: the page title, meta description, plain text version, markdown version, list of headings, list of links, total word count, and estimated reading time — all derived from the submitted HTML without any external fetching.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "html": {
   "type": "string",
   "description": "Raw HTML document or fragment (max 2 MB)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/layercity-html-extractor-247ff5f7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.layercity.com](https://www.zero.xyz/host/api.layercity.com/llms.txt)
