# agent402.tools HTML Table Extractor

> agent402.tools HTML Table Extractor is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Extracts an HTML <table> from a raw HTML string and returns the data as JSON rows (header-keyed objects) or CSV.

## Facts

- Endpoint: POST https://agent402.tools/api/html-table
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-html-table-extractor-da3e722b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EXu734yT66JeK9hTaJlXI

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 agent402-tools-html-table-extractor-da3e722b -d '<json body>'
```

Example prompt: I fetched this HTML page and it has a table of flight prices — can you extract that table as JSON rows keyed by the column headers? Here's the raw HTML: <html>...<table>...</table>...</html>

## When to prefer this

Use this endpoint when you have already fetched raw HTML (e.g. from a web scraper or browser) and need to pull out a <table> as structured data without writing custom parsing logic. Ideal for extracting price lists, sports stats, timetables, or any tabular data embedded in HTML pages. Prefer this over general-purpose HTML scrapers when the target is specifically a table element and you want clean, header-keyed row objects or CSV output.

## Known failure modes

- No table found in the HTML — returns an error indicating no matching element
- HTML exceeds 5MB size limit — request rejected
- Invalid CSS selector provided — returns a parsing or selector error
- Malformed HTML that cannot be parsed — may return empty result or error
- Multiple tables present — only the first match is returned, which may not be the intended one

## How this service works

Extract a <table> from an HTML string as JSON rows (header-keyed) or CSV. Useful for prices, schedules, sports stats, or anything an agent has already fetched as HTML. If multiple tables match, the first is used.

## Output

Returns the first matching HTML table (or the table matched by the given CSS selector) as either an array of JSON objects (each row is an object keyed by column header names) or a CSV string, depending on the requested format.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "html": {
   "type": "string",
   "description": "Raw HTML string containing the table (max 5MB)"
  },
  "format": {
   "type": "string",
   "description": "\"json\" (default - rows as header-keyed objects) | \"csv\""
  },
  "selector": {
   "type": "string",
   "description": "CSS selector for the table (default \"table\")"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "rows": [
   {
    "Pop": "8.3M",
    "City": "NYC"
   },
   {
    "Pop": "3.9M",
    "City": "LA"
   }
  ],
  "count": 2,
  "format": "json",
  "headers": [
   "City",
   "Pop"
  ]
 }
}
```

## More

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