HTTP API reference

JSON, CSV, and XML helper endpoints for integrations.

CORS & rate limits

These endpoints send Access-Control-Allow-Origin: * and accept OPTIONS preflight. A soft limit of 120 requests per minute per IP applies (best-effort on serverless). When exceeded, the API returns 429 with a Retry-After header.

POST /api/format-json

{
  "json": "{\"a\":1}",
  "minify": false,
  "indentSize": 2
}

Response: { "success": true, "formatted": "..." } or errors: string[].

POST /api/convert-csv

{
  "data": "name,age\nAlice,30",
  "mode": "csv-to-json",
  "delimiter": ","
}

Modes: csv-to-json | json-to-csv. Response includes result string on success.

POST /api/parse-xml

{
  "data": "<root><x>1</x></root>",
  "mode": "xml-to-json",
  "compact": false,
  "spaces": 2
}

Modes: xml-to-json | json-to-xml | format | minify.

Base URL in production: set NEXT_PUBLIC_BASE_URL for canonical links. Example origin for local testing: (open in browser)