# HydraTrader Structured Extract

> HydraTrader Structured Extract is a paid API for AI agents from x402.hydratrader.ai, paid per call via x402, $0.03/call, status unknown (last checked 2026-09-15).

Extracts JSON matching a caller-supplied schema from pasted text or a public URL, returning structured data with confidence score and warnings.

## Facts

- Endpoint: POST https://x402.hydratrader.ai/v1/structured-extract
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hydratrader-structured-extract-6acc09d8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_H8oDArHAORl5JRW0QcUXE

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 hydratrader-structured-extract-6acc09d8 -d '<json body>'
```

Example prompt: Extract structured data from this public URL — https://example.com/product/widget-pro — into my schema {"title": {"type": "string"}, "price": {"type": "number"}} and tell me the confidence score.

## When to prefer this

Choose this endpoint when you need to turn unstructured text or public web content into typed, schema-validated JSON with an explicit confidence signal. It is ideal when you already know the shape of data you want (you supply the schema) and need both extraction and basic quality feedback in one call. Prefer it over generic LLM prompting when you need deterministic schema adherence, per-call cost accountability ($0.03 USDC), and automatic refusal of login-gated sources.

## Known failure modes

- Source URL requires login or is behind a paywall — endpoint refuses and returns an error
- Public URL is unreachable or returns non-200 — extraction fails with source fetch error
- Pasted text is too long and gets truncated — `source_meta.truncated` is true, confidence may drop
- Extracted data doesn't match schema types — warnings array populated, partial or null fields returned
- Low confidence score when source text is ambiguous or schema fields not found in content
- Schema is malformed or missing required fields — request rejected with validation error

## How this service works

Extract structured JSON fields into YOUR schema from pasted text or a public URL. When to use: turn messy public text into typed JSON with confidence + warnings. Refuses login/paywall sources. USDC on Base via x402 — no API key.

## Output

Returns a JSON object with `ok` flag, `data` containing the extracted fields matching the caller's schema, a `confidence` score (0-1), a `warnings` array for quality issues, `usage` metadata (latency_ms, price_usdc), and `source_meta` describing the input source (URL, char count, whether fetched/truncated).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "schema": {
   "type": "object"
  },
  "source": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "url": {
     "type": "string",
     "format": "uri"
    },
    "text": {
     "type": "string"
    },
    "type": {
     "enum": [
      "text",
      "public_url"
     ],
     "type": "string"
    }
   }
  },
  "client_ref": {
   "type": "string"
  },
  "instructions": {
   "type": "string",
   "maxLength": 1000
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "price": 12.5,
   "title": "Widget Pro"
  },
  "usage": {
   "latency_ms": 1100,
   "price_usdc": "0.03"
  },
  "endpoint": "structured-extract",
  "warnings": [],
  "client_ref": null,
  "confidence": 0.92,
  "source_meta": {
   "url": null,
   "type": "text",
   "chars": 44,
   "fetched": false,
   "truncated": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hydratrader-structured-extract-6acc09d8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.hydratrader.ai](https://www.zero.xyz/host/x402.hydratrader.ai/llms.txt)
