SchemaSnap
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.
pip install "schemasnap[server]"
uvicorn schemasnap.server:app --port 8000 &
curl -X POST http://127.0.0.1:8000/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"]]}]}
Self-hosted API
There is no hosted endpoint — the Cloud Run deployment was retired in October 2026. Run it yourself; it is two commands:
pip install "schemasnap[server]"
uvicorn schemasnap.server:app --port 8000
| Endpoint | Auth | Notes |
|---|---|---|
POST /v1/compress — HTML → structured JSON |
none by default | stateless, pure lxml, ~30 ms |
GET /v1/health |
none | reads __version__ from the package |
POST /v1/extract — URL → structured JSON |
— | off unless you set DISABLE_EXTRACT=0; needs Playwright |
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 http://127.0.0.1:8000/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 July 2026 on a 1 vCPU / 256 MB instance (Cloud Run, us-central1), Python 3.12. Cold start ~250 ms — irrelevant when you call the library in-process.
Features
- Tables → columns, types (
string|integer|number|currency|percentage|date|email|url), rows — from<table>, ARIArole=table|grid, Tailwind grids, or.rowpseudo-tables - Forms → action, method, fields with
name,type,label,required,placeholder,pattern,minlength, selectoptions - 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_htmltool) 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
Metadata
Release files for schemasnap 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| schemasnap-0.1.8.tar.gz | 28.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| schemasnap-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 50.2 kB
Release files / schemasnap-0.1.8.tar.gz
| Download URL | schemasnap-0.1.8.tar.gz |
|---|---|
| Size | 28.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
854c407a050204cff8cee326b1e41aa41f63842accfd7408b3c7aba26e7de5ce
|
|
BLAKE2b-256 checksum How to use checksums |
e82bf3acaba95856f164fd8c802adc93f4775d59f29c6b8e68b205378de7f38a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Release files / schemasnap-0.1.8-py3-none-any.whl
| Download URL | schemasnap-0.1.8-py3-none-any.whl |
|---|---|
| Size | 21.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cbf3f5e544b255453a4a681dcea71f3435ec203c32f453c04a3d28ff62b28e91
|
|
BLAKE2b-256 checksum How to use checksums |
e862fc134871b8c78257387f7f0a45621b981329ce71af30a6e3007785e488ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|