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

Descripción general

Casos de uso

  • 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

Funcionalidades

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)

Puntos finales de la API

Convert Format

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

POST
https://requiems.xyz/v1/technology/format

Parámetros

Nombre Tipo Obligatorio Descripción
from string Obligatorio Source format. One of: json, yaml, csv, xml, toml
to string Obligatorio Target format. One of: json, yaml, csv, xml, toml
content string Obligatorio The content to convert, serialized as a string in the source format.

Pruébalo

Demostración en vivo
Solicitud

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.

Campos de respuesta

Campo Tipo Descripción
result string The converted content serialized in the target format.

Ejemplos de código

# JSON → YAML
curl -X POST https://requiems.xyz/v1/technology/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://requiems.xyz/v1/technology/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"}'

Respuestas de error

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.

Preguntas frecuentes