ForHosting KIT · Data & Files

XML to JSON

XML documents carry meaning in places JSON was never designed to hold — attributes, namespaces, mixed text nodes — and a naive converter throws that meaning away. This endpoint keeps it, mapping attributes into a predictable, documented shape instead of silently dropping them.

● StableFree · in your browser
Use it from WebAPIEmailApp soonTelegram soon

Runs in your browser. Free, unlimited — your data never leaves this page.

The part every quick script gets wrong

Ask a developer to write a five-minute XML-to-JSON converter and you'll get one that handles element text just fine and then quietly discards every attribute, because most XML parsers treat attributes as metadata rather than data. But in real documents — SOAP envelopes, RSS feeds, SVG markup, config files inherited from a decade-old system — the attributes often carry the fields that actually matter: an id, a type, a currency code, a version number sitting on the tag instead of inside it. data.xml_to_json keeps those attributes, consistently prefixed so they never collide with sibling element names.

What you send and what comes back

POST your XML to /data/xml-to-json, receive a task_id immediately, and let the conversion run in the background. The result — clean JSON with attributes, nested elements and repeated tags mapped into arrays — arrives through a signed webhook call or waits behind a signed link valid for 24 hours, whichever your system is set up to poll or receive.

Why XML still shows up in 2026

JSON won the API-payload war years ago, but XML never left: it still runs SOAP services, RSS and Atom feeds, Office document internals, SVG graphics, Android resource files, and a long tail of enterprise systems where a schema-validated, self-describing format was the right call when it was built. Teams building modern integrations don't get to choose the format on the other end of a legacy feed — they get to choose how quickly they normalize it once it arrives, and that's the job this endpoint does.

Fitting into a normalization pipeline

A common pattern is an ingestion layer that accepts whatever a partner or legacy system sends, converts it to JSON immediately, and lets every downstream service — validation, storage, transformation — work against one predictable shape instead of writing custom XML parsing for every source. Because the task is async and priced per request, a nightly batch of a few thousand partner feeds costs the same per document whether it runs at 3am unattended or one file at a time during business hours, and nothing is billed unless the conversion actually succeeds.

SOAP response normalization

An integration layer converts SOAP XML responses from a legacy partner API to JSON before handing them to a modern microservice that only speaks JSON.

RSS and Atom feed ingestion

A content aggregator converts incoming RSS and Atom XML feeds to JSON to store and query them alongside data already coming from JSON APIs.

Legacy config migration

A platform migrating off an old XML-based configuration system converts each config file to JSON once, preserving every attribute needed for the new format.

SVG metadata extraction

A design tool converts SVG files to JSON to read viewBox, id and style attributes programmatically without writing a custom XML parser.

How do I convert XML to JSON with the API?

POST your XML document to /data/xml-to-json, save the returned task_id, and receive the converted JSON by webhook or a signed link valid for 24 hours.

Is the XML to JSON API free?

No, there is no free tier or trial; it costs $0.002 per request, and a failed conversion is never charged.

Are XML attributes preserved in the JSON output?

Yes, attributes are preserved and consistently prefixed in the resulting JSON so they never collide with element names of the same tag.

What happens to XML namespaces?

Namespace prefixes are kept on the element and attribute names they belong to, so downstream code can still tell which namespace a field came from.

Can it handle repeated tags and nested elements?

Yes, repeated sibling tags are mapped into JSON arrays and nested elements become nested objects, matching the document's original structure.

How large a file can I convert?

The endpoint is built for typical document, feed and config-file sizes; very large exports are best split into multiple requests submitted in parallel.

Can I convert files in bulk?

Yes, submit one async task per document and collect each result by webhook as it completes, which is the pattern most batch integrations use.

Is my XML data stored after conversion?

No, source files and results are deleted after the retention window and are never used for training.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/data/xml-to-json

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/data/xml-to-json \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"…"}'
{
  "input": "…"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "data.xml_to_json",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →