# TableGrab – File Upload Table Extractor (x402)

> TableGrab – File Upload Table Extractor (x402) is a paid API for AI agents from priceplain.onrender.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Accepts an uploaded HTML, CSV, XLSX, or PDF file and returns clean, typed JSON tables or Markdown, with inferred column types and structured row objects.

## Facts

- Endpoint: POST https://priceplain.onrender.com/v1/extract/upload?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tablegrab-file-upload-table-extractor-x402-19f7c8f7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PoKXiiiFLdKQoJUMedVt4

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 tablegrab-file-upload-table-extractor-x402-19f7c8f7 -d '<json body>'
```

Example prompt: I have an HTML file with several tables in it — can you upload it and give me back clean JSON with typed columns for each table, extracting up to 20 tables?

## When to prefer this

Choose this endpoint when you have a local file (HTML, CSV, XLSX, or text PDF) you want to upload directly rather than providing a public URL. It is ideal when the source document is not publicly accessible on the web, when you need typed JSON with inferred column types rather than raw text, and when you want clean structured row objects ready for downstream processing. For public URLs, the sibling URL-based TableGrab endpoint may be more convenient.

## Known failure modes

- File exceeds 5 MiB limit — request rejected
- Unsupported file format — only HTML, CSV, XLSX, and text-based PDFs are accepted
- Scanned/image-based PDFs return no tables as text is not extractable
- No tables found in the document — empty tables array returned
- Payment not completed via x402 — 402 response returned before processing
- Malformed file or corrupt upload — parsing error returned

## How this service works

Three x402-paid data APIs on one host. PricePlain: Posted US hospital prices (CMS price-transparency files), cleaned: Twin Cities, MN first. Cash and payer-negotiated rates per CPT/DRG code with canonical insurer names, provenance (source file URL + date) and data-quality flags. Posted prices, not quotes. TableGrab: public URL or file -> typed JSON tables / Markdown. City Table Clean: Socrata/CKAN city CSV cleaner with a per-change log.

## Output

Returns a JSON object containing the detected input type, mode used, number of tables found, and an array of table objects each with: typed column definitions (key, type, header), row objects, row/column counts, source metadata, caption, context string, and a truncated flag.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "file": {
   "type": "string",
   "format": "binary",
   "description": "HTML, CSV, XLSX or text-based PDF, max 5 MiB"
  },
  "mode": {
   "enum": [
    "tables",
    "markdown",
    "auto"
   ],
   "type": "string",
   "default": "auto"
  },
  "clean": {
   "type": "boolean",
   "default": true
  },
  "max_tables": {
   "type": "integer",
   "default": 20
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "source": {
   "url": "https://en.wikipedia.org/wiki/List_of_United_States_cities_by_population"
  },
  "tables": [
   {
    "rows": [
     {
      "city": "New York",
      "state": "New York",
      "c_2024_estimate": 8478072
     }
    ],
    "index": 0,
    "n_cols": 3,
    "n_rows": 1,
    "source": {
     "type": "html",
     "table_index": 3
    },
    "caption": null,
    "columns": [
     {
      "key": "city",
      "type": "text",
      "header": "City"
     },
     {
      "key": "state",
      "type": "text",
      "header": "State"
     },
     {
      "key": "c_2024_estimate",
      "type": "integer",
      "header": "2024 estimate"
     }
    ],
    "context": "List of United States cities by population",
    "headers": [
     "City",
     "State",
     "2024 estimate"
    ],
    "truncated": false
   }
  ],
  "mode_used": "tables",
  "input_type": "html",
  "tables_found": 9
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tablegrab-file-upload-table-extractor-x402-19f7c8f7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from priceplain.onrender.com](https://www.zero.xyz/host/priceplain.onrender.com/llms.txt)
