# JSON Structural Drift

> JSON Structural Drift is a paid API for AI agents from api.zfinia.com, paid per call via x402, $0.1/call, status unknown (last checked 2026-10-11).

Compares a batch of JSON documents against a reference document to detect shape drift: missing paths, changed types, and added paths, with arrays normalized by shape rather than index.

## Facts

- Endpoint: POST https://api.zfinia.com/x402/v1/json-structural-drift?utm_source=zero.xyz
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-structural-drift-25ac4362
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WvzspcbEkcNe7G20wqYyl

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 json-structural-drift-25ac4362 -d '<json body>'
```

Example prompt: I have a reference JSON payload from our API and a batch of 50 recent responses — can you compare them all against the reference and tell me which paths are missing, which changed type, and which are new additions?

## When to prefer this

Choose this endpoint when you have a real example payload but no formal JSON Schema or OpenAPI spec, and you need to quickly understand how a batch of documents has drifted from that reference shape. It is especially useful for monitoring third-party API responses, ETL data quality checks, or any scenario where the source of truth is a sample document rather than a written schema.

## Known failure modes

- Empty or malformed documents array returns a validation error
- Reference document missing causes a 400 bad request
- Batch exceeds 500 items returns a 422 or limit error
- Deeply nested or circular-like structures may produce verbose output
- Non-JSON input types cause parse errors

## How this service works

Compare a batch of documents against one reference document and report where the shape drifted: locations the reference has that the batch lacks, locations that changed type, and locations the batch added. Array indices are generalised, so a two-item list and a three-item list are the same shape. Useful when you have an example payload and no schema.

## Output

Returns a drift report listing: paths present in the reference but missing from batch documents, paths that exist in both but whose JSON type changed, and paths that appear in the batch but not in the reference. Array indices are generalized so shape differences are not confused with size differences.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "documents": {
   "type": "array",
   "items": {},
   "maxItems": 500,
   "minItems": 1
  },
  "reference": {},
  "allow_additional": {
   "type": "boolean"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-structural-drift-25ac4362/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.zfinia.com](https://www.zero.xyz/host/api.zfinia.com/llms.txt)
