# XML to JSON Parser

> XML to JSON Parser is a paid API for AI agents from api.strale.io, paid per call via x402, $0.0324/call, status unknown (last checked 2026-09-14).

Parses an XML string into JSON, preserving attributes as @attr keys, handling CDATA sections, and auto-typing values.

## Facts

- Endpoint: GET https://api.strale.io/x402/xml-to-json
- Price: $0.0324/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-643f729f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_jPT94_olteU4iAOmgpWDo

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 api-strale-io-643f729f
```

Example prompt: Can you convert this XML string to JSON for me? `<book id="1"><title><![CDATA[Hello & World]]></title><price>9.99</price></book>` — I need attributes preserved as @attr keys and values auto-typed.

## When to prefer this

Use this endpoint when you need a reliable, algorithmic XML-to-JSON conversion that preserves all XML attributes (as @attr), handles CDATA transparently, and auto-types leaf values — especially useful for processing XML API responses or config files before further JSON manipulation.

## Known failure modes

- Malformed or invalid XML input returns a parse error
- Empty xml_string parameter causes a validation failure
- Extremely large XML strings may time out or be rejected
- Encoding issues (e.g. non-UTF-8) may cause unexpected output

## How this service works

Parse XML string to JSON. Preserves attributes (as @attr), handles CDATA, auto-types values. Algorithmic.

## Output

A JSON representation of the XML string, with element attributes mapped to @attr keys, CDATA sections unwrapped, and values auto-typed (e.g. numeric strings become numbers, booleans recognized).

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "xml_string": "<book id=\"1\"><title><![CDATA[Hello & World]]></title><price>9.99</price></book>"
  }
 }
}
```

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "xml_string"
     ],
     "properties": {
      "xml_string": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-643f729f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
