Docs/Format Utils/POST /v1/xml-to-json

POST /v1/xml-to-jsonConvert XML to JSON

Format Utils lf-format-utils

Turns XML tag-style text into JSON data. Accepts XML text and converts it to a JSON object. Parses flat XML structures with simple child elements.

Query Parameters

ParameterTypeRequiredDescription
xmlstringNoXML text (alt to body)

Response Schema

success (boolean): Operation success
json (object): Parsed JSON object

cURL Example

curl -X POST 'https://lf-format-utils.laminarforge.dev/v1/xml-to-json' -H 'Authorization: Bearer lf_YourApiKey' -H 'Content-Type: text/plain' -d '<root><item>value</item></root>'

Python Example

import requests
url = 'https://lf-format-utils.laminarforge.dev/v1/xml-to-json'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
data = '<root><item>value</item></root>'
response = requests.post(url, headers=headers, data=data)
print(response.json())