DOM Harvest & Table Grid Edge API

Turn noisy HTML tables, repeating product grids, and JSON-LD into clean typed JSON with >90% LLM token reduction.

Pure-TypeScript HTML structure harvester that resolves complex multi-row rowspan/colspan tables into typed 2D JSON matrices, auto-detects 100-500 repeating product/listing cards without selectors, extracts JSON-LD & OpenGraph metadata, and executes declarative CSS-schema scraping.

web-scraping data-extraction context-compression developer-tools

Why Agents Call This API Instead of DIY

Dumping raw 300KB HTML into an LLM burns $0.05-$0.30 in context tokens and truncates past item 20; DIY regex/table parsers break on multi-row thead colspan + rowspan merges. DOM Harvest extracts all 500 items deterministically in <20ms for $0.001-$0.002.

DimensionDIY Inside Agent Sandbox / PromptDOM Harvest & Table Grid Edge API (dom-harvest)
Onboarding & AuthInstall packages, debug runtime errors, or manage API keysZero signup — instant HTTP 402 (x402 USDC) & remote MCP
Context & Token CostThousands of tokens spent in multi-turn code/parse loopsDeterministic compact JSON response (<1.5K tokens)
Schema ValidationSilent runtime failures on malformed inputsFree ?dry_run=true preflight ($0.00 on 4xx errors)

Tools & Payable Endpoints (2)

harvest_page_structures — Auto-Harvest Tables, Repeating Cards & Metadata

$0.002 USD per HTML page structure harvest (x402 instant micropayment)

Zero-selector structural HTML harvester: extracts canonical/OpenGraph/Twitter metadata, Schema.org JSON-LD, normalized 2D tables (resolving multi-header rowspan/colspan merges + cell links), and repeating sibling card collections across 100-500 items without truncation.

Why buy vs. DIY: Compresses 250KB+ noisy DOMs by >90% tokens without dropping items 21-500 or misaligning colspan/rowspan financial columns; runs deterministically in <20ms at $0.002.

extract_by_schema — Extract Records by Declarative CSS Schema

$0.001 USD per declarative CSS-schema extraction (x402 instant micropayment)

Deterministic CSS-selector record extractor supporting descendant/child/attribute/group selectors, relative URL resolution against baseUrl, numeric currency/comma coercion, boolean flags, inner HTML serialization, and multi-value arrays.

Why buy vs. DIY: Eliminates brittle ad-hoc cheerio/regex glue code and runs identically at the Cloudflare edge in <10ms for $0.001.

Quickstart: MCP, x402 & Optional Bearer API Key

1. Streamable HTTP MCP Config (com.apikeg/dom-harvest)

{
  "mcpServers": {
    "dom-harvest": {
      "type": "streamable-http",
      "url": "https://dom-harvest.apikeg.com/mcp"
    }
  }
}

Using a Monthly Stripe Plan? Get your per-email ak_live_... key at https://apikeg.com/account ($5 / $20 / $50 monthly tiers) and pass header Authorization: Bearer ak_live_... on REST or MCP requests.

2. Free Schema Dry-Run ($0.00)

curl -X POST "https://dom-harvest.apikeg.com/v1/harvest-page-structures?dry_run=true" \
  -H "Content-Type: application/json" \
  -d '{"baseUrl":"https://shop.example.com/catalog","includeMatrix":true,"minCollectionItems":3,"html":"<html><head><title>Catalog</title></head><body><table><thead><tr><th rowspan='2'>Region</th><th colspan='2'>Q1 2026</th></tr><tr><th>Revenue</th><th>Growth</th></tr></thead><tbody><tr><td>NA</td><td>$1,200,000</td><td>18%</td></tr></tbody></table></body></html>"}'

Common Agent & Automation Workflows

Frequently Asked Questions

Why should an AI agent call DOM Harvest & Table Grid Edge API instead of writing custom code?

Dumping raw 300KB HTML into an LLM burns $0.05-$0.30 in context tokens and truncates past item 20; DIY regex/table parsers break on multi-row thead colspan + rowspan merges. DOM Harvest extracts all 500 items deterministically in <20ms for $0.001-$0.002.

How do I connect DOM Harvest & Table Grid Edge API to Claude, Cursor, or an MCP client?

Connect directly to the stateless Streamable HTTP MCP endpoint at https://dom-harvest.apikeg.com/mcp (registry ID: com.apikeg/dom-harvest). No API keys or OAuth accounts are required; initialize and tools/list are 100% free.

How much does DOM Harvest & Table Grid Edge API cost per API or MCP call?

Pay per call with zero signup via HTTP 402 (x402 v2 USDC on Base): harvest_page_structures ($0.002 USD per HTML page structure harvest (x402 instant micropayment)); extract_by_schema ($0.001 USD per declarative CSS-schema extraction (x402 instant micropayment)). Prefer traditional monthly billing? Get a verified-email Bearer API key at https://apikeg.com/account with $5/mo ($6 credit), $20/mo ($28 credit), or $50/mo ($80 credit) per-product plans. Invalid schemas (HTTP 400) and ?dry_run=true always cost $0.00.

Can I validate request payloads for free before paying?

Yes. Pass ?dry_run=true in the URL or send the header X-Dry-Run: true to validate your JSON input against the strict schema at $0.00 cost.