XML to JSON and CSV Converter: Files, Feeds, Datasets
Pricing
from $1.05 / 1,000 converted documents
XML to JSON and CSV Converter: Files, Feeds, Datasets
Convert XML files, feeds or pasted XML to JSON and CSV. One dataset row per record via a record path, attributes, namespaces, force-list and flatten-to-dot-keys for CSV. Safe parsing (no external entities). Empty input = free demo.
Pricing
from $1.05 / 1,000 converted documents
Rating
0.0
(0)
Developer
Actor Factory
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
5 days ago
Last modified
Categories
Features
Share
XML to JSON and CSV converter: one dataset row per record, from XML files, feeds or pasted text.
If you have product feeds, RSS and Atom files, pom.xml files, SOAP or API responses, or exports from old systems in XML and you need rows for a spreadsheet, database or script, this Actor does the parsing for you. Give it XML file URLs and/or paste XML, name the element that repeats (the record path, like catalog/product), and every record comes back as one row. Attributes, namespaces, single-versus-repeated elements and nested values are handled with options you control. You pay per converted document, with no monthly rent.
Try it free: clear the input and press Start. A built-in sample product catalog is converted (not charged; rows carry _demo: true).
What you get
Input XML:
<catalog><product id="p-100"><name>USB-C cable</name><price currency="USD">9.90</price></product><product id="p-101"><name>Desk lamp</name><price currency="USD">24.50</price></product></catalog>
With record path catalog/product and Flatten to dot keys on, you get two rows:
| @id | name | price.@currency | price.#text |
|---|---|---|---|
| p-100 | USB-C cable | USD | 9.90 |
| p-101 | Desk lamp | USD | 24.50 |
- One dataset row per record (or one row per document if no record path). Each row also carries
_source,_documentand_record. - JSON and CSV files in the run's key-value store: all records of each input, plus
combined.json/combined.csvwhen you give several inputs. - Error rows for malformed XML with the 1-based line and column. They are free.
How to use
- XML text (paste it) and/or XML file URLs (public http(s) links, feeds included). Up to 100 inputs per run.
- Record path: the repeating element, e.g.
catalog/productorrss/channel/item. A simple XPath like//item[@type='a']also works. Empty = one row per document. - Optional: attribute prefix (default
@), text key (default#text), namespaces (strip or keep), always a list (element names that must be arrays even when they occur once), flatten to dot keys for CSV, convert numbers and booleans, output files, formula-safe CSV, max records.
{"fileUrls": ["https://example.com/feed/products.xml"],"recordPath": "rss/channel/item","forceList": ["category"],"flatten": true}
Output details
- Attributes become keys with the prefix (
@currency). An element with attributes or children and text keeps the text under the text key. - Repeated elements become lists; use Always a list so a record with one
<tag>has the same shape as one with three. - Namespaces: stripped by default (
dc:titlebecomestitle). With keep, prefixes stay in names andxmlnsdeclarations appear as attributes. - Values stay text unless you turn on number and boolean conversion (this keeps leading zeros and long IDs safe).
- Flatten:
a.b.0.ckeys, so CSV columns are real columns. Without it, nested values are JSON text in CSV cells. - CSV: columns are the union of keys in first-seen order. With formula-safe on, text starting with
=,+,@(or-when not a number) gets an apostrophe so spreadsheets never run it as a formula. - Comments and processing instructions are dropped. Mixed text around child elements is joined with spaces.
- Encoding: files are read using the encoding in their XML declaration (UTF-8, UTF-16, ISO-8859-1 and so on).
Safety and limits (cannot be raised by input)
- XML is parsed with lxml in a locked-down mode: no external entities, no network access, no DTD loading. Any
<!ENTITY ...>declaration is refused with an error row, so XXE and "billion laughs" files cannot do anything. - 100 inputs per run, 10 MB per input, 100,000 records per input, output files up to 50 MB.
- Public files only, no login. Links to internal network addresses are blocked.
Pricing
Pay per event: $0.0015 per converted document ($1.50 per 1,000), however many records the document holds. Parse errors, failed downloads, inputs over a limit and the demo are free. Store discounts apply automatically: BRONZE -10%, SILVER -20%, GOLD -30%. If the maximum charge you set for the run is used up, remaining inputs get a free error row instead.
FAQ
Is it an XML validator or parser? It checks that the XML is well-formed (errors come with line and column). It does not validate against an XSD.
Can it handle huge files? Up to 10 MB per input. Split larger files, or use a narrower record path and max records.
Can I call it from code? Yes, through the Apify API: send {"xml": "...", "recordPath": "..."} and read the dataset items.
If this Actor saved you time, a rating on the Store helps others find it.
More tools from the same developer
- YAML to JSON Converter — YAML to JSON and JSON to YAML from text or files, with syntax errors by line and column
- Flatten JSON to CSV — flatten nested JSON into flat rows with the separator you choose
- JSON to CSV Converter — turn nested JSON files or datasets into one flat CSV file
- CSV to Excel Converter — convert CSV, TSV, Excel XLSX, JSON and NDJSON files or Apify datasets into each other