{
  "serviceId": "structured-extraction",
  "displayName": "Structured Extraction",
  "description": "Rule-based extraction of named fields from text; not a language model, it returns only what the text states. POST /v1/extract with {text, schema}: schema is a JSON Schema, a list of field names, or {fields: {name: regex}}. Built-in fields include email, phone, date, url, money and company; other fields come from \"Label: value\" lines. Pay per request in USDC; no account, no API key.",
  "category": "documents",
  "resourceUrl": "https://test.agent.pocket.network/v1/structured-extraction",
  "priceUsd": "0.005000",
  "priceVersion": 1,
  "rails": [
    {
      "id": "base",
      "network": "eip155:84532",
      "chainId": 84532,
      "tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
      "tokenDecimals": 6,
      "payToAddress": "0xF732ea490c5766071785a2310523f7fA2CEbB829"
    }
  ],
  "paymentNetworks": [
    "eip155:84532"
  ],
  "paymentProtocols": [
    "x402"
  ],
  "protocols": [
    "rest"
  ],
  "inputSchema": {
    "type": "object",
    "description": "The request body for POST /v1/extract.",
    "properties": {
      "text": {
        "type": "string",
        "description": "The text to extract from."
      },
      "schema": {
        "description": "A JSON Schema with properties, a list of field names, or {fields: {name: regex}}."
      }
    },
    "required": [
      "text",
      "schema"
    ]
  },
  "outputSchema": {
    "type": "object",
    "description": "For POST /v1/extract, a JSON object with `fields` (null when not found), matched_by and schema_mode. The exact shape is the service's own and is not pinned here; errors return a JSON object with an `error` field."
  },
  "methods": {
    "GET /v1/health": "read",
    "GET /v1/version": "read",
    "POST /v1/extract": "read"
  },
  "example": {
    "method": "POST",
    "path": "/v1/extract",
    "request": {
      "text": "Contact: john@example.com",
      "schema": [
        "email"
      ]
    },
    "response": {
      "portal": {
        "provenance": "third-party-supplier",
        "serviceId": "structured-extraction",
        "schemaCheck": "unchecked"
      },
      "data": {
        "fields": {
          "email": "john@example.com"
        },
        "matched_by": {
          "email": "builtin:email"
        },
        "deterministic": true,
        "schema_mode": "field_names",
        "service": "structured-extraction"
      }
    },
    "capturedAt": "2026-09-25T15:53:30Z"
  },
  "firstParty": true,
  "networks": [
    "eip155:84532"
  ],
  "serving": true,
  "page": "https://test.agent.pocket.network/services/structured-extraction",
  "descriptor": "https://test.agent.pocket.network/services/structured-extraction/descriptor.json"
}