{"slug":"verifylite-hydratinghealingtouch-workers-dev-sanitize-json-1df68a","title":"Turns messy LLM output into valid JSON","host":"verifylite.hydratinghealingtouch.workers.dev","method":"POST","resource":"https://verifylite.hydratinghealingtouch.workers.dev/sanitize-json","category":"code","description":"Turns messy LLM output into valid JSON: strips Markdown code fences and surrounding prose, fixes trailing commas, single quotes, unquoted keys, comments, Python True/None, cut-off brackets, and stringified JSON. Optionally validates the result against a JSON Schema (draft 4 to 2020-12) and lists eac","price_listed":0.0039,"price_asked":0.0039,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":26,"reported_calls_30d":3,"reported_payers_30d":2,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"schema":{"properties":{"age":{"type":"integer"},"name":{"type":"string"}},"required":["name","age"],"type":"object"},"text":"```json\n{'name': 'Ada', 'age': 36,}\n```"},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"additionalProperties":false,"properties":{"schema":{"description":"Optional JSON Schema to validate the repaired data against.","type":"object"},"text":{"description":"The broken JSON or LLM reply, up to 30,000 characters.","type":"string"}},"required":["text"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-10-24","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.0039,"price_match":true,"latency_ms":26,"error":null}],"description_full":"Turns messy LLM output into valid JSON: strips Markdown code fences and surrounding prose, fixes trailing commas, single quotes, unquoted keys, comments, Python True/None, cut-off brackets, and stringified JSON. Optionally validates the result against a JSON Schema (draft 4 to 2020-12) and lists each error with its location. Returns the parsed data, the JSON text, and what was changed. Not charged if no JSON can be recovered or the input is invalid.","last_updated":"2026-10-23T02:26:45.149Z","schemes":["exact"]}