Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

XML to JSON API

Convert XML to JSON.

POST /api/v1/tools/xml-to-jsonMCP xml_to_jsonData & Conversion

Convert XML to JSON in your browser. Keeps attributes with a prefix you choose, groups repeated elements into arrays and reports XML errors by line and column.

Input

Send these as a JSON object. Unknown fields are rejected.

input
The XML text. (string, required)
curl https://pithlab.com/api/v1/tools/xml-to-json \n  -H "Authorization: Bearer $PITHLAB_KEY" \n  -H "Content-Type: application/json" \n  -d '{"input":"<book id=\"1\"><title>Dune</title></book>"}'
Example response
{
  "ok": true,
  "result": {
    "output": "{\n  \"book\": {\n    \"title\": \"Dune\",\n    \"@_id\": \"1\"\n  }\n}"
  }
}