# SiteCheck JSON Repair

> SiteCheck JSON Repair is a paid API for AI agents from api.sitecheck-api.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-20).

Repairs malformed or broken JSON text and optionally validates the result against a provided JSON Schema

## Facts

- Endpoint: POST https://api.sitecheck-api.workers.dev/api/json/repair?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/sitecheck-json-repair-686e9ffb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Tf9TYTG44mvj7R98Nrm9v

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 sitecheck-json-repair-686e9ffb -d '<json body>'
```

Example prompt: This JSON string has syntax errors — single quotes, trailing commas, and unclosed brackets — can you repair it and validate it against my schema so I get back a clean, valid JSON object?

## When to prefer this

Use this endpoint when you have JSON text with common syntax errors like trailing commas, single quotes, comments, or unbalanced brackets that need programmatic repair without manual editing. Prefer it over LLM-based JSON fixing when you need an audit trail of exactly what was changed, or when you want schema validation built into the same call. Well-suited for pipeline stages that receive JSON from scrapers, LLMs, or user input where quality is unpredictable.

## Known failure modes

- Input exceeds 1 MB limit — rejected
- JSON is so severely malformed it cannot be heuristically repaired — problems array will be non-empty and valid will be false
- Provided JSON Schema is itself invalid — validation step may error
- Repaired value does not satisfy the optional schema — valid flag is false with schema violations listed

## How this service works

Repairs broken JSON: markdown fences, comments, trailing commas, single quotes, unquoted keys, Python literals (True, False, None) and truncated endings. Pure code first; the model is asked once only when code cannot repair it. Optional JSON Schema check covers type, required, properties, items, enum, minimum, maximum, minLength, maxLength and pattern. Input max 1 MB.

## Output

Returns a JSON object containing the repaired value, a boolean indicating whether the result is valid, an array of fix descriptions (e.g. 'replaced single quotes', 'removed trailing commas', 'closed unbalanced brackets'), an array of remaining problems if any, a timestamp, and a flag indicating whether an AI model was used for repair.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "The broken JSON text (max 1 MB)"
  },
  "schema": {
   "type": "object",
   "description": "Optional JSON Schema to validate the repaired value against"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "fixes": [
   "replaced single quotes or removed comments",
   "removed trailing commas",
   "closed unbalanced brackets"
  ],
  "valid": true,
  "value": {
   "name": "Ada",
   "langs": [
    "en",
    "fr"
   ]
  },
  "problems": [],
  "checkedAt": "2026-10-15T18:21:12.802Z",
  "usedModel": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/sitecheck-json-repair-686e9ffb/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.sitecheck-api.workers.dev](https://www.zero.xyz/host/api.sitecheck-api.workers.dev/llms.txt)
