xtract.bot
POST /api/toml-to-json

Parse a TOML document into JSON. Tables become objects, arrays-of-tables become arrays-of-objects. TOML date/time values are emitted as ISO-8601 strings.

Parses a TOML document and emits the equivalent JSON. Tables become objects, arrays-of-tables become arrays-of-objects, inline tables become inline objects. Dates and times are serialised as ISO-8601 strings. Useful when ingesting `Cargo.toml` / `pyproject.toml` / `config.toml` files into a JSON-based pipeline.

Inputs

NameTypeDefaultDescription
toml*stringTOML source.

Response

Modes: json. Cache: yes (24h TTL).

Code samples

Built from the config example.


curl -X POST https://api.xtract.bot/api/toml-to-json \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
  -H "X-Api-Key: $XTRACT_API_KEY" \
  -d '{
  "toml": "title = \"config\"\n[server]\nhost = \"0.0.0.0\"\nport = 8080\nfeatures = [\"a\", \"b\"]\n"
}'