# 402utils HTML Table Extractor

> 402utils HTML Table Extractor is a paid API for AI agents from 402utils.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-12).

Extracts all HTML tables from provided markup into structured JSON with headers, rows, and captions, with colspan/rowspan grid expansion

## Facts

- Endpoint: POST https://402utils.com/v1/html-tables?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/402utils-html-table-extractor-7cdaa029
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0YRioOehfCP_GOYRFxqfq

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 402utils-html-table-extractor-7cdaa029 -d '<json body>'
```

Example prompt: Pull out all the tables from this HTML snippet and give me the headers and rows as clean JSON — here's the markup: <table><thead><tr><th>Name</th><th>Score</th></tr></thead><tbody><tr><td>Alice</td><td>95</td></tr></tbody></table>

## When to prefer this

Use this endpoint when you already have HTML markup and need to extract structured tabular data without fetching any URLs. It handles messy real-world tables with colspan/rowspan spanning and nested tables, making it ideal for post-scrape table parsing or processing HTML from clipboard, documents, or API responses.

## Known failure modes

- HTML exceeds 5 MB limit — request rejected
- More than 200 tables in the HTML — truncated or rejected
- More than 200,000 cells across all tables — rejected
- Malformed or non-HTML body — may return empty tables array or error
- No tables found in the HTML — returns empty array

## How this service works

Extract every table from HTML you provide into clean JSON — no fetching, send the markup itself as {html} or a raw text/html body. Returns per table: optional caption, headers[] (from thead or an all-th first row) and rectangular rows[][]. colspan/rowspan cells are grid-expanded with the value duplicated so rows align with the visual layout; nested tables are flattened into the outer cell's text. Caps: 5 MB HTML, 200 tables, 200k cells.

## Output

Returns a JSON array of table objects, each containing an optional caption string, a headers array (derived from thead or an all-th first row), and a rectangular rows array of arrays where colspan/rowspan cells are duplicated to align with the visual grid layout. Nested tables are flattened into the parent cell's text content.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "html": {
   "type": "string",
   "description": "The HTML document or fragment to extract tables from (max 5 MB UTF-8). Nothing is fetched."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "tables": [
   {
    "rows": [
     [
      "Café filtre",
      "€12,400"
     ]
    ],
    "caption": "Q2 revenue",
    "headers": [
     "Product",
     "Revenue"
    ]
   }
  ],
  "tableCount": 1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/402utils-html-table-extractor-7cdaa029/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402utils.com](https://www.zero.xyz/host/402utils.com/llms.txt)
