{
  "x402Version": 2,
  "id": 29574,
  "slug": "29574",
  "resource": "https://netintel.dev/json/repair",
  "description": "Repair malformed JSON into valid JSON — fixes code fences, trailing commas, single quotes, unquoted keys, bad escapes, duplicate keys, truncation, and JSON buried in prose. A deterministic tokenizer runs first (no LLM cost), with an optional Haiku fallback, plus optional schema validation and type coercion — so agents can rescue broken model output or dirty data in one call.",
  "type": "http",
  "serviceName": "NetIntel",
  "iconUrl": "https://res.cloudinary.com/bdb-prod/image/upload/c_fill,ar_1:1,w_256,h_256,f_auto,q_auto/v1784214098/bazaar-icons/7d2bf437631b2e4e.png",
  "resourceType": "AI Inference",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0xdaDc335482AD545296Fd7b28518A251fFCbEb9Df",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "20000",
      "amountUsd": 0.02,
      "maxTimeoutSeconds": 300
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "8FVeybWnB4dYrxTuPK7WzFZNAiEcFVaDLFnKpRwVGr5s",
      "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "amount": "20000",
      "amountUsd": 0.02,
      "maxTimeoutSeconds": 300
    }
  ],
  "outputSchema": {
    "properties": {
      "example": {
        "properties": {
          "changes": {
            "type": "array"
          },
          "confidence": {
            "type": "number"
          },
          "findings": {
            "type": "array"
          },
          "grade": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "repair_succeeded": {
            "type": "boolean"
          },
          "repaired": {
            "type": [
              "object",
              "array",
              "null"
            ]
          },
          "schema_valid": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "score": {
            "type": "number"
          },
          "validation_errors": {
            "type": "array"
          },
          "warnings": {
            "type": "array"
          },
          "was_valid": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "type": {
        "type": "string"
      }
    },
    "required": [
      "type"
    ],
    "type": "object"
  },
  "extensions": {
    "bazaar": {
      "info": {
        "input": {
          "body": {
            "input": "```json\n{'name': 'acme', 'ports': [80, 443,],}\n```"
          },
          "bodyType": "json",
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "changes": [
              "removed markdown code fences",
              "converted 3 single-quoted strings to double-quoted",
              "removed 2 trailing commas"
            ],
            "confidence": 1,
            "findings": [],
            "grade": "A",
            "method": "deterministic",
            "repair_succeeded": true,
            "repaired": {
              "name": "acme",
              "ports": [
                80,
                443
              ]
            },
            "schema_valid": null,
            "score": 100,
            "validation_errors": [],
            "warnings": [],
            "was_valid": false
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "properties": {
                  "allow_llm": {
                    "description": "Default true. When false, deterministic-only: if the tokenizer cannot fix the input, repair_succeeded is false (still a 200).",
                    "type": "boolean"
                  },
                  "coerce": {
                    "description": "Default false. With a schema supplied, coerce values to the declared types where lossless (\"5\" → 5, \"yes\" → true).",
                    "type": "boolean"
                  },
                  "input": {
                    "description": "The malformed JSON, as a string. May include markdown code fences or surrounding prose. Max 100KB.",
                    "type": "string"
                  },
                  "schema": {
                    "description": "Optional. Validate the repaired JSON against this schema. Accepts a flat field→type map ({\"n\":\"number\"}) or a JSON-Schema-shaped object ({\"type\":\"object\",\"properties\":{...},\"required\":[...]}). Types: string, number, integer, boolean, object, array, null.",
                    "type": "object"
                  }
                },
                "required": [
                  "input"
                ],
                "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": {
                "properties": {
                  "changes": {
                    "type": "array"
                  },
                  "confidence": {
                    "type": "number"
                  },
                  "findings": {
                    "type": "array"
                  },
                  "grade": {
                    "type": "string"
                  },
                  "method": {
                    "type": "string"
                  },
                  "repair_succeeded": {
                    "type": "boolean"
                  },
                  "repaired": {
                    "type": [
                      "object",
                      "array",
                      "null"
                    ]
                  },
                  "schema_valid": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "score": {
                    "type": "number"
                  },
                  "validation_errors": {
                    "type": "array"
                  },
                  "warnings": {
                    "type": "array"
                  },
                  "was_valid": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "json repair",
    "fix json",
    "malformed json",
    "data cleaning",
    "json parser",
    "bazaar"
  ],
  "sourceHost": "netintel.dev",
  "lastUpdated": "2026-10-08T06:08:35.018Z",
  "quality": {
    "calls30d": 2,
    "uniquePayers30d": 2,
    "lastCalledAt": "2026-10-08T06:08:34.824Z"
  },
  "metadata": {
    "serviceName": "NetIntel",
    "iconUrl": "https://res.cloudinary.com/bdb-prod/image/upload/c_fill,ar_1:1,w_256,h_256,f_auto,q_auto/v1784214098/bazaar-icons/7d2bf437631b2e4e.png",
    "extensions": {
      "bazaar": {
        "info": {
          "input": {
            "body": {
              "input": "```json\n{'name': 'acme', 'ports': [80, 443,],}\n```"
            },
            "bodyType": "json",
            "method": "POST",
            "type": "http"
          },
          "output": {
            "example": {
              "changes": [
                "removed markdown code fences",
                "converted 3 single-quoted strings to double-quoted",
                "removed 2 trailing commas"
              ],
              "confidence": 1,
              "findings": [],
              "grade": "A",
              "method": "deterministic",
              "repair_succeeded": true,
              "repaired": {
                "name": "acme",
                "ports": [
                  80,
                  443
                ]
              },
              "schema_valid": null,
              "score": 100,
              "validation_errors": [],
              "warnings": [],
              "was_valid": false
            },
            "type": "json"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "additionalProperties": false,
              "properties": {
                "body": {
                  "properties": {
                    "allow_llm": {
                      "description": "Default true. When false, deterministic-only: if the tokenizer cannot fix the input, repair_succeeded is false (still a 200).",
                      "type": "boolean"
                    },
                    "coerce": {
                      "description": "Default false. With a schema supplied, coerce values to the declared types where lossless (\"5\" → 5, \"yes\" → true).",
                      "type": "boolean"
                    },
                    "input": {
                      "description": "The malformed JSON, as a string. May include markdown code fences or surrounding prose. Max 100KB.",
                      "type": "string"
                    },
                    "schema": {
                      "description": "Optional. Validate the repaired JSON against this schema. Accepts a flat field→type map ({\"n\":\"number\"}) or a JSON-Schema-shaped object ({\"type\":\"object\",\"properties\":{...},\"required\":[...]}). Types: string, number, integer, boolean, object, array, null.",
                      "type": "object"
                    }
                  },
                  "required": [
                    "input"
                  ],
                  "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": {
                  "properties": {
                    "changes": {
                      "type": "array"
                    },
                    "confidence": {
                      "type": "number"
                    },
                    "findings": {
                      "type": "array"
                    },
                    "grade": {
                      "type": "string"
                    },
                    "method": {
                      "type": "string"
                    },
                    "repair_succeeded": {
                      "type": "boolean"
                    },
                    "repaired": {
                      "type": [
                        "object",
                        "array",
                        "null"
                      ]
                    },
                    "schema_valid": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "score": {
                      "type": "number"
                    },
                    "validation_errors": {
                      "type": "array"
                    },
                    "warnings": {
                      "type": "array"
                    },
                    "was_valid": {
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": "object"
            }
          },
          "required": [
            "input"
          ],
          "type": "object"
        }
      }
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": false,
  "featured": false,
  "provider": {
    "host": "netintel.dev",
    "manifest_name": "netintel.dev",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-10-14T01:15:01.050Z"
  },
  "exampleResponse": {
    "changes": [
      "removed markdown code fences",
      "converted 3 single-quoted strings to double-quoted",
      "removed 2 trailing commas"
    ],
    "confidence": 1,
    "findings": [],
    "grade": "A",
    "method": "deterministic",
    "repair_succeeded": true,
    "repaired": {
      "name": "acme",
      "ports": [
        80,
        443
      ]
    },
    "schema_valid": null,
    "score": 100,
    "validation_errors": [],
    "warnings": [],
    "was_valid": false
  }
}