# Saylor Innovations XML to JSON Converter

> Saylor Innovations XML to JSON Converter is a paid API for AI agents from saylorinnovations.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-12-02).

Converts an XML document to JSON, mapping attributes as @keys, repeated elements as arrays, and handling CDATA, while rejecting DOCTYPE and external entities for safety.

## Facts

- Endpoint: GET https://saylorinnovations.com/api/convert/xml-to-json?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/saylor-innovations-xml-to-json-converter-64d89d33
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JLqqJO8kh9UJfie9VDDYL

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability saylor-innovations-xml-to-json-converter-64d89d33
```

Example prompt: Can you convert this XML to JSON for me? I've got a chunk of XML — attributes should become @keys, repeated elements should become arrays — here it is: <catalog><book id="1"><title>The Way of Code</title></book><book id="2"><title>Deep Systems</title></book></catalog>

## When to prefer this

Choose this endpoint when you need a secure, structured XML-to-JSON conversion that safely rejects DOCTYPE and entity injection attacks (XXE prevention), faithfully represents XML attributes as @keys, collapses repeated sibling elements into arrays, and handles CDATA sections — especially useful for processing legacy API responses, SOAP payloads, RSS/Atom feeds, or configuration XML files up to 12,000 characters.

## Known failure modes

- XML input exceeds 12,000 character limit — request rejected
- Malformed or invalid XML returns a parse error
- DOCTYPE declaration present in XML — rejected by security policy
- External entity references (XXE) in XML — rejected by parser
- Missing required 'xml' query parameter — validation error
- Empty XML string — parse error

## How this service works

Convert XML to JSON with attributes as @keys, repeated elements as arrays, CDATA and entities handled, using a parser that rejects DOCTYPE and entities

## Output

Returns a JSON object containing the root element name, the full document parsed as a nested JSON object (XML attributes as @-prefixed keys, text content as #text, repeated sibling elements as arrays), the number of elements parsed, the maximum nesting depth, an optional note with caveats, and an optional source label. DOCTYPE declarations and external entities are rejected for security.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "xml"
     ],
     "properties": {
      "xml": {
       "type": "string",
       "description": "XML document, up to 12000 characters"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "json"
    },
    "example": {
     "type": "object",
     "required": [
      "root",
      "json"
     ],
     "properties": {
      "json": {
       "type": "object",
       "properties": {
        "order": {
         "type": [
          "object"
         ],
         "properties": {
          "@id": {
           "type": [
            "string"
           ]
          },
          "item": {
           "type": [
            "array"
           ],
           "items": {
            "type": [
             "object"
            ],
            "properties": {
             "@sku": {
              "type": [
               "string"
              ]
             },
             "#text": {
              "type": [
               "string"
              ]
             }
            },
            "additionalProperties": true
           }
          },
          "note": {
           "type": [
            "string"
           ]
          }
         },
         "additionalProperties": true
        }
       },
       "description": "The document as JSON: attributes as @keys, text as #text, repeated elements as arrays",
       "additionalProperties": true
      },
      "note": {
       "type": "string",
       "description": "Caveat or context for reading the result"
      },
      "root": {
       "type": "string",
       "description": "Name of the root element"
      },
      "source": {
       "type": "string",
       "description": "Data source the values come from"
      },
      "elements": {
       "type": "number",
       "description": "Number of elements parsed"
      },
      "max_depth": {
       "type": "number",
       "description": "Max depth"
      },
      "checked_at": {
  
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/saylor-innovations-xml-to-json-converter-64d89d33/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from saylorinnovations.com](https://www.zero.xyz/host/saylorinnovations.com/llms.txt)
