{"uid":"cap_HMmCCkw2zq6ZLq61jcfat","slug":"fastx402-json-canonicalize-e45f4280","name":"FastX402 JSON Canonicalize","description":"200 pay-per-call tools for AI agents, from $0.001 per request in USDC on Base or Solana with x402. No account, no API key.","url":"https://fastx402.tools/json-canonicalize?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["json"],"properties":{"json":{"type":"string","description":"The JSON text to canonicalize"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"valid":{"type":"boolean"},"canonical":{"type":"string"}}}}}}},"responseSchema":{"type":"json","example":{"valid":true,"canonical":"{\"a\":[3,2,{\"y\":true,\"z\":null}],\"b\":1}"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_lF-ley1gosXNNZyYzlUbF","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts a JSON string into its canonical (deterministic, normalized) form according to RFC 8785 or similar canonicalization rules, returning the canonical string and validity status.","exampleAgentPrompt":"Canonicalize this JSON for me so I can hash it reliably: '{\"b\":1,\"a\":[3,2,{\"z\":null,\"y\":true}]}'","exampleUseCases":[{"title":"Canonical JSON before signing a payload","prompt":"I need to sign a JSON payload with my private key, but first canonicalize it so the signature is deterministic — here's the object: '{\"user\":\"alice\",\"amount\":100,\"currency\":\"USD\"}'"},{"title":"Comparing two JSON objects for equality","prompt":"Can you canonicalize these two JSON strings so I can check if they're actually equal regardless of key order or whitespace? First: '{\"z\":1,\"a\":2}', second: '{\"a\":2,\"z\":1}'"},{"title":"Generating a stable content hash for a JSON record","prompt":"I want a stable SHA-256 hash of this JSON record but the key order keeps changing — canonicalize '{\"timestamp\":\"2024-01-01\",\"event\":\"login\",\"userId\":42}' so the hash is always the same."}],"resultDescription":"Returns a JSON object with a 'valid' boolean indicating whether the input was parseable JSON, and a 'canonical' string containing the deterministically serialized, key-sorted, whitespace-normalized canonical form of the input JSON.","failureModes":["Invalid or malformed JSON input returns valid:false with no canonical output","Missing required 'json' query parameter results in an error response","Extremely large JSON payloads may time out or exceed size limits","Non-string values passed as the json parameter may be rejected"],"whenToPreferThis":"Choose this endpoint when you need a deterministic, normalized JSON string — especially for cryptographic use cases like signing, hashing, or Merkle trees — and you do not want to implement RFC 8785 canonicalization yourself. It is preferable over generic JSON formatters when key ordering and whitespace determinism are required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T01:01:11.570Z","isFirstParty":false,"canonicalSlug":"fastx402-json-canonicalize-e45f4280"}