Web data infrastructure for AI agents
Any page in.
Trusted JSON out.
Contrie reads a web page, extracts the fields an agent asks for, and returns JSON with a quality score, a grounding check against the page, the full escalation trace, and the cost of the call — so the agent can act, retry, or budget without a human in the loop.
quality score · grounding · trace · cost — on every response
{ "stories": [ { "title": "Claude Fable 5.1 and Claud…", "points": 993 }, … 4 more ] }
Why agents need it
This is what a web page looks like to an AI
An agent that fetches a page itself gets the whole thing — nav, trackers, cookie banners, markup — and pays for every token of it. Contrie hands back only the answer.
<!DOCTYPE html><html data-reactroot=""><head><script async
src="https://tagmanager.example.com/gtm.js?id=GTM-5FK2"></script>
<link rel="preload" as="script" href="/_next/static/chunks/
webpack-7f31a.js"/><meta property="og:type"content="website"/>
<style>.css-1a2kq{display:flex;-webkit-box-align:center...}
</style></head><body><div id="__next"><div class="css-x91mz
nav-root"><nav aria-label="Main"><ul><li><a href="/deals">
Deals</a></li><li><a href="/support">Support</a></li>...
<div class="cookie-banner css-9ff2a" role="dialog">We use
cookies to improve your experience. <button>Accept all
</button><button>Manage preferences</button></div><div
class="css-8bb1e product-grid"><div data-testid="product
-card-8823"><span class="css-price-lg">$1,395</span><h3>
Aeron Task Chair</h3><span class="sr-only">In stock</span>
...41,000 more lines of this...{ "name": "Aeron Task Chair", "price": 1395, "stock": true }
Keep the context window
A raw page burns 50–500K tokens on markup an agent will never use. Contrie returns a few hundred tokens of exactly the requested fields.
Trust you can branch on
Every result carries a 0–100 quality score and a grounding ratio — how many values were found verbatim in the page. An agent acts on 96, retries on 60, and never has to trust a guess.
One tool, not a subsystem
No browser to run, no scraping stack to maintain, no model routing to build. One MCP tool or one REST call, and the pipeline handles the rest.
The pipeline
Six stages, one guarantee: scored output
Escalation ladders are how mature extraction systems work — cheap paths first, expensive models only when the score says so. Read the full architecture →
Heuristic
JSON-LD, microdata, Open Graph, and Twitter Card parsing run first. Sufficient structured data returns immediately — no model, no cost.
Markdown
The page is reduced once to structure-preserving markdown: headings, lists, tables, links kept; scripts, navigation, and cookie banners gone. It is what the model reads and what you get back in markdown mode.
Classify
The page is scored for complexity — simple, complex, visual, or adversarial — including anti-bot fingerprints. A JavaScript shell with no content is refused up front instead of guessed at.
Route
A tiered fleet of 17 models across 8 providers. The cheapest tier that can handle the classification goes first; free-tier requests hedge across two models for speed.
Validate
Every result is scored 0–100: schema 40%, completeness 40%, sanity and grounding 20%. Values are checked against the page text — an answer that is mostly invented cannot pass.
Escalate
Under 70? The pipeline climbs one tier and retries, keeping its best result. Every step lands in the trace, and every token lands in the cost.
The agent economy
Agents are the users.
More and more of the web is read by software on someone's behalf. Those readers need a tool that answers in their terms — typed data, a confidence they can act on, and a bill they can reason about. Contrie is built as that tool first, and a website second.
Machine onboarding
An agent can discover, configure, and call Contrie without a human reading docs: a hosted MCP endpoint, an OpenAPI description, llms.txt, and a SKILL.md it can install.
Receipts on every call
Score, grounding, trace, cost. An agent branches on the score, verifies with the grounding ratio, explains itself with the trace, and budgets with the cost — no guessing.
Cheapest capable model wins
Structured data and clean markdown cost nothing. The ladder climbs to a stronger model only when the score demands it, and the response tells you what that cost.
Engineering
Not a wrapper around one model
Every claim below is implemented in the open-source pipeline you can run from the playground.
Grounding check
Every extracted string and number is searched for in the page text. The ratio ships as grounding; below 50% the result cannot pass, so invented data escalates instead of returning.
Escalation trace
Which stage ran, which model answered, why it escalated, how long each step took. The trace is part of the response, not a log you have to go find.
Markdown at zero cost
format: "markdown" returns the page as clean, structure-preserving markdown with no model call. Tables stay tables, lists stay lists, links keep their targets.
JSON Schema contract
Pass a schema and the model is told the exact shape; the validator scores every violation. Required fields, nested arrays, enums — the same schema you validate with downstream.
Hosted MCP and streaming
Two tools at contrie.com/mcp with nothing to install, and an NDJSON stream on the REST API that delivers the trace as it happens.
Guarded API surface
SSRF protection on every redirect hop, hashed API keys, rate limiting, and validated input on every route. Trust boundaries treated as trust boundaries.
The API
One endpoint, three ways to ask
Describe the data, hand over a JSON Schema, or just ask for the page as markdown. Whatever you ask for, the response arrives with its receipts.
Full reference in the docs · machine-readable at /openapi.json
Install
Two tools. Nothing to run.
The hosted MCP endpoint exposes contrie_extract (typed JSON with the receipts) and contrie_read (clean markdown, no model). Bring an API key for live pages — recorded samples answer without one.
claude mcp add --transport http contrie \ https://contrie.com/mcp \ --header "Authorization: Bearer $CONTRIE_API_KEY"
{
"mcpServers": {
"contrie": {
"url": "https://contrie.com/mcp",
"headers": { "Authorization": "Bearer ck_live_…" }
}
}
}Prefer REST? POST https://contrie.com/api/v1/scrape returns the same object, and Accept: application/x-ndjson streams the trace. Never put a key in a URL or paste it into an agent chat.
See it run
Paste a URL. Read the receipts.
The playground replays real recorded runs, and streams every stage of a live one — score, grounding, trace, and cost included.