---
title: "Structured Data Extraction & HTML-to-JSON Inference | Inference.net"
description: "High-throughput HTML-to-JSON and structured data extraction powered by Schematron V2 Small and Turbo on Inference.net — 128K context, strict JSON Schema mode, and Batch/Group scaling."
url: "https://inference.net/solutions/structured-data-extraction/"
---

Structured Data Extraction

# Structured Data Extraction & HTML-to-JSON Inference

Extract clean, strictly typed JSON from messy HTML and long web documents using Inference.net's Schematron V2 Small and Schematron V2 Turbo models. Purpose-trained for schema-first extraction up to 128K tokens with 100% JSON Schema adherence over a standard OpenAI-compatible API.

- Schema-first extraction: pass Pydantic or Zod schemas via `response_format` with 100% JSON adherence
- Two tuned tiers: `inference-net/schematron-v2-small` (highest quality) and `schematron-v2-turbo` (highest throughput)
- Long-context HTML handling up to 128K tokens — robust against noisy real-world markup
- Scales cleanly from real-time `/v1` extraction to 1M-page JSONL Batch API and Group API webhooks

[Get API key](https://inference.net/register/) [Browse models](https://inference.net/models/)

Capabilities & Specs

## Built for production reliability

| Capability | Specification | How it helps |
| --- | --- | --- |
| Schematron V2 Small | `inference-net/schematron-v2-small` | Highest extraction quality approaching frontier-model accuracy on complex schemas. |
| Schematron V2 Turbo | `inference-net/schematron-v2-turbo` | Optimized for maximum throughput and lowest per-page extraction cost at scale. |
| Context window | Up to 128K tokens | Handles long, noisy real-world HTML documents without brittle CSS selectors. |
| Schema adherence | 100% strict JSON mode | Strict JSON Schema enforcement via OpenAI SDK `response_format` (Zod or Pydantic). |
| Bulk extraction scale | Sync, Group, and Batch ready | Pairs directly with synchronous `/v1`, Group API (50 reqs), or Batch API (1M JSONL). |

Quickstart

## Extract typed JSON from messy HTML with Zod

Keep temperature at 0 and strip <script>/<style> tags with lxml or an HTML cleaner before sending.

typescript

```
import OpenAI from "openai";
import { zodResponseFormat } from "openai/helpers/zod";
import { z } from "zod";

const openai = new OpenAI({
  baseURL: "https://api.inference.net/v1",
  apiKey: process.env.INFERENCE_API_KEY,
});

const Product = z.object({
  name: z.string().describe("Exact product title on the page."),
  price: z.number().describe("Primary listed price."),
  tags: z.array(z.string()).describe("Product category tags."),
});

const resp = await openai.chat.completions.parse({
  model: "inference-net/schematron-v2-small",
  temperature: 0,
  messages: [{ role: "user", content: cleanedHtml }],
  response_format: zodResponseFormat(Product, "product"),
});
```

Documentation & Guides

## Guides and references

[**Schematron documentation** Full TypeScript, Python, and cURL examples plus lxml preprocessing guidance. Open guide](https://inference.net/docs/api/models/schematron/) [**Structured outputs docs** JSON Schema mode and strict structured outputs across Inference.net models. Open guide](https://inference.net/docs/api/structured-outputs/) [**Schematron V2 Small model page** Live pricing, context window, and quickstart for Schematron V2 Small. Open guide](https://inference.net/models/inference-net-schematron-v2-small/) [**Schematron V2 Turbo model page** Live pricing, context window, and quickstart for Schematron V2 Turbo. Open guide](https://inference.net/models/inference-net-schematron-v2-turbo/) [**Explore all models** Compare Schematron V2 against general-purpose models in the full catalog. Open guide](https://inference.net/models/)

FAQ

## Frequently asked questions.

Quick answers to help you get started

### Should I pick Schematron V2 Small or Schematron V2 Turbo?

Use `inference-net/schematron-v2-small` when you need the highest extraction accuracy on complex nested schemas or very long pages. Use `inference-net/schematron-v2-turbo` when maximum throughput and lowest cost at scale are the priority.

### Do I need to write long extraction prompts for Schematron V2?

No. Schematron is schema-first: pass the HTML in the user message and define your fields and field descriptions directly in your Pydantic or Zod JSON Schema via `response_format`.

### How should I preprocess HTML before calling Schematron V2?

Pre-cleaning HTML with `lxml.html.clean.Cleaner` to strip scripts, styles, and inline JavaScript matches how Schematron was trained, improving accuracy while cutting input tokens.

### Can I run Schematron V2 over millions of web pages asynchronously?

Yes. Combine Schematron V2 with the Group API (up to 50 pages per job) or Batch API (up to 1,000,000 pages per JSONL file) for large-scale crawling and product-catalog ingestion pipelines.

Get Started

## Ship on Inference.net today

Start self-serve with an API key, explore live model pricing, or talk with our team about dedicated capacity and custom SLAs.

[Get API key](https://inference.net/register/) [Browse models](https://inference.net/models/) [Talk to sales](https://inference.net/sales/)
