Data Transform
XML to JSON API
Converts a simple XML document to JSON with attributes as @attr, text as #text, and repeated elements collapsed into arrays. Answers 'How do I convert XML to JSON?', 'How do I turn an XML API response into an object?'.
Price$0.02per request
MethodPOST
Route/v1/data-transform/xml-json
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
data-transformxmljsonconvertparseattributeswrangle
API URL
Integration docshttps://x402.hexl.dev/v1/data-transform/xml-jsonExample request
{
"xml": "<root id=\"1\"><item>a</item><item>b</item></root>"
}Example response
{
"result": {
"root": {
"@id": "1",
"item": [
"a",
"b"
]
}
}
}Input schema
{
"type": "object",
"required": [
"xml"
],
"properties": {
"xml": {
"type": "string",
"examples": [
"<root id=\"1\"><item>a</item><item>b</item></root>"
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}