{"uid":"cap_ntZZLBbPWWw9p6ndk6TrF","slug":"xml-json-converter-cdabafe2","name":"XML ↔ JSON Converter","description":"Convert XML to JSON (attributes prefixed with @, text as #text, repeated tags become arrays) or JSON back to XML. Give from/to and the source string.","url":"https://api.24klabs.ai/api/v1/xml-json-convert?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"to":{"type":"string"},"from":{"type":"string"},"input":{"type":"string"}}},"responseSchema":{"type":"json","example":{"result":{"note":{"to":"Ann","from":"Bo"}}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_E2HgEhPPhYzdCg5PGFTJ9","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Bidirectionally converts between XML and JSON strings, with attributes prefixed by @, text nodes as #text, and repeated tags collapsed into arrays.","exampleAgentPrompt":"Convert this XML string to JSON for me: '<users><user id=\"1\"><name>Alice</name></user><user id=\"2\"><name>Bob</name></user></users>' — direction is xml-to-json.","exampleUseCases":[{"title":"Parse SOAP API XML response","prompt":"I got this XML back from a SOAP endpoint and need it as JSON so my app can process it — convert it from XML to JSON: '<response><status code=\"200\">OK</status><items><item>foo</item><item>bar</item></items></response>'"},{"title":"Feed legacy system with XML","prompt":"My legacy system only accepts XML — take this JSON object '{\"order\":{\"id\":\"42\",\"product\":\"widget\",\"qty\":3}}' and convert it to XML for me."},{"title":"Normalize RSS feed data","prompt":"I have an RSS feed payload in XML and I want to work with it as JSON — can you convert this XML to JSON: '<rss><channel><title>My Blog</title><item><title>Post 1</title></item><item><title>Post 2</title></item></channel></rss>'?"}],"resultDescription":"Returns the converted string in the target format. XML→JSON output uses @ prefix for XML attributes, #text for text node content, and collapses repeated sibling tags into arrays. JSON→XML output reconstructs the XML document from the JSON structure.","failureModes":["Malformed XML input causes parse error with descriptive message","Invalid JSON input returns parse error","Missing 'from' or 'to' direction parameter returns validation error","Deeply nested or extremely large documents may hit size/depth limits","Unsupported encoding or non-UTF-8 characters may cause transformation errors"],"whenToPreferThis":"Choose this endpoint when you need a simple, reliable XML↔JSON round-trip conversion with consistent conventions (@ for attributes, #text for text nodes, arrays for repeated tags). Ideal for agents processing legacy XML APIs, RSS/Atom feeds, SOAP responses, or configuration files that need to be converted for downstream JSON-first systems — or vice versa.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-20T06:31:17.130Z","isFirstParty":false,"canonicalSlug":"xml-json-converter-cdabafe2"}