TOML Validator

Validate TOML strings and convert to JSON.

POST 1 credit /v1/toml-validate
curl -X POST "https://devtools.toolkitapi.io/v1/toml-validate" \
  -H "Content-Type: application/json" \
  -d '{"data": "[database]\nserver = \"192.168.1.1\"\nports = [8000, 8001]\nenabled = true"}'
import httpx

resp = httpx.post(
    "https://devtools.toolkitapi.io/v1/toml-validate",
    json={"data": "[database]\nserver = \"192.168.1.1\"\nports = [8000, 8001]\nenabled = true"},
)
print(resp.json())
const resp = await fetch("https://devtools.toolkitapi.io/v1/toml-validate", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"data": "[database]\nserver = \"192.168.1.1\"\nports = [8000, 8001]\nenabled = true"}),
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "valid": true,
  "as_json": {
    "database": {
      "server": "192.168.1.1",
      "ports": [8000, 8001],
      "enabled": true
    }
  }
}

Try It Live

Live Demo

Description

Validate TOML strings and convert to JSON.

How to Use

1

1. Send a POST request with the `data` field containing your TOML string.

2

2. If `valid` is `true`, the `as_json` field contains the parsed data as JSON.

3

3. If `valid` is `false`, the `error` field describes the problem.

About This Tool

TOML Validator checks whether a string is valid TOML and returns the parsed result as JSON. Useful for validating `pyproject.toml`, `Cargo.toml`, or any TOML config before deployment.

Why Use This Tool

Frequently Asked Questions

Which TOML version is supported?
The validator uses Python's built-in `tomllib` which supports TOML v1.0.0.

Start using TOML Validator now

Get your free API key and make your first request in under a minute.