VOOZH about

URL: https://apify.com/maximedupre/xml-json-converter

⇱ XML JSON Converter for XML and JSON Data Β· Apify


Pricing

$0.20 / 1,000 completed conversions

Go to Apify Store

XML JSON Converter

Convert XML to JSON and JSON to XML from pasted data or public URLs. Run one task or bulk conversions, then export structured JSON, XML strings, source URLs, and input previews from the dataset.

Pricing

$0.20 / 1,000 completed conversions

Rating

0.0

(0)

Developer

πŸ‘ Maxime DuprΓ©

Maxime DuprΓ©

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

11 days ago

Last modified

Categories

Share

πŸ”„ XML JSON converter for bulk data conversion

XML JSON Converter converts XML to JSON and JSON to XML from pasted data or public URLs. Use it when you need a clean Apify dataset for API workflows, exports, integrations, config migration, RSS or SOAP response cleanup, or repeatable structured data conversion.

Each successful conversion is saved as one dataset item. XML-to-JSON tasks return structured JSON in convertedJson, so you can query or export the result without parsing a JSON string yourself. JSON-to-XML tasks return an XML string in convertedXml, including an XML declaration and your chosen root element.

The Actor auto-detects whether each task is XML or JSON. Add one task for a quick conversion, or add many tasks to process a batch in one run.

βœ… What this Actor does

  • Converts XML to JSON from pasted XML or a public XML URL.
  • Converts JSON to XML from pasted JSON or a public JSON URL.
  • Auto-detects the conversion direction for each task.
  • Handles bulk conversion tasks in one run.
  • Preserves XML attributes under @attributes when converting to JSON.
  • Supports nested XML, repeated elements, CDATA, text nodes, namespace-prefixed names, objects, arrays, strings, numbers, booleans, and nulls where the parser can represent them.
  • Lets you choose readable or compact output.
  • Lets you set the XML root element and array item element for JSON-to-XML output.
  • Skips invalid or unreachable tasks while continuing with the rest of the batch.
  • Saves only successful conversions to the dataset.

This Actor is a deterministic converter. It does not use AI, repair invalid XML or JSON, infer schemas, convert CSV/YAML/HTML, crawl websites, or access private URLs that require login.

πŸ“₯ Input

Add conversion tasks in tasks. Each task can contain pasted data, a public URL, or both. If both are present, the pasted data is used for that task.

{
"tasks":[
{
"inputData":"<catalog><book id=\"1\"><title>Dune</title><author>Frank Herbert</author></book></catalog>"
},
{
"inputData":"{\"employees\":[{\"name\":\"Alice\",\"role\":\"Engineer\"},{\"name\":\"Bob\",\"role\":\"Manager\"}]}"
},
{
"inputUrl":"https://www.w3schools.com/xml/note.xml"
}
],
"prettyPrint":true,
"rootElement":"company",
"arrayItemElement":"employee"
}

🧾 Input fields

FieldWhat it does
tasksList of XML or JSON conversion tasks. Each item can use inputData or inputUrl.
inputDataPasted XML or JSON text for one task.
inputUrlPublic HTTP or HTTPS URL of an XML or JSON file.
prettyPrintKeeps converted XML readable when true. Turn it off for compact XML.
rootElementRoot element name for JSON-to-XML output.
arrayItemElementElement name for JSON array items when an array needs an item wrapper.

Private or authenticated files should be fetched outside the Actor and pasted into inputData. The Actor does not accept cookies, source credentials, or API keys for source URLs.

πŸ“€ Output

Each dataset item is one successful conversion.

FieldDescription
taskIndex1-based position of the task in your input.
sourceUrlPublic URL used for the task, or null when pasted data was used.
inputPreviewShort preview of the converted input.
convertedJsonStructured JSON value for XML-to-JSON tasks. null for JSON-to-XML tasks.
convertedXmlXML string for JSON-to-XML tasks. null for XML-to-JSON tasks.

πŸ§ͺ XML to JSON output example

{
"taskIndex":1,
"sourceUrl":null,
"inputPreview":"<catalog><book id=\"1\"><title>Dune</title><author>Frank Herbert</author></book></catalog>",
"convertedJson":{
"catalog":{
"book":{
"@attributes":{
"id":1
},
"title":"Dune",
"author":"Frank Herbert"
}
}
},
"convertedXml":null
}

πŸ§ͺ JSON to XML output example

{
"taskIndex":2,
"sourceUrl":null,
"inputPreview":"{\"employees\":[{\"name\":\"Alice\",\"role\":\"Engineer\"}]}",
"convertedJson":null,
"convertedXml":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<company>\n <employees>\n <name>Alice</name>\n <role>Engineer</role>\n </employees>\n</company>"
}

πŸš€ How to run it

  1. Open the Actor input.
  2. Add one or more items in Conversion tasks.
  3. Paste XML or JSON into inputData, or add a public XML/JSON URL in inputUrl.
  4. Keep Readable output on for easier inspection, or turn it off for compact XML output.
  5. Set XML root element and XML array item element when you are converting JSON to XML.
  6. Run the Actor and open the dataset.

