Repair JSON
Fix broken or incomplete JSON, including text from language models.
POST /v1/json-repair
Repair broken JSON, hash text, chunk Markdown, convert YAML or XML, and more. People and AI agents can call these tools over HTTPS. Heavy jobs (PDFs, Word files, crawling) are not on this API — those live on our paid Apify actors.
You do not need a key to try it. Send JSON to any tool:
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/hash -H "Content-Type: application/json" -d '{"text":"hello"}'
Want a higher free cap, or a key for marketplaces? Create one instantly. We show the key once:
curl -sS -X POST https://tidybytetools.tidybytetools.workers.dev/keys -H "Content-Type: application/json" -d '{"label":"my agent"}'
Then send it as Authorization: Bearer tbt_..., or X-Api-Key, or an api_key query parameter. Never put a key in the URL path.
19 pure-compute endpoints. They run at the edge. They do not fetch other websites or open files like PDFs.
Fix broken or incomplete JSON, including text from language models.
POST /v1/json-repair
Turn text into Base64, or Base64 back into text. URL-safe and data URIs work too.
POST /v1/base64
SHA-256, SHA-1, MD5, and SHA-512 checksums of text.
POST /v1/hash
Turn key-value lines, CSV, or a Markdown table into clean JSON.
POST /v1/json-shaper
Pretty-print or shrink valid JSON.
POST /v1/json-format
Split Markdown into heading-aware chunks for search and RAG.
POST /v1/md-chunk
Line-level diff of two strings, plus a unified patch.
POST /v1/text-diff
Convert a common YAML subset to JSON, or JSON to YAML.
POST /v1/yaml-json
Convert XML to JSON, or a JSON object back to XML.
POST /v1/xml-json
Strip scripts and unsafe markup. Keeps a short allow-list of tags.
POST /v1/html-sanitize
Parse a messy date and convert it to a timezone you choose.
POST /v1/date-timezone
Percent-encode or decode a string or query map.
POST /v1/url-codec
NFC, NFD, NFKC, or NFKD normalization, plus a character count.
POST /v1/unicode
Create a UUID, ULID, or NanoID.
POST /v1/id-generate
Read a JWT header and payload. This does not check the signature.
POST /v1/jwt-decode
Explain a 5- or 6-field cron string and list the next fire times in UTC.
POST /v1/cron-parse
Check or fill the check digit on a barcode number.
POST /v1/gtin-checksum
Pretty-print a SQL query. This is a lightweight formatter, not a full SQL parser.
POST /v1/sql-format
Convert length, mass, temperature, volume, time, area, speed, and data-size units.
POST /v1/unit-convert
Each example is a real request body you can copy. Optional key headers are shown as comments in the Python and JS samples.
/v1/json-repairFix broken or incomplete JSON, including text from language models.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/json-repair \
-H "Content-Type: application/json" \
-d '{"text":"{name: 'Ada', ok: True,}"}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/json-repair",
json={
"text": "{name: 'Ada', ok: True,}"
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/json-repair", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"text": "{name: 'Ada', ok: True,}"
}),
});
const data = await res.json();
console.log(data);
/v1/base64Turn text into Base64, or Base64 back into text. URL-safe and data URIs work too.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/base64 \
-H "Content-Type: application/json" \
-d '{"action":"encode","text":"hello"}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/base64",
json={
"action": "encode",
"text": "hello"
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/base64", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"action": "encode",
"text": "hello"
}),
});
const data = await res.json();
console.log(data);
/v1/hashSHA-256, SHA-1, MD5, and SHA-512 checksums of text.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/hash \
-H "Content-Type: application/json" \
-d '{"text":"hello","algorithms":["sha256","md5"]}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/hash",
json={
"text": "hello",
"algorithms": [
"sha256",
"md5"
]
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/hash", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"text": "hello",
"algorithms": [
"sha256",
"md5"
]
}),
});
const data = await res.json();
console.log(data);
/v1/json-shaperTurn key-value lines, CSV, or a Markdown table into clean JSON.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/json-shaper \
-H "Content-Type: application/json" \
-d '{"text":"name: Ada\nyear: 1815"}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/json-shaper",
json={
"text": "name: Ada\nyear: 1815"
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/json-shaper", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"text": "name: Ada\nyear: 1815"
}),
});
const data = await res.json();
console.log(data);
/v1/json-formatPretty-print or shrink valid JSON.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/json-format \
-H "Content-Type: application/json" \
-d '{"text":"{\"a\":1,\"b\":[2,3]}","mode":"pretty"}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/json-format",
json={
"text": "{\"a\":1,\"b\":[2,3]}",
"mode": "pretty"
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/json-format", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"text": "{\"a\":1,\"b\":[2,3]}",
"mode": "pretty"
}),
});
const data = await res.json();
console.log(data);
/v1/md-chunkSplit Markdown into heading-aware chunks for search and RAG.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/md-chunk \
-H "Content-Type: application/json" \
-d '{"text":"# Title\n\nHello.\n\n## Part\n\nMore text.","maxChars":400}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/md-chunk",
json={
"text": "# Title\n\nHello.\n\n## Part\n\nMore text.",
"maxChars": 400
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/md-chunk", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"text": "# Title\n\nHello.\n\n## Part\n\nMore text.",
"maxChars": 400
}),
});
const data = await res.json();
console.log(data);
/v1/text-diffLine-level diff of two strings, plus a unified patch.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/text-diff \
-H "Content-Type: application/json" \
-d '{"a":"one\ntwo\nthree","b":"one\ntwo changed\nthree"}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/text-diff",
json={
"a": "one\ntwo\nthree",
"b": "one\ntwo changed\nthree"
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/text-diff", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"a": "one\ntwo\nthree",
"b": "one\ntwo changed\nthree"
}),
});
const data = await res.json();
console.log(data);
/v1/yaml-jsonConvert a common YAML subset to JSON, or JSON to YAML.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/yaml-json \
-H "Content-Type: application/json" \
-d '{"direction":"to-json","text":"name: Ada\nyears: [1815, 1852]"}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/yaml-json",
json={
"direction": "to-json",
"text": "name: Ada\nyears: [1815, 1852]"
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/yaml-json", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"direction": "to-json",
"text": "name: Ada\nyears: [1815, 1852]"
}),
});
const data = await res.json();
console.log(data);
/v1/xml-jsonConvert XML to JSON, or a JSON object back to XML.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/xml-json \
-H "Content-Type: application/json" \
-d '{"direction":"to-json","text":"<person name=\"Ada\"><year>1815</year></person>"}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/xml-json",
json={
"direction": "to-json",
"text": "<person name=\"Ada\"><year>1815</year></person>"
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/xml-json", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"direction": "to-json",
"text": "<person name=\"Ada\"><year>1815</year></person>"
}),
});
const data = await res.json();
console.log(data);
/v1/html-sanitizeStrip scripts and unsafe markup. Keeps a short allow-list of tags.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/html-sanitize \
-H "Content-Type: application/json" \
-d '{"html":"<p>Hello <script>alert(1)</script><a href=\"https://example.com\">link</a></p>"}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/html-sanitize",
json={
"html": "<p>Hello <script>alert(1)</script><a href=\"https://example.com\">link</a></p>"
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/html-sanitize", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"html": "<p>Hello <script>alert(1)</script><a href=\"https://example.com\">link</a></p>"
}),
});
const data = await res.json();
console.log(data);
/v1/date-timezoneParse a messy date and convert it to a timezone you choose.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/date-timezone \
-H "Content-Type: application/json" \
-d '{"text":"March 14, 2026 3:00 PM","sourceTimezone":"America/Chicago","targetTimezone":"UTC"}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/date-timezone",
json={
"text": "March 14, 2026 3:00 PM",
"sourceTimezone": "America/Chicago",
"targetTimezone": "UTC"
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/date-timezone", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"text": "March 14, 2026 3:00 PM",
"sourceTimezone": "America/Chicago",
"targetTimezone": "UTC"
}),
});
const data = await res.json();
console.log(data);
/v1/url-codecPercent-encode or decode a string or query map.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/url-codec \
-H "Content-Type: application/json" \
-d '{"action":"encode","text":"hello world & cats"}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/url-codec",
json={
"action": "encode",
"text": "hello world & cats"
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/url-codec", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"action": "encode",
"text": "hello world & cats"
}),
});
const data = await res.json();
console.log(data);
/v1/unicodeNFC, NFD, NFKC, or NFKD normalization, plus a character count.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/unicode \
-H "Content-Type: application/json" \
-d '{"text":"café","form":"NFC"}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/unicode",
json={
"text": "café",
"form": "NFC"
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/unicode", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"text": "café",
"form": "NFC"
}),
});
const data = await res.json();
console.log(data);
/v1/id-generateCreate a UUID, ULID, or NanoID.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/id-generate \
-H "Content-Type: application/json" \
-d '{"type":"uuid","count":2}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/id-generate",
json={
"type": "uuid",
"count": 2
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/id-generate", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"type": "uuid",
"count": 2
}),
});
const data = await res.json();
console.log(data);
/v1/jwt-decodeRead a JWT header and payload. This does not check the signature.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/jwt-decode \
-H "Content-Type: application/json" \
-d '{"token":"eyJhbGciOiJub25lIn0.eyJzdWIiOiJhZGEifQ."}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/jwt-decode",
json={
"token": "eyJhbGciOiJub25lIn0.eyJzdWIiOiJhZGEifQ."
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/jwt-decode", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"token": "eyJhbGciOiJub25lIn0.eyJzdWIiOiJhZGEifQ."
}),
});
const data = await res.json();
console.log(data);
/v1/cron-parseExplain a 5- or 6-field cron string and list the next fire times in UTC.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/cron-parse \
-H "Content-Type: application/json" \
-d '{"expression":"0 9 * * 1-5","count":3}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/cron-parse",
json={
"expression": "0 9 * * 1-5",
"count": 3
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/cron-parse", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"expression": "0 9 * * 1-5",
"count": 3
}),
});
const data = await res.json();
console.log(data);
/v1/gtin-checksumCheck or fill the check digit on a barcode number.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/gtin-checksum \
-H "Content-Type: application/json" \
-d '{"code":"4006381333931","action":"check"}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/gtin-checksum",
json={
"code": "4006381333931",
"action": "check"
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/gtin-checksum", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"code": "4006381333931",
"action": "check"
}),
});
const data = await res.json();
console.log(data);
/v1/sql-formatPretty-print a SQL query. This is a lightweight formatter, not a full SQL parser.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/sql-format \
-H "Content-Type: application/json" \
-d '{"sql":"select id,name from users where active=1 order by name"}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/sql-format",
json={
"sql": "select id,name from users where active=1 order by name"
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/sql-format", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"sql": "select id,name from users where active=1 order by name"
}),
});
const data = await res.json();
console.log(data);
/v1/unit-convertConvert length, mass, temperature, volume, time, area, speed, and data-size units.
curl -sS https://tidybytetools.tidybytetools.workers.dev/v1/unit-convert \
-H "Content-Type: application/json" \
-d '{"value":10,"from":"km","to":"mi"}'
import requests
r = requests.post(
"https://tidybytetools.tidybytetools.workers.dev/v1/unit-convert",
json={
"value": 10,
"from": "km",
"to": "mi"
},
# headers={"Authorization": "Bearer tbt_YOUR_KEY"},
)
print(r.json())
const res = await fetch("https://tidybytetools.tidybytetools.workers.dev/v1/unit-convert", {
method: "POST",
headers: {
"Content-Type": "application/json",
// Authorization: "Bearer tbt_YOUR_KEY",
},
body: JSON.stringify({
"value": 10,
"from": "km",
"to": "mi"
}),
});
const data = await res.json();
console.log(data);
error: "invalid_api_key"Paid per-call billing is not live. An HTTP 402 on /v1/x402/... is a stub so we can add it later. Payouts must reach a US bank. No wallet is set up yet. See pricing.