Data Format Converter: JSON, XML, YAML, CSV and TSV avatar

Data Format Converter: JSON, XML, YAML, CSV and TSV

Pricing

from $1.80 / 1,000 document converteds

Go to Apify Store
Data Format Converter: JSON, XML, YAML, CSV and TSV

Data Format Converter: JSON, XML, YAML, CSV and TSV

Converts JSON, JSON Lines, XML, YAML, CSV and TSV files, URLs, pasted text or Apify datasets to any of the other formats, with nested object flattening, record path selection and type detection. Returns a download link for each file.

Pricing

from $1.80 / 1,000 document converteds

Rating

0.0

(0)

Developer

Ed Rayyis

Ed Rayyis

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Share

Convert data files between JSON, JSON Lines, XML, YAML, CSV and TSV. Give it file URLs, pasted text or the IDs of Apify datasets, pick the output format, and get one converted file per source with a download link.

What it does

  • Reads JSON, JSON Lines, XML, YAML, CSV and TSV, and writes any of them.
  • Detects the input format from the file extension, the content type and the content. You can also set it.
  • For CSV, TSV and JSON Lines output, it finds the list of records for you. An RSS feed becomes one row per rss.channel.item, and a GitHub workflow becomes one row per step. Set a record path such as data.results to choose another part.
  • Flattens nested objects into path columns such as address.city and company.name. Lists inside a record become one column per item (tags.0, tags.1), one cell joined with semicolons, or one cell of JSON text.
  • Keeps only the columns you list, in your order.
  • Rebuilds nested objects and lists from CSV path columns, so address.city and tags.0 go back to an object and a list in JSON or YAML.
  • Detects numbers, true, false and null in CSV and XML. Values with a leading zero (007, 01234) stay text, and so do values that would change when read as a number (2.10, 1e5).
  • Reads YAML booleans the YAML 1.2 way: only true and false. A key such as on: in a workflow file stays the text on.
  • Keeps XML attributes under keys that start with @, and element text next to attributes under #text. Keys that are not valid XML names are made valid when writing XML.
  • Reads Apify datasets in your account, so you can turn a scraper's results into XML or YAML.

Input

  • File URLs: public URLs, up to 50 MB each
  • Pasted data: one document per entry
  • Apify dataset IDs
  • Input format (default auto detect) and output format (default CSV)
  • Record path (optional dot path)
  • Tabular output: flatten nested objects (default on), path separator (default .), lists inside records, columns to keep, header row, CSV output delimiter
  • CSV and XML input: input delimiter (default detect), header row, detect numbers and booleans, values read as null, rebuild nested objects
  • JSON, XML and YAML output: indent, XML root and item element names, XML attribute prefix

Output

Each converted file goes to the run's key value store. The dataset holds one item per source with source, ok, inputFormat, outputFormat, recordPath, recordCount, columnCount, columns, outputKey, outputUrl (download link), outputBytes and a preview of the first 1,500 characters. A source that fails gets ok: false and an error such as HTTP 404, a JSON syntax error with its line and column, or Dataset was not found. The other sources still convert.

Pricing

Pay per event: one event per source converted. A source that fails is not charged. The run stops when it reaches the maximum charge you set.

Scope and conduct

Only the URLs you list are downloaded, once each. XML entity declarations are refused, so a file cannot expand itself or read local files. Nothing is stored beyond the run's own storage.

Support

Questions and problems: the Issues tab on this page. Replies are written by an AI assistant on behalf of the developer and reviewed by the developer.