Docs / Data formats

Data formats

Structured text formats look interchangeable and are not. JSON has no comments and no trailing commas, and a parser that tolerates them produces files that stricter parsers reject. YAML turns an unquoted no into false and 1.10 into the number 1.1 in some versions of the language; its full loaders can also build arbitrary objects, which is why only the safe subset is used here. TOML requires a table at the top level, so a JSON array has no TOML form at all. CSV has no settled rules for delimiters, quoting or headers.

The usual failure is not a crash but a lossy round trip: a date becomes a string, a large integer loses its last digits in a language that stores numbers as doubles, a key order changes a signature. Here, a conversion with no faithful form in the target format, such as a JSON array into TOML, is refused with the reason, and large integers keep every digit.

Errors are meant to be read by the person or program that has to fix the input. A JSON syntax error names the line, the column and the text around it, because "invalid JSON" on a large document is no help at all.

Two endpoints are guarded more tightly than the rest. Regular expressions run on the RE2 engine, which cannot backtrack catastrophically and therefore has no backreferences or lookaround. JSON Schema validation never fetches a remote $ref, so a schema cannot make this service send a request anywhere.

Every endpoint in this group

/format/json/validate?text=

Validate JSON; errors give line, column and context

text: JSON document (URL-encoded)

curl "https://agent-helper.org/format/json/validate?text=%7B%22a%22%3A%5B1%2C2%2C3%5D%7D"

/format/json/pretty?text=&[indent=]&[sort_keys=]

Pretty-print JSON

text: JSON document (URL-encoded); indent (optional): spaces, 0-8; sort_keys (optional): sort object keys

curl "https://agent-helper.org/format/json/pretty?text=%7B%22b%22%3A1%2C%22a%22%3A%5B1%2C2%5D%7D&sort_keys=true"

/format/json/minify?text=

Minify JSON

text: JSON document (URL-encoded)

curl "https://agent-helper.org/format/json/minify?text=%7B%20%22a%22%20%3A%20%5B1%2C%202%5D%20%7D"

/format/jsonpath?json=&path=

Query JSON with JSONPath (filters supported)

json: JSON document; path: JSONPath expression

curl "https://agent-helper.org/format/jsonpath?json=%7B%22items%22%3A%5B%7B%22n%22%3A%22a%22%2C%22qty%22%3A2%7D%2C%7B%22n%22%3A%22b%22%2C%22qty%22%3A0%7D%5D%7D&path=%24.items%5B%3F(%40.qty%20%3E%200)%5D.n"

/format/json-schema?json=&schema=

Validate a JSON document against a JSON Schema

json: JSON document; schema: JSON Schema; draft from $schema, default 2020-12; remote $ref is never fetched

curl "https://agent-helper.org/format/json-schema?json=%7B%22age%22%3A-1%7D&schema=%7B%22type%22%3A%22object%22%2C%22properties%22%3A%7B%22age%22%3A%7B%22type%22%3A%22integer%22%2C%22minimum%22%3A0%7D%7D%7D"

/format/yaml/to-json?text=

YAML to JSON (safe loader only)

text: YAML document

curl "https://agent-helper.org/format/yaml/to-json?text=a%3A%201%0Ab%3A%20%5Bx%2C%20y%5D"

/format/json/to-yaml?text=

JSON to YAML

text: JSON document

curl "https://agent-helper.org/format/json/to-yaml?text=%7B%22a%22%3A1%2C%22b%22%3A%5B%22x%22%2C%22y%22%5D%7D"

/format/toml/to-json?text=

TOML to JSON

text: TOML document

curl "https://agent-helper.org/format/toml/to-json?text=title%20%3D%20%22x%22%0A%5Bowner%5D%0Aname%20%3D%20%22y%22"

/format/json/to-toml?text=

JSON object to TOML

text: JSON document

curl "https://agent-helper.org/format/json/to-toml?text=%7B%22title%22%3A%22x%22%2C%22owner%22%3A%7B%22name%22%3A%22y%22%7D%7D"

/format/csv/to-json?text=&[delimiter=]&[header=]

CSV to JSON (header row becomes keys)

text: CSV document; delimiter (optional): field delimiter; detected if omitted; header (optional): first row is a header

curl "https://agent-helper.org/format/csv/to-json?text=name%2Cqty%0Aapple%2C3%0Apear%2C5"

/format/json/to-csv?text=&[delimiter=]

JSON array of objects to CSV

text: JSON document; delimiter (optional): field delimiter

curl "https://agent-helper.org/format/json/to-csv?text=%5B%7B%22name%22%3A%22apple%22%2C%22qty%22%3A3%7D%2C%7B%22name%22%3A%22pear%22%2C%22qty%22%3A5%7D%5D"

/format/diff?a=&b=&[context=]

Unified diff of two texts

a: original text; b: changed text; context (optional): context lines, 0-20

curl "https://agent-helper.org/format/diff?a=one%0Atwo%0Athree&b=one%0A2%0Athree"

/format/regex/test?pattern=&text=&[flags=]&[limit=]

Run a regular expression over text on the RE2 engine: matches, positions, groups

pattern: regular expression, RE2 syntax (no backreferences, no lookaround: they are what makes backtracking catastrophic); text: text to search; flags (optional): any of i m s U; limit (optional): maximum matches, 1-1000

curl "https://agent-helper.org/format/regex/test?pattern=(%5Cd%7B4%7D)-(%5Cd%7B2%7D)&text=from%202026-09%20to%202027-01"