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, total_rows
  • 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.4.tar.gz (22.9 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.4-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: schemasnap-0.1.4.tar.gz
  • Upload date:
  • Size: 22.9 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.4.tar.gz
Algorithm Hash digest
SHA256 25168649b3573b9a91039ac6a70ab4245a43a5a9e959de40873cf7d652422239
MD5 506d0d31317904cd913d1a066830c736
BLAKE2b-256 1340ea5c2a98956ad382800ff43ffb8ecf25cde1ac04a6cd9d506649a47dca16

See more details on using hashes here.

File details

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

File metadata

  • Download URL: schemasnap-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 18.8 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 29e0006938832ce33054abd7733e46e750377de0d6db5b5fc3718109f9b83089
MD5 9b796dbdea9fe5963c69ff7d641372b2
BLAKE2b-256 217920abe307b4e0764599e0813e26807c4b600e388941cfbee57629b4a70c31

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