---
title: "Cited Table — HTML table → typed JSON rows + CSV, with signed provenance (keyless x402)"
method: GET
path: "/buy/table"
tags: ["html-table-extraction", "table-to-json", "table-to-csv", "url-to-table", "structured-data-extraction", "web-scraping-api", "data-extraction-api", "data-aggregation", "llm-ready-data", "verifiable-extract", "attestation", "provenance", "keyless", "agent-native", "rag"]
---

# Cited Table — HTML table → typed JSON rows + CSV, with signed provenance (keyless x402)

`GET /buy/table`

## Request

- Base URL: `https://network.mercury-hq.com`
- URL: `https://network.mercury-hq.com/buy/table`
- Auth: none declared
- TypeScript: <https://skmtc.dev/mercury-hq/apis/mercury-x402-storefront/docs/buy/table/get.ts> (a function with typed inputs; its response is checked against the schema)

URL in → the page's main HTML <table>(s) parsed into typed, header-keyed rows (JSON) + clean RFC-4180 CSV, with a signed provenance receipt over the exact extracted grid. Deterministic, keyless, no LLM — x402, USDC on Base mainnet.

## Query parameters

- `url` string, required: the page to extract tables from (http/https)
- `table` string: optional: 0-based index of a SINGLE table to return (document order). Omit to return ALL tables found (up to the cap).
- `format` 'both' | 'json' | 'csv': optional: which serialisations to include in `data` (default: both).

## Response `200`

Delivered after the x402 payment settles on Base mainnet.

- object
  - `ok` boolean, required: true on success; false on an honest failure (still delivered, but 503-before-charge)
  - `url` string, required: final URL after redirects
  - `status` integer: upstream HTTP status
  - `text` string: the canonical signed string: JSON.stringify(data, sorted-keys) — the exact bytes the provenance receipt covers
  - `fetchedAt` string: ISO timestamp of the fetch (also in the signed attestation)
  - `data` object: the structured product the buyer consumes
    - `title` string: page <title>
    - `tableCount` integer: number of data tables found on the page
    - `returned` integer: number of tables returned in this response
    - `truncatedTables` boolean: true if MAX_TABLES clipped the set
    - `tables` object[]: each extracted table
      - `index` integer: 0-based position in the document
      - `columns` string[]: ordered, de-duplicated column names (from <th>/first row)
      - `rowCount` integer
      - `ragged` boolean: true if any row's cell count != header width (colspan/rowspan)
      - `rows` object[]: header-keyed row objects (cell text)
      - `csv` string: RFC-4180 CSV of this table (omitted when ?format=json)
  - `attestation` object: EIP-191 provenance receipt over `text` (the canonical sorted-key JSON of the extracted grid), ecrecoverable OFFLINE (key at /.well-known/mercury-attestation). Proves the ROWS are genuine + untampered.
    - `keyId` string
    - `alg` string
    - `address` string
    - `contentHash` string
    - `nonce` string
    - `signedAt` string
    - `signature` string
    - `verify` object
      - `message` string
      - `howTo` string
  - `error` string: present only when ok:false

## Other responses

- `402`: Payment Required — retry with an x402-signed payment (e.g. x402-fetch). Terms are in the challenge body (x402 v1).

---

[API](https://skmtc.dev/mercury-hq/apis/mercury-x402-storefront.md) - [All operations](https://skmtc.dev/mercury-hq/apis/mercury-x402-storefront/llms.txt) - [OpenAPI document](https://skmtc.dev/mercury-hq/apis/mercury-x402-storefront/revisions/211aa7db24ae?raw)
