Catalog/data-transform-serialize

Data Transform

Canonical JSON serialize API

Serializes JSON with optionally sorted keys, pretty-printed or minified, producing byte-stable deterministic output and a byte count. Answers 'How do I produce canonical sorted-key JSON?', 'How do I minify or pretty-print with stable key order?'.

Price$0.01per request
MethodPOST
Route/v1/data-transform/serialize
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
data-transformserializecanonicalsort-keysminifyprettywrangle
API URLhttps://x402.hexl.dev/v1/data-transform/serialize
Integration docs
Example request
{
  "data": {
    "b": 1,
    "a": 2
  },
  "sortKeys": true,
  "pretty": false
}
Example response
{
  "result": "{\"a\":2,\"b\":1}",
  "bytes": 13
}
Input schema
{
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "examples": [
        {
          "b": 1,
          "a": 2
        }
      ]
    },
    "sortKeys": {
      "type": "boolean",
      "examples": [
        true
      ]
    },
    "pretty": {
      "type": "boolean",
      "examples": [
        false
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}