# HTML Table to JSON Extractor

> HTML Table to JSON Extractor is a paid API for AI agents from agent-data-tools.revmesh2074.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-12-01).

Parses HTML fragments and extracts all <table> elements into structured JSON objects with headers as keys and rows as data.

## Facts

- Endpoint: GET https://agent-data-tools.revmesh2074.workers.dev/html/table-to-json?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-01
- Activations on Zero: 0
- Provider: agent-data-tools.revmesh2074.workers.dev
- Website: https://agent-data-tools.revmesh2074.workers.dev
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-data-tools-revmesh2074-workers-dev-html-table-to-json-extractor-af23e0ef
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_26kpKcr2awda3V0UmXnWl

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 agent-data-tools-revmesh2074-workers-dev-html-table-to-json-extractor-af23e0ef
```

Example prompt: I just fetched some HTML from a Wikipedia page and it has a big comparison table in it — can you extract all the tables from this HTML and give me the data as JSON so I can sort and filter it? Here's the HTML: <table><thead><tr><th>Country</th><th>GDP</th></tr></thead><tbody><tr><td>USA</td><td>25T</td></tr></tbody></table>

## When to prefer this

Use this endpoint when you have raw HTML already in hand (fetched via a separate page-read tool) and need to extract tabular data into machine-readable JSON for sorting, filtering, or computation. It handles multiple tables per fragment, decodes HTML entities, and repeats colspan cells so the output aligns with visual column structure. Prefer this over generic HTML parsers when your goal is specifically row/column tabular data with proper header-to-key mapping.

## Known failure modes

- HTML exceeds 500 KB limit — request rejected
- No <table> elements found in HTML — returns count:0 and empty tables array
- Malformed HTML may result in partial extraction or empty rows
- Tables with complex merged cells may produce unexpected repeated values due to colspan repetition
- Very deeply nested tables may not parse correctly

## How this service works

Extract every table from an HTML fragment into JSON: header cells become keys and each body row an object (or raw arrays when there is no header row), with captions, colspans repeated and entities decoded. Give the HTML itself (up to 500 KB). Use to turn web or email tables into data an agent can sort and compute on; to fetch a page first use extract.

## Output

Returns a JSON object with a 'count' field indicating how many tables were found, and a 'tables' array where each entry contains: a 'headers' array of column names derived from <th> cells, a 'rows' array of objects (where header cells become keys) or raw arrays if no header row exists, and a 'caption' field if the table has a <caption> element. Colspans are repeated and HTML entities are decoded.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "html"
 ],
 "properties": {
  "html": {
   "type": "string",
   "description": "HTML containing one or more <table> elements (up to 500 KB)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "count": {
   "type": "number"
  },
  "tables": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "rows": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "City": {
         "type": "string"
        },
        "Pop.": {
         "type": "string"
        }
       }
      }
     },
     "caption": {},
     "headers": {
      "type": "array",
      "items": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-data-tools-revmesh2074-workers-dev-html-table-to-json-extractor-af23e0ef/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-data-tools.revmesh2074.workers.dev](https://www.zero.xyz/host/agent-data-tools.revmesh2074.workers.dev/llms.txt)
