Data Format Conversion

Convert structured data between JSON, YAML, CSV, XML, and TOML in a single API call. Accepts any supported format as input and returns the content serialized in the target format.

Get API Key

Overview

Use Cases

  • Transform configuration files between formats (TOML β†’ YAML, JSON β†’ TOML)
  • Convert exported data for downstream tools that only accept specific formats
  • Normalize API responses into CSV for spreadsheet ingestion
  • Build developer tools and data pipeline utilities

Features

Supports JSON, YAML, CSV, XML, and TOML as both input and output
Input capped at 512 KB
Descriptive parse errors with the problematic format identified
Numbers preserved with correct types (integers stay integers, floats stay floats)
CSV headers derived from JSON object keys (alphabetically sorted)

API Endpoints

Convert Format

Convert content from one structured data format to another. Supported formats: json, yaml, csv, xml, toml.

POST
https://api.requiems.xyz/v1/convert/format

Parameters

Name Type Required Description
from string Required Source format. One of: json, yaml, csv, xml, toml
to string Required Target format. One of: json, yaml, csv, xml, toml
content string Required The content to convert, serialized as a string in the source format.

Try it out

Live Demo
Request

Source format. One of: json, yaml, csv, xml, toml

Target format. One of: json, yaml, csv, xml, toml

The content to convert, serialized as a string in the source format.

Response Fields

Field Type Description
result string The converted content serialized in the target format.

Code Examples

# JSON β†’ YAML
curl -X POST https://api.requiems.xyz/v1/convert/format \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"json","to":"yaml","content":"{\"name\":\"Alice\",\"age\":30}"}'

# CSV β†’ JSON
curl -X POST https://api.requiems.xyz/v1/convert/format \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"csv","to":"json","content":"name,age\nAlice,30\nBob,25"}'

Error Responses

validation_failed

One of from, to, or content is missing, or from/to is not one of the supported format values.

invalid_json

The content field is not valid JSON (when from is json).

invalid_yaml

The content field is not valid YAML (when from is yaml).

invalid_csv

The content field is not valid CSV, or a row has more columns than the header (when from is csv).

invalid_xml

The content field is not valid XML (when from is xml).

invalid_toml

The content field is not valid TOML (when from is toml).

conversion_error

The data structure is incompatible with the target format (e.g. converting a JSON array to TOML, which requires a top-level object).

content_too_large

The content field exceeds the 512 KB limit.

Frequently Asked Questions