# Structured Extractor

> Structured Extractor is a paid API for AI agents from grim-foundry-pilot.onrender.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-13).

Extracts structured JSON data from a webpage URL or raw HTML according to a caller-supplied JSON schema, with validation

## Facts

- Endpoint: POST https://grim-foundry-pilot.onrender.com/v1/structured-extractor
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/structured-extractor-cbca1d86
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JxlDF9DziPJ7BG6WCli5y

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 structured-extractor-cbca1d86 -d '<json body>'
```

Example prompt: Extract structured data from https://example.com/product/123 using this schema: {title: string, price: number, description: string} — I need validated JSON back with any errors flagged.

## When to prefer this

Use this endpoint when you need to extract specific, schema-defined fields from a public webpage or raw HTML and want built-in schema validation to confirm the output is well-formed. It is best for deterministic field extraction where you know the shape of data you want, rather than open-ended summarization or AI-generated content. Prefer it over general LLM extraction when reproducibility and validation errors matter, and when you want to pay per-call with x402 rather than manage API keys.

## Known failure modes

- URL is unreachable or returns non-200 — extraction fails with ok:false
- HTML is malformed or too sparse to extract required fields — validation_errors populated
- Provided schema is invalid JSON Schema — request rejected or returns empty data
- Page requires JavaScript rendering (no browser execution) — incomplete extraction
- Rate limiting or payment failure via x402 — request not processed
- Schema fields not present in source content — valid:false with validation_errors

## How this service works

Four JSON APIs for agents. Paid operations use x402 v2 HTTP payment, not API-key authentication. Read the current PAYMENT-REQUIRED offer before paying.

## Output

Returns a JSON object containing: ok (boolean success flag), data (the extracted fields matching the provided schema), valid (boolean indicating schema validation passed), source_url (the URL fetched or null if HTML was provided directly), extraction_mode (e.g. 'deterministic-v0.1'), and validation_errors (array of any schema mismatch messages). Also includes a service identifier and a UUID request_id for tracing.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string"
  },
  "html": {
   "type": "string"
  },
  "schema": {
   "type": "object"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "data": {
    "title": "Demo"
   },
   "valid": true,
   "source_url": null,
   "extraction_mode": "deterministic-v0.1",
   "validation_errors": []
  },
  "service": "structured_extractor",
  "request_id": "00000000-0000-4000-8000-000000000000"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/structured-extractor-cbca1d86/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from grim-foundry-pilot.onrender.com](https://www.zero.xyz/host/grim-foundry-pilot.onrender.com/llms.txt)
