{"uid":"cap_jPT94_olteU4iAOmgpWDo","slug":"api-strale-io-643f729f","name":"XML to JSON Parser","description":"Parse XML string to JSON. Preserves attributes (as @attr), handles CDATA, auto-types values. Algorithmic.","url":"https://api.strale.io/x402/xml-to-json","method":"GET","headers":{},"bodySchema":{"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}}},"responseSchema":null,"example":{"request":{"input":{"type":"http","method":"GET","queryParams":{"xml_string":"<book id=\"1\"><title><![CDATA[Hello & World]]></title><price>9.99</price></book>"}}},"response":{"json":{"book":{"@id":"1","price":9.99,"title":null}},"_meta":{"payment":{"method":"x402","price_usd":0.0324,"settlement_id":"0xd93af8e3ac8980092baa18308f24ab0cb24bae28d755fda73985754fde51e918"},"capability":"xml-to-json","latency_ms":1,"provenance":{"source":"algorithmic","fetched_at":"2026-06-16T01:24:43.921Z"}},"root_element":"book","element_count":3,"attributes_preserved":true}},"exampleRequest":{"xml_string":"<book id=\"1\"><title><![CDATA[Hello & World]]></title><price>9.99</price></book>"},"tags":["x402"],"displayCostAmount":"0.0324","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.0324/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0324","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0324","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_XPMnOOn_K9moApikfOLLj","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0324","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Parses an XML string into JSON, preserving attributes as @attr keys, handling CDATA sections, and auto-typing values.","exampleAgentPrompt":"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.","exampleUseCases":null,"resultDescription":"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).","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:57:29.518Z","isFirstParty":false}