🧩

Data Convert

Convert between structured data formats (JSON, CSV, XML, YAML, TOML).

GET 1 credit /v1/convert/data
curl "https://convert.toolkitapi.io/v1/convert/data?url=https://toolkitapi.io/config.yaml&from_format=yaml&to_format=json"
import httpx

resp = httpx.get(
    "https://convert.toolkitapi.io/v1/convert/data?url=https://toolkitapi.io/config.yaml&from_format=yaml&to_format=json",
)
print(resp.json())
const resp = await fetch("https://convert.toolkitapi.io/v1/convert/data?url=https://toolkitapi.io/config.yaml&from_format=yaml&to_format=json", {
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "result": {"name": "example", "version": "1.0.0"},
  "metadata": {"format": "json"}
}

Try It Live

Live Demo

Description

Convert between structured data formats (JSON, CSV, XML, YAML, TOML).

How to Use

1

1. Call this endpoint with `from_format`, `to_format`, and either `data` (inline) or `url`.

2

2. Set any format-specific options: `delimiter`, `has_header`, `skip_rows` (CSV), `root_element`, `pretty`, `strip_namespaces`, `force_list` (XML), `flow_style` (YAML), `document_index` (YAML multi-doc).

3

3. Read the converted payload from `result`.

About This Tool

The unified data converter moves between `json`, `csv`, `xml`, `yaml`, and `toml`. Pass the source either inline (`data`) or via a public `url`, plus format-specific options — delimiters, root element names, pretty-printing, namespace stripping, and more.

This endpoint is the building block behind the individual `-to-` endpoints and is useful when you want to perform cross-cutting conversions in a single call.

Why Use This Tool

Frequently Asked Questions

Which source/target pairs are supported?
All combinations of `json`, `csv`, `xml`, `yaml`, `toml` — 20 pairs in total. CSV implies tabular input; non-tabular JSON can be represented as a single-row CSV of stringified values.
Are nested structures preserved?
In JSON, XML, YAML, and TOML, yes. CSV is flat; nested data is JSON-stringified into cells.
How are type coercions handled?
Numbers, booleans, and nulls are round-tripped between format-native types. Dates are kept as strings.

Start using Data Convert now

Get your free API key and make your first request in under a minute.