Skip to main content

Structured data extraction from any URL — tables, forms, lists as JSON. No API key needed.

Project description

SchemaSnap

PyPI version Python License: MIT tests

HTML → typed tables, forms, lists as JSON. 30ms, no key, no browser.

Born from shadow-web's SchemaSnap module. A parse primitive — not a scraper, not a crawler. Feed it HTML, get structured data.

curl -X POST https://schemasnap-464919960073.us-central1.run.app/v1/compress \
  -H "Content-Type: application/json" \
  -d '{"html":"<table><thead><tr><th>Product</th><th>Price</th><th>Stock</th></tr></thead><tbody><tr><td>Widget</td><td>$19.99</td><td>150</td></tr></tbody></table>"}'
{"tables":[{"columns":["Product","Price","Stock"],
  "types":["string","currency","integer"],
  "rows":[["Widget","$19.99","150"]]}]}

Live API

Endpoint Rate limit Auth
POST /v1/compress — HTML → structured JSON 500 req/day per IP None
GET /v1/health Unlimited None

Base URL: https://schemasnap-464919960073.us-central1.run.app

Quick install

pip install schemasnap

# For MCP (Cursor, Claude Desktop)
pip install "schemasnap[mcp]"

# For URL extraction (requires Playwright)
pip install "schemasnap[browser]"
playwright install chromium

Usage

Python SDK

from schemasnap import extract_from_html, parse_page

# From HTML string (no browser, 30ms)
result = extract_from_html(open("page.html").read())
print(result.tables)      # [{columns, types, rows, total_rows}]
print(result.forms)       # [{action, method, fields}]
print(result.lists)       # [{type, items, total}]
print(result.token_budget) # {raw_bytes, compressed_bytes, compression_ratio}

MCP (Cursor, Claude Desktop)

pip install "schemasnap[mcp]"

Add to Cursor Settings → MCP:

{
  "mcpServers": {
    "schemasnap": {
      "command": "schemasnap-mcp"
    }
  }
}

Tool: compress_html(html, max_rows_per_table=50, url="") → typed tables, forms, lists, actions.

curl (no Python needed)

curl -X POST https://schemasnap-464919960073.us-central1.run.app/v1/compress \
  -H "Content-Type: application/json" \
  -d '{"html": "<table>...your html...</table>"}'

Benchmarks

Page Raw Compressed Savings Latency
Wikipedia GDP 641 KB 215 KB 66% 256ms
W3Schools Tables 212 KB 87 KB 59% 34ms
Hacker News 35 KB 24 KB 32% 23ms

Measured on Cloud Run (us-central1), July 2026. Cold start ~250ms.

Features

  • Tables → columns, types (string|integer|number|currency|percentage|date|email|url), rows — from <table>, ARIA role=table|grid, Tailwind grids, or .row pseudo-tables
  • Forms → action, method, fields with name, type, label, required, placeholder, pattern, minlength, select options
  • Lists → type (unordered|ordered|select), items, total
  • Semantic groups → "Login Form", "Navigation", "Checkout", "Search" auto-detected
  • Deterministic — same input → same output. No LLM guess, $0 per call

Competitive positioning

SchemaSnap is a parse primitive, not a scraper:

Firecrawl / Jina     =  URL → content (crawl + render)
Crawl4AI             =  URL → markdown (self-host crawl)
pandas read_html()   =  HTML → strings (dev tool)
SchemaSnap           =  HTML → typed structure (agent utility)

Composable: Firecrawl fetch → SchemaSnap parse. Or curl → SchemaSnap parse.

Honest limits: HTML only (no JS render), layout tables skipped, no crawl, no proxy rotation.

Relationship to shadow-web

SchemaSnap started as schema_snap.py inside shadow-web — a broader agent-facing web interaction suite. This standalone version:

  • Adds MCP server (compress_html tool) for Cursor / Claude Desktop
  • Inlines semantic grouping (no external dependency)
  • Fixes tree mutation bug during tag removal
  • Adds deterministic type inference (8 types)
  • Hardened for public API (SSRF guard, rate limiting, oversize protection)

License

MIT


#web-scraping #data-extraction #ai-agents #html-parser #json-api #python #llm-tools

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

schemasnap-0.1.6.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

schemasnap-0.1.6-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file schemasnap-0.1.6.tar.gz.

File metadata

  • Download URL: schemasnap-0.1.6.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for schemasnap-0.1.6.tar.gz
Algorithm Hash digest
SHA256 0b30c62a0734e292b42c508828f61e4689857c3707b87a86ab9ae3fab1c21f2f
MD5 8b4cea190f8476fe4e9c8c379ba98573
BLAKE2b-256 62d7bb874c5453207bdd0bb68c134b73e6499d0c314b596466651c1ade75f3d9

See more details on using hashes here.

File details

Details for the file schemasnap-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: schemasnap-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for schemasnap-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 75abcb225a96ed699c0932ab9fa9b3be90df34ad2e40480346820edf5e696ea9
MD5 eff3ea59469c8b557fa29af7a584a9d9
BLAKE2b-256 d54697e2223f8da2512e89a44823350bfca24b3603eecad3271f8b3e0ee548ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page