# Agent Souk Structured Data Extraction API

> Agent Souk Structured Data Extraction API is a paid API for AI agents from api.agentsouk.dev, paid per call via x402, $0.03/call, status unknown (last checked 2026-09-14).

Extracts structured JSON data from arbitrary text using a caller-supplied JSON Schema, powered by an LLM backend

## Facts

- Endpoint: POST https://api.agentsouk.dev/v1/x402/lst_01M1YBDYQJ02BVD0N6H73A6RCM
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-souk-structured-data-extraction-api-0ad7db29
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vJH0sNLGF47q1mPLowVSi

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 agent-souk-structured-data-extraction-api-0ad7db29 -d '<json body>'
```

Example prompt: Extract the invoice date, total amount, vendor name, currency, contact email, and invoice number from this text: 'Invoice #4711 from Acme GmbH dated 2026-09-01. Total: EUR 1,250. Contact: billing@acme.example' — return them as structured JSON with amounts as numbers.

## When to prefer this

Choose this endpoint when you need to convert unstructured or semi-structured text into a precisely defined JSON shape in a single API call, especially when the target schema varies per request. It is ideal for document processing pipelines (invoices, contracts, emails) where you control the output schema and need schema validation confirmation. Prefer this over generic LLM completions when you need guaranteed JSON structure with schema conformance checking, and over dedicated parsers when the document format is variable or unpredictable.

## Known failure modes

- Text too short or empty — minLength:1 enforced, returns 400
- Text exceeds 50,000 character limit — returns 400 or truncation error
- Schema is invalid or not a JSON Schema draft-07/2019-09/2020-12 object — returns 400
- LLM cannot reliably extract requested fields from ambiguous text — schema_valid may be false
- Payment failure via x402 (insufficient USDC balance) — returns 402
- Network timeout if text is very long and model is slow — returns 504

## How this service works

Extract structured JSON from text according to your JSON Schema (LLM) (1 × 10,000 characters at 0.030000 USDC each)

## Output

A JSON object containing a 'data' field with all extracted fields conforming to the provided schema, plus metadata: 'chars' (input character count), 'model' (LLM used, e.g. claude-opus-5), and 'schema_valid' (boolean indicating whether the output passed schema validation).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "maxLength": 50000,
   "minLength": 1
  },
  "schema": {
   "type": "object",
   "description": "A JSON Schema (draft-07, 2019-09 or 2020-12) with type \"object\" at the root"
  },
  "instructions": {
   "type": "string",
   "maxLength": 1000,
   "description": "Optional extraction hints, e.g. \"amounts in EUR as numbers\""
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "date": "2026-09-01",
   "total": 1250,
   "vendor": "Acme GmbH",
   "currency": "EUR",
   "contact_email": "billing@acme.example",
   "invoice_number": "4711"
  },
  "chars": 118,
  "model": "claude-opus-5",
  "schema_valid": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-souk-structured-data-extraction-api-0ad7db29/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentsouk.dev](https://www.zero.xyz/host/api.agentsouk.dev/llms.txt)
