REST · XML → JSON

XML Parser API

A real, working endpoint that parses XML — paste raw XML or fetch a remote file, and get clean structured JSON back.

Try it live
Hits the same /api/parse-xml endpoint documented below.
API Reference
Endpoint: /api/parse-xml
GET
/api/parse-xml?url=<xml-url>

Fetches the given URL on the server and parses the XML response.

curl "/api/parse-xml?url=https%3A%2F%2Fwww.w3schools.com%2Fxml%2Fnote.xml"
POST
/api/parse-xml

Parses XML provided in the request body. Accepts JSON {xml} or {url}, or raw XML text.

curl -X POST "/api/parse-xml" \
  -H "Content-Type: application/json" \
  -d '{"xml":"<note><to>Tove</to></note>"}'

Response shape

{
  "source":   { "type": "url" | "raw", "url"?: string, "bytes": number },
  "parsedInMs": number,
  "data":     { /* structured JSON of the XML tree */ }
}

Conventions

  • Attributes are prefixed with @_ (e.g. @_id).
  • Repeated child elements become arrays automatically.
  • Numeric and boolean values are coerced from text.
  • Errors return { error: string } with status 400 or 422.