{"uid":"cap_60EwKESJIE56K5wrC_47v","slug":"apiacre-com-json-repair-b5971efc","name":"apiacre.com JSON Repair","description":"Repair caller-supplied malformed JSON by safely removing an outer Markdown fence, comments, single-quoted strings, unquoted identifier keys, Python literals, and trailing commas, with transformation hashes and strict rejection of duplicate keys or non-finite numbers.","url":"https://apiacre.com/v1/data/json-repair","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"content":{"type":"string"},"repairs":{"type":"array","items":{"enum":["markdown_fence","comments","single_quoted_strings","unquoted_keys","python_literals","trailing_commas"],"type":"string"}}}},"responseSchema":{"type":"json","example":{"data":{"error":null,"valid":true,"repair":{"version":"apiacre-json-repair/1","permitted":["markdown_fence","comments","single_quoted_strings","unquoted_keys","python_literals","trailing_commas"],"executionOrder":["markdown_fence","comments","single_quoted_strings","unquoted_keys","python_literals","trailing_commas"],"appliedStrategyCount":6,"outputCanonicalization":"json-sort-keys-indent-2-utf8"},"content":"{\n  \"active\": true,\n  \"rows\": [\n    1,\n    2,\n    3\n  ],\n  \"status\": \"ok\"\n}","repaired":true,"warnings":[],"validInput":false,"inputSha256":"9dd0095fe6576143aa8e835ced506030e8065e2589c4478a4be1342dc1aaa2ed","outputSha256":"b1b2333ad8949036facfd8ce006b4da0e612468a0e8a9b016514208af13321d5","attemptSha256":"4db25e6c34e4f507a7b3addba28d9c40bda76572ef52c9a7b49facdea7f19440","appliedRepairs":[{"strategy":"markdown_fence","afterSha256":"e47f9ab1e0ee78db083237290fcdd35f83668f2b939c92e434b2103af7856f4f","occurrences":1,"beforeSha256":"9dd0095fe6576143aa8e835ced506030e8065e2589c4478a4be1342dc1aaa2ed"}]},"meta":{"cached":false,"sources":[],"warnings":[],"duration_ms":42,"next_actions":[{"path":"/v1/data/schema","title":"JSON Schema generator","method":"POST","reason":"Infer a reusable Draft 2020-12 contract from the successfully repaired JSON.","service":"data.schema"}]},"service":"data.json-repair","version":"1","request_id":"018f1f54-7f38-7ba2-8dc3-5f90272d9f1a"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_o4waaHDjKbxLAA67TA2fH","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Repairs malformed JSON by removing Markdown fences, comments, single-quoted strings, unquoted keys, Python literals, and trailing commas, with strict duplicate key and non-finite number rejection","exampleAgentPrompt":"I've got some broken JSON from an LLM response — it has a Markdown code fence around it, trailing commas, and single-quoted strings. Can you repair it into valid JSON and give me the cleaned-up result?","exampleUseCases":[{"title":"Fix LLM-generated JSON output","prompt":"The model returned JSON wrapped in a ```json block with trailing commas and Python-style True/False values — can you repair that into valid JSON I can actually parse?"},{"title":"Sanitize user-submitted JSON config","prompt":"A user pasted a config file that has JavaScript-style // comments and unquoted keys like {name: 'Alice'} — clean it up into valid strict JSON for me."},{"title":"Normalize API response with duplicate keys","prompt":"I got a JSON response from a third-party API that has duplicate keys and single-quoted strings — can you repair it and reject it outright if the duplicates make it ambiguous?"}],"resultDescription":"Returns a valid, strictly-conformant JSON document with all recoverable syntax errors fixed, plus a transformation hash describing what was changed. Rejects input that contains duplicate keys or non-finite numbers (e.g. Infinity, NaN) with a clear error.","failureModes":["Input contains duplicate keys — endpoint returns a strict rejection error rather than silently resolving","Non-finite numbers (Infinity, NaN) trigger rejection rather than repair","Input is so severely malformed that no recovery heuristic applies — returns parse failure","Payload too large may result in a timeout or size error","Non-JSON content types (e.g. raw binary) cannot be repaired"],"whenToPreferThis":"Use this endpoint when you receive JSON from an LLM, user input, or a loosely-conformant API that has common syntax issues like Markdown fences, comments, trailing commas, single-quoted strings, unquoted keys, or Python literals. Prefer it over generic JSON parsers when you need deterministic transformation hashes for auditing, strict duplicate key rejection, and safe handling of Python-dialect JSON without writing custom cleanup code.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T12:57:15.913Z","isFirstParty":false}