# Toll402 Schema-Constrained Web Extraction

> Toll402 Schema-Constrained Web Extraction is a paid API for AI agents from toll402.dev, paid per call via x402, $0.06/call, status unknown (last checked 2026-09-15).

Extracts structured JSON from a web page or raw text, constrained to a caller-supplied JSON Schema, using an LLM backend — no post-processing required.

## Facts

- Endpoint: GET https://toll402.dev/v1/extract
- Price: $0.06/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/toll402-schema-constrained-web-extraction-e0573e00
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2_hswd9u1RVgkY3GVqg0V

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability toll402-schema-constrained-web-extraction-e0573e00
```

Example prompt: Fetch this product page — https://example.com/products/widget-42 — and extract the product name, price in USD, availability status, and list of features into a JSON object matching this schema: {name: string, price: number, available: boolean, features: string[]}. Output dates as ISO 8601.

## When to prefer this

Choose this endpoint when you have a specific JSON Schema in mind and want schema-constrained structured output from a URL or raw text without writing any parsing or post-processing code. It is especially valuable when the source is semi-structured or natural language (articles, product pages, job listings) and you need guaranteed-typed JSON back. Prefer alternatives if you only need raw page content (use a markdown fetch endpoint) or a plain summary (use a summarization endpoint).

## Known failure modes

- URL is not publicly accessible or returns a non-200 status — extraction fails with an error
- Requested schema fields are not present in the source content — missing fields may be null or omitted
- Source page is behind authentication or a JavaScript-heavy SPA — content may not be fully retrieved
- Schema is malformed or too complex — LLM may produce incomplete or invalid JSON
- Text input exceeds 400,000 character limit — request rejected
- LLM hallucination of values not actually present in source — possible when instructions are ambiguous

## How this service works

Turn a web page or raw text into JSON that matches YOUR JSON Schema. LLM-powered, schema-constrained output — no parsing needed.

## Output

A JSON object that strictly matches the caller-supplied JSON Schema. Fields are populated by an LLM reading the source page or text, with no extra parsing step needed. The response is ready to use directly in application logic.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "schema"
     ],
     "properties": {
      "url": {
       "type": "string",
       "format": "uri",
       "description": "Page to read and extract from"
      },
      "text": {
       "type": "string",
       "maxLength": 400000,
       "description": "Raw text/markdown/HTML to extract from (alternative to url)"
      },
      "schema": {
       "type": "object",
       "description": "JSON Schema (object) describing the output you want",
       "additionalProperties": true
      },
      "instructions": {
       "type": "string",
       "maxLength": 4000,
       "description": "Extra guidance, e.g. 'prices in USD', 'dates as ISO 8601'"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "ms": {
       "type": "integer"
      },
      "ok": {
       "type": "boolean"
      },
      "tool": {
       "type": "string"
      },
      "result": {
       "type": "object",
       "properties": {
        "data": {
         "type": "object",
         "properties": {
          "stories": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "title": {
              "type": "string"
             },
             "points": {
              "type": "integer"
             }
            }
           }
          }
         }
        },
        "usage": {
         "type": "object",
         "properties": {
          "inputTokens": {
           "type": "integer"
          },
          "outputTokens": {
           "type": "integer"
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "stories": [
    {
     "title": "Show HN: ...",
     "points": 120
    }
   ]
  },
  "usage": {
   "inputTokens": 5400,
   "outputTokens": 320
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/toll402-schema-constrained-web-extraction-e0573e00/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from toll402.dev](https://www.zero.xyz/host/toll402.dev/llms.txt)
