81trust / 100
Json Format
by JSON validate & format in Documents & files
x402 APIPassing, checked 58 min ago
Validate, pretty-print (any indentation, 0-8 spaces), or minify JSON, optionally with object keys sorted. canonical: true returns the RFC 8785 (JCS) canonical form - keys sorted, no whitespace, ECMAScript number and string serialization - plus its SHA-256, for hashing and signing. Numbers are read as IEEE-754 doubles and a duplicate key keeps its last value. Returns parse errors with position when invalid.
POST https://agent402.tools/api/json-format
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 100%
- Response time
- 180 ms typical, 180 ms slowest 5%
- Last check
- 58 min ago
- Next check
- any minute now
How to call it
# See the payment challenge (nothing is charged)
curl -i -X POST "https://agent402.tools/api/json-format" \
-H "content-type: application/json" \
-d '{"indent":2,"json":"{\"b\":2,\"a\":1}","sortKeys":true}'import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client().register(
"eip155:8453",
new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagent402.tools%2Fapi%2Fjson-format
const res = await pay("https://agent402.tools/api/json-format", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"indent":2,"json":"{\"b\":2,\"a\":1}","sortKeys":true}),
});
console.log(await res.json());Example input
{
"indent": 2,
"json": "{\"b\":2,\"a\":1}",
"sortKeys": true
}Example output
{
"formatted": "{\n \"a\": 1,\n \"b\": 2\n}",
"valid": true
}Security scan
- No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 58 min ago | Passed | 402 | 183 ms | $0.001 |
| 6 h ago | Passed | 402 | 180 ms | $0.001 |