Skip to content
Utilerio
All endpoints

XML to JSON

POST/api/v1/tools/xml-to-json

Convert XML documents to readable JSON without touching a server.

Authentication

Requires an API key in the X-API-Key header.

Try it

POST/api/v1/tools/xml-to-json

Parameters

xmlstringrequired

XML document to convert.

keepAttributesbooleanoptional

Include attributes. Default true.

attributePrefixstringoptional

Prefix for attribute keys. Default @_.

trimValuesbooleanoptional

Trim whitespace in values. Default true.

parseNumbersbooleanoptional

Parse numeric values. Default true.

indentintegeroptional

Output indentation. Default 2.

24

Request body

{
  "xml": "<r><a>1</a></r>"
}

Response codes

  • 200Success.
  • 400Invalid request — check your body or parameters.
  • 401Missing or invalid API key.
  • 403The API key is not scoped to this endpoint.
  • 429Rate limit exceeded — retry after a short wait.

Language

cURL

Request

curl -X POST https://utilerio.com/api/v1/tools/xml-to-json \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"xml":"<r><a>1</a></r>"}'

Response

{ "json": "{ \"r\": { \"a\": 1 } }" }