---
name: validjson-extract
description: "Extract public webpages and PDFs into strict JSON Schema objects with built-in anti-fake-200 bot-wall detection and SHA-256 attestation. Charges $0 on Cloudflare challenges, empty SPA shells, soft-404s, or schema validation failures."
---

# ValidJSON Extract & Enrichment Skill

Flat callable web extraction and enrichment backend for AI assistants, coding agents, and structured data pipelines. Works identically via native Streamable MCP (`POST /mcp`), REST (`/v1/extract`), `treg hub` (`validjson-extract`), and Causal Bazaar (`web_extract_enrichment_engine_v1`). Zero prompt or trace resale.

## Core Billing Invariant

Credits or per-call tolls are deducted **only** when all four deterministic checks succeed:
`ok == true && is_fake_200 == false && schema_valid == true && completeness_score >= 0.35`.

Any Cloudflare Turnstile or interstitial challenge, DataDome, PerimeterX, Akamai, Incapsula, or AWS WAF block, empty SPA root shell (`#root`, `__next`, `__nuxt`, `svelte`), soft-404 page, login or metered paywall, SSRF metadata host rejection (`169.254.169.254`, `metadata.google.internal`), or JSON Schema Draft 2020-12 mismatch automatically returns `credits_charged: 0`.

## Quick Invocation

### 1. Native Streamable MCP (`POST /mcp`)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "web_extract",
    "arguments": {
      "url": "https://www.python.org/",
      "template": "company_profile"
    }
  }
}
```

Available MCP tools: `web_extract`, `web_extract_batch`, `web_enrich`, and `verify_fake200` (free, `0` credits).

### 2. Via `treg hub` (`$0.005` per verified JSON, `$0.00` on fake-200)

```bash
treg call validjson-extract \
  --data '{"url":"https://www.python.org/","template":"company_profile"}'
```

### 3. Via REST API

```bash
curl -s -X POST https://api.validjson.pages.dev/v1/extract \
  -H "Content-Type: application/json" \
  -H "X-API-Key: ${VALIDJSON_API_KEY}" \
  -d '{"url":"https://www.python.org/","template":"company_profile"}'

# Free anti-fake-200 pre-check (0 credits)
curl -s -X POST https://api.validjson.pages.dev/v1/verify-fake200 \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/"}'
```

### 4. Via Causal Bazaar Public Card

- `card_id`: `web_extract_enrichment_engine_v1`
- `price_micros`: `5000` (`$0.005` per valid JSON)
- `receipt_sig`: `2e21b6276becbd483d73440f06b61ae21ba03413e1aff09a03c88db0c16717f2`
- `built_in_templates`: `company_profile`, `package_repo_metadata`, `news_article`, `pricing_catalog`, `research_document`, `lead_enrichment`

## Benchmark Verification

- Verified `completeness_score` between `0.802` and `1.0` across 7 public web and PDF categories.
- SQLite WAL composite cache (`canonical_url + schema_hash + mode`) reduces latency from `3840.15 ms` cold to `0.27 ms` warm.
- Deterministic `attestation_sha256` payload digest returned on every verified extraction.

## Prepaid Credit Packs (Creem.io, Non-Expiring)

- Starter ($19 / 5,000 valid JSON, $0.0038/hit): https://www.creem.io/product/prod_63VLiyMQGO6ltGIAedaSs2
- Growth ($79 / 30,000 valid JSON, $0.00263/hit): https://www.creem.io/product/prod_27YPWAoP4Fc1lsgfvImcz6
- Scale ($249 / 120,000 valid JSON, $0.00208/hit): https://www.creem.io/product/prod_5GAxeF23dVNQoXbj4JUAZQ
