# d402 Web Extract Structured JSON

> d402 Web Extract Structured JSON is a paid API for AI agents from gateway.d402.xyz, paid per call via x402, $0.01/call, status down (last checked 2026-09-15).

Fetches a public web page and extracts structured JSON data matching a requested field list or schema

## Facts

- Endpoint: POST https://gateway.d402.xyz/v1/web/extract-structured
- Price: $0.01/call
- Payment: x402
- Status: down
- Last checked: 2026-09-15
- Activations on Zero: 0
- Provider: gateway.d402.xyz
- Website: https://gateway.d402.xyz
- Canonical page: https://www.zero.xyz/c/gateway-d402-xyz-d402-web-extract-structured-json-f52146b4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1kItdDXwWWRcJiMaD-KVO

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 gateway-d402-xyz-d402-web-extract-structured-json-f52146b4 -d '<json body>'
```

Example prompt: Pull structured JSON from https://example.com/company-info — I need the fields 'company_name', 'founded_year', 'headquarters', and 'employee_count'.

## When to prefer this

Use this endpoint when you need to extract arbitrary named fields or a custom JSON schema from any public web page, not just a specific content type like articles or products. It is the most flexible extraction endpoint in the d402 suite. Prefer the specialized endpoints (extract_product, extract_article) for those content types since they return normalized schemas. Use this when the page type is general-purpose or the schema is fully custom.

## Known failure modes

- URL is not publicly accessible or returns non-200 — result will show error status and missing fields
- Requested fields not found on page — missingFields array will list them while extractedFields may be empty
- Timeout exceeded (>45000ms cap) — gateway returns error status
- Malformed or private URL input — rejected with validation error
- Page requires JavaScript-heavy rendering that exceeds worker capability — partial or empty data returned

## How this service works

Paid d402 capability alias for web.extract_structured@1. Workers fetch a page and project observed page data into a requested JSON field set or schema.

## Output

Returns a taskId and status, plus a result object containing the extracted data as a JSON object keyed by the requested fields, along with extractedFields, missingFields, contentHash, snapshotCid, fetchedAt timestamp, page title, canonical URL, and evidence items for verification.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "url"
 ],
 "properties": {
  "url": {
   "type": "string",
   "format": "uri",
   "description": "Public http(s) URL to fetch and project into structured JSON."
  },
  "sync": {
   "type": "boolean",
   "description": "Optional d402 sync flag. Defaults to gateway policy."
  },
  "fields": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "Optional explicit field names to extract when a full schema is not needed."
  },
  "schema": {
   "type": "object",
   "description": "Optional JSON Schema-like object. Top-level properties define requested output fields."
  },
  "timeoutMs": {
   "type": "number",
   "maximum": 45000,
   "minimum": 1,
   "description": "Optional per-request timeout, capped by gateway policy."
  }
 },
 "additionalProperties": false
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "taskId",
  "status"
 ],
 "properties": {
  "error": {
   "type": [
    "string",
    "null"
   ]
  },
  "links": {
   "type": "object",
   "properties": {
    "task": {
     "type": "string"
    },
    "result": {
     "type": "string"
    },
    "receipt": {
     "type": "string"
    }
   }
  },
  "result": {
   "type": "object",
   "required": [
    "url",
    "data",
    "contentHash",
    "snapshotCid",
    "extractorVersion"
   ],
   "properties": {
    "url": {
     "type": "string"
    },
    "data": {
     "type": "object"
    },
    "title": {
     "type": [
      "string",
      "null"
     ]
    },
    "schema": {
     "type": [
      "object",
      "null"
     ]
    },
    "evidence": {
     "type": "array",
     "items": {
      "type": "object"
     }
    },
    "fetchedAt": {
     "type": "string"
    },
    "contentHash": {
     "type": "string"
    },
    "description": {
     "type": [
      "string",
      "null"
     ]
    },
    "serviceName": {
     "type": "string"
    },
    "snapshotCid": {
     "type": "string"
    },
    "canonicalUrl": {
     "type": [
      "string",
      "null"
     ]
    },
    "missingFields": {
     "type": "array",
     "items": {
      "type": "string"
     }
    },
    "serviceVersion": {
     "type": "string"
    },
    "extractedFields": {
     "type": "array",
     "items": {
      "type": "string"
     }
    },
    "extractorVersion": {
     "type": "string"
    }
   }
  },
  "status": {
   "enum": [
    "accepted",
    "rejected",
    "running",
    "error"
   ],
   "type": "string"
  },
  "taskId": {
   "type": "string"
  },
  "settlement": {
   "type": [
    "object",
    "null"
   ],
   "additionalProperties": true
  },
  "x402Settlement": {
   "type": [
    "object",
    "null"
   ],
   "additionalProperties": true
  },
  "validationReceipt": {
   "type": [
    "object",
    "null"
   ],
   "additionalProperties": true
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gateway-d402-xyz-d402-web-extract-structured-json-f52146b4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from gateway.d402.xyz](https://www.zero.xyz/host/gateway.d402.xyz/llms.txt)