For an Apify QA-style first run, keep the prefilled XML and JSON batch. For a tiny manual test, delete most tasks and leave one XML task plus one JSON task.

πŸ’‘ Common use cases

  • Convert XML API responses to structured JSON for analysis.
  • Convert JSON payloads to XML for legacy systems.
  • Batch-convert config files, feeds, or integration payloads.
  • Keep source URL and task position attached to each converted result.
  • Schedule repeat conversions for public XML or JSON files.
  • Export converted data to JSON, CSV, Excel, XML, RSS, or HTML from Apify.
  • Use the dataset through the Apify API, webhooks, or integrations.

πŸ’° Pricing

The Actor charges only for successful conversions. Invalid XML, invalid JSON, empty tasks, unreachable URLs, and unsupported URLs do not save dataset items and are not charged as completed conversions.

The local pricing event is conversion-completed at $0.0002 per successful conversion. There is no actor-start charge in the pricing artifact.

⚠️ Limits and caveats

  • Source URLs must be public http or https URLs.
  • Private URLs, signed URLs that expire, login-only files, cookies, and source credentials are not supported.
  • Invalid XML and invalid JSON are skipped and reported in logs.
  • The Actor preserves parser-backed structure, but it does not semantically repair malformed data.
  • JSON-to-XML element names come from your rootElement, arrayItemElement, and JSON object keys, so use XML-safe names.
  • This is not a universal data converter. CSV, TSV, YAML, HTML table extraction, and website crawling are outside this Actor.

❓ FAQ

Can this convert XML to JSON from a URL?

Yes. Add a public XML URL in inputUrl. The output is saved in convertedJson.

Can this convert JSON to XML?

Yes. Paste JSON or add a public JSON URL. The output is saved in convertedXml.

Do I need to choose XML to JSON or JSON to XML?

No. The Actor auto-detects the input format for each task.

What happens when one task is invalid?

The invalid task is skipped, a warning is logged, and the rest of the batch continues. Only successful conversions are saved to the dataset.

Does it support authenticated URLs?

No. For private or authenticated files, fetch the content yourself and paste it into inputData.

πŸ“ Changelog

  • 0.0: Initial release.

πŸ†˜ Support

For issues, questions, or feature requests, file a ticket and I'll fix or implement it in less than 24h 🫑

πŸ”— Other actors

  • RSS Feed Reader β†— - Read public RSS, Atom, RDF, and JSON Feed URLs into clean feed item data.
  • Sitemap Sniffer β†— - Find sitemap files, sitemap indexes, and optional URL inventory rows for SEO audits.
  • Robots.txt Generator β†— - Generate deployable robots.txt files from presets, bot rules, sitemap URLs, and host directives.
  • Font Detector β†— - Detect loaded web fonts, CSS font-family declarations, and font source evidence from public pages.
  • Email MX Verifier β†— - Check email syntax, MX records, disposable domains, role addresses, and list-cleaning decisions.

Made with ❀️ by Maxime Dupré

You might also like

Data Converter β€” JSON, CSV & XML

accurate_pouch/data-converter

Convert between JSON, CSV, and XML formats in bulk. JSON to CSV, CSV to JSON, JSON to XML, XML to JSON. Handles quoted fields, nested objects. $0.003/conversion.

πŸ‘ User avatar

Manchitt Sanan

2

XML to JSON Converter

eloquent_mountain/xml-to-json-converter

XML to JSON Converter Convert any XML file to JSON effortlessly with this Apify actor. Handle complex XML structures and transform them into structured JSON data. Supports input via URL or direct text paste, making it easy to integrate into your data processing workflows.

JSON To XML Converter

zsoftware/json-to-xml-converter

Easily convert structured JSON data into well-formed XML. This actor accepts raw JSON text or a file and outputs clean, standards-compliant XMLβ€”perfect for data transformation pipelines, integrations, or legacy system compatibility.

XML to JSON Converter

rainminer/xml-to-json-converter

Parse XML documents to structured JSON. Accepts a URL or raw XML string. Automatically unwraps repeated elements into individual dataset rows. Built for AI agents and data pipelines.

RSS / XML Scraper

jupri/rss-xml-scraper

πŸ’« Scrape RSS / XML / Sitemap or other XML

Data Format Converter - CSV, JSON, XML Transformation

ntriqpro/data-format-converter

Convert data between common formats: CSV, JSON, and XML. Bulk transform files without manual work.

CSV to JSON Converter

rainminer/csv-to-json-converter

Parse XML documents to structured JSON. Accepts a URL or raw XML string. Automatically unwraps repeated elements into individual dataset rows. Built for AI agents and data pipelines.

RSS / XML Scraper

shahidirfan/RSS-XML-Scraper

Meet the RSS / XML Scraper: the most advanced actor for parsing any RSS feed or XML file. It effortlessly extracts clean, structured data from even the most complex sources. Your ultimate tool for content aggregation, data monitoring, and content analysis.

100

5.0

Related articles

How to parse XML in JavaScript (step-by-step guide)
Read more
How to parse JSON with Python
Read more
How to parse XML in Python
Read more