{"uid":"cap_dyxBHfQ4ZZVOCUss8Nt1P","slug":"validate-json-0923047a","name":"Validate JSON","description":"Check whether text is valid JSON and, when it is not, return the exact parse error position and message. Pure CPU, instant. Use to gate a payload before sending it downstream.","url":"https://api.gadgethumans.com/json-validate?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"input":{"type":"object","properties":{"queryParams":{"type":"object","required":["json"],"properties":{"json":{"type":"string","description":"JSON text to validate"}}}}},"output":{"type":"object","properties":{"example":{"ok":true}}}}},"responseSchema":{"type":"json","example":{"ok":true}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_JaQFnYNtJMYFjlm1Di-iW","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Checks whether a text string is valid JSON and returns the exact parse error position and message if it is not.","exampleAgentPrompt":"Can you check if this string is valid JSON and tell me exactly where the error is if not: '{\"name\": \"Alice\", \"age\": 30, \"city\": \"New York\"}'?","exampleUseCases":[{"title":"Gate payload before API submission","prompt":"Before I send this JSON body to the payments API, check if it's actually valid JSON and show me the exact error position if something's wrong: '{\"amount\":100,\"currency\":\"USD\",\"recipient\":\"bob@example.com\"}'."},{"title":"Debug malformed config file","prompt":"My app is crashing on startup — can you validate this config JSON for me and tell me exactly where the syntax error is? Here it is: '{\"host\":\"localhost\",\"port\":8080,\"debug\":true,\"tags\":[\"web\",\"api\"]}'."},{"title":"Validate user-submitted JSON input","prompt":"A user just submitted this as JSON input in our form — check whether it's actually valid JSON and give me the parse error message and position if it's broken: '{\"username\":\"jdoe\",\"roles\":[\"admin\",\"editor\"]}'."}],"resultDescription":"Returns a JSON object with an 'ok' boolean indicating validity. If the input is invalid JSON, the response includes the parse error message and the exact character position where the error occurred.","failureModes":["Missing 'json' query parameter returns an error","Extremely large strings may hit query parameter length limits","Network timeout (unlikely given pure CPU operation)","Empty string input may return a parse error rather than a clean invalid signal"],"whenToPreferThis":"Use this endpoint when you need a fast, cheap, pure-CPU JSON syntax check with precise error position reporting before passing a payload to a downstream service. Ideal for input validation gates in pipelines, form submission handlers, or agent workflows that must verify JSON structure before further processing.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-12-03T18:53:53.730Z","isFirstParty":false,"canonicalSlug":"validate-json-0923047a"}