Data Format Conversion API
Deterministic data-format conversion — the shape work an LLM cannot do reliably token-by-token. POST {data, from, to}: JSON, NDJSON, CSV, TSV, or a SQL INSERT dump in; any of the same out. Handles RFC 4180 quoting (commas, quotes, newlines in values), flattens nested objects to dot-notation columns, unions ragged records into a stable column set, and parses SQL string literals with '' and \' escapes. No AI, no network — same input, same bytes, every time.
Parameters
| Name | In | Description | |
|---|---|---|---|
data | body | required | The dataset as a string (up to ~4MB) |
from | body | json (default), ndjson, csv, tsv, or sql | |
to | body | csv (default), tsv, json, ndjson, or sql | |
flatten | body | Flatten nested objects to dot-notation columns (default true) | |
header | body | CSV/TSV input has a header row (default true) | |
infer_types | body | Convert numeric/boolean/null strings on input (default true); leading zeros stay strings | |
delimiter | body | Override the delimiter for csv/tsv | |
table | body | Table name when to=sql (default 'data') |
Example request
curl -X POST "https://api.webbersites.com/api/data/convert" \
-H "Content-Type: application/json" \
-d '{"data":"[{\"id\":1,\"user\":{\"name\":\"Ann\"}},{\"id\":2,\"user\":{\"name\":\"Bo\"}}]","from":"json","to":"csv"}'
# first call returns 402 + payment requirements; an x402 client pays and retries automaticallyExample response
{
"from": "json",
"to": "csv",
"rows": 2,
"columns": [
"id",
"user.name"
],
"output": "id,user.name\n1,Ann\n2,Bo",
"bytes": 26
}How payment works
There is no signup and no API key. Call the endpoint; it replies 402 Payment Required with machine-readable payment requirements. Your client signs a USDC transfer authorization (EIP-3009, gasless) and retries with the X-PAYMENT header — @x402/fetch does this automatically. See the overview for a working snippet.