← Back to blog

Free Text Utility APIs: JSON Format, Slugify, Diff & HTML to Markdown

September 21, 2026 · Eric · 8 min read

Language models are good at prose and bad at bookkeeping. They emit JSON with a trailing comma, capitalise a field name three different ways in the same file, and paste raw HTML into a retrieval pipeline that wanted Markdown. Re-prompting a model to fix those things is slow, non-deterministic, and expensive. A one-line HTTP call is none of those things.

Agent Media Tools ships a family of small, deterministic text endpoints that do exactly one job each: validate JSON, change case, build a slug, diff two versions of a file, convert HTML to Markdown, and answer the odd lookup question about URLs, HTTP status codes, MIME types, or cron strings. They are plain REST, they need no API key, and they work the same from curl, Python, or an agent runtime. This guide walks the real endpoints with response bodies captured from the live API, plus the boundaries worth knowing before you wire them into a loop.

The endpoints in one table

EndpointMethodInputYou get back
/api/json-formatPOSTinput, optional action, indentPretty or minified JSON, or a validation verdict
/api/case-convertPOSTtext, toOne converted string
/api/slugifyPOSTtextURL-safe slug
/api/diffGET or POSTtext1, text2Line counts plus the added and removed lines
/api/html-to-mdPOSThtmlMarkdown plus a size ratio
/api/url-parseGETurlProtocol, host, port, path, query params, TLD
/api/http-statusGEToptional codeStatus name and category, or the whole list
/api/mimeGEText or typeExtension ↔ MIME type
/api/cron-validateGETexpressionValid flag plus the next five run times
/api/loremGETparas, sentencesPlaceholder paragraphs for fixtures

Every row above is a free tool. No key, no signup, no Authorization header — just an IP-based daily allowance, which I cover at the end.

1. Validate model output before you parse it

The most common agent failure is not a hallucination. It is a missing closing brace. POST /api/json-format takes the raw text as a JSON string in the input field, parses it server-side, and can either hand it back formatted or tell you precisely where it broke.

curl -s -X POST https://agentmediatools.com/api/json-format \
  -H 'Content-Type: application/json' \
  --data "$(jq -n --arg i "$(cat model_output.json)" '{input:$i, indent:2}')"

With model_output.json containing {"a": 1, "b":[1,2]}, the response is:

{
  "success": true,
  "formatted": "{\n  \"a\": 1,\n  \"b\": [\n    1,\n    2\n  ]\n}",
  "type": "object",
  "keys": ["a", "b"]
}

Three behaviours matter in practice. First, indent is clamped between 0 and 10 and defaults to 2. Second, sending action: "minify" returns {"a":1} — the same call you would use to compact a payload before embedding it in a prompt. Third, and most usefully, invalid JSON does not produce an HTTP error. It returns a normal 200 with success: false and a parser message:

{"success":false,"valid":false,
 "error":"Expected double-quoted property name in JSON at position 8 (line 1 column 9)"}

That shape is deliberately loop-friendly: your agent can read success, send the error text back to the model for one repair attempt, and re-validate without exception handling. With action: "validate" you get only the verdict — {"success":true,"valid":true,"type":"array","keys":null} for an array — which is handy as a cheap gate before an expensive downstream call. The same tool has a browser page at /tool/json-formatter if you want to paste something by hand.

2. Normalise names: case conversion and slugs

Field names, CSS class names, and URL slugs are the three places a model will happily mix conventions in one response. POST /api/case-convert accepts text and a to target, and the acceptance list is exact: lower, upper, title, camel, pascal, snake, kebab, constant. Anything else returns success: false with the valid list in the error string, so a typo fails loudly instead of silently.

curl -s -X POST https://agentmediatools.com/api/case-convert \
  -H 'Content-Type: application/json' \
  -d '{"text":"Hello World API","to":"camel"}'
# {"success":true,"input":"Hello World API","output":"helloWorldApi","target":"camel"}

Note what camel does to the acronym: Hello World API becomes helloWorldApi, not helloWorldAPI. If your schema cares about preserved acronyms, keep that transformation in your own code — this endpoint is a normaliser, not a formatter with opinions. snake gives hello_world_api and constant gives HELLO_WORLD_API.

Sibling endpoint POST /api/slugify turns a headline into a URL segment:

curl -s -X POST https://agentmediatools.com/api/slugify \
  -H 'Content-Type: application/json' \
  -d '{"text":"10 Great Slugify Tips & Tricks!"}'
# {"success":true,"input":"10 Great Slugify Tips & Tricks!","slug":"10-great-slugify-tips-tricks"}

It lowercases, strips characters that are not ASCII letters, digits, or whitespace, collapses runs of spaces or hyphens, and trims the edges. Boundary to note: it strips accents rather than transliterating them. Café Crème: 10 Great Deals! becomes caf-crme-10-great-deals, not cafe-creme-10-great-deals. If you need readable slugs for non-English titles, transliterate first (for example, normalise to ASCII in Python) and slugify the result.

3. HTML into Markdown for retrieval pipelines

Scrapers hand you markup; RAG stores and LLM prompts want Markdown. POST /api/html-to-md takes an html string and returns Markdown with ATX headings and fenced code blocks, plus a compression ratio you can log:

curl -s -X POST https://agentmediatools.com/api/html-to-md \
  -H 'Content-Type: application/json' \
  --data "$(jq -Rn --rawfile h page.html '{html:$h}')"

# {
#   "success": true,
#   "markdown": "# Hi\n\nSome **bold** text\n\n*   a\n*   b",
#   "chars_in": 78,
#   "chars_out": 37,
#   "ratio": "0.47"
# }

For a typical marketing page you will see the ratio land between 0.2 and 0.5 — a useful signal for trimming context before you pay for tokens. The endpoint converts what you send it; it does not fetch the page or strip navigation, so pair it with your own scraper. If you already have a PDF instead of HTML, there is a separate pdf_to_markdown tool for that job.

4. Diff two versions without adding a library

When an agent edits a config file or a document, you want to know what changed before you commit it. /api/diff accepts text1 and text2 — the original first — and returns counts plus the actual lines.

curl -s -G https://agentmediatools.com/api/diff \
  --data-urlencode "text1=alpha
beta
gamma" \
  --data-urlencode "text2=beta
gamma
delta"
# {"success":true,"lines1":3,"lines2":3,"common":2,"added":1,"removed":1,
#  "additions":["delta"],"deletions":["alpha"]}

Two honest notes. The comparison is set-based, not positional: it reports lines present in one text but not the other, so a pure reordering of unchanged lines reports zero additions and zero deletions. And use text1/text2 as the parameter names — that is what the implementation reads. The published OpenAPI entry for this route still lists a and b, and a request using those names comes back with {"success":false,"error":"text1 and text2 are required"}; treat the code as the source of truth until that entry is updated.

POST works too, which is the better choice for long documents: send {"text1": "...", "text2": "..."} as JSON and skip URL encoding entirely.

5. The small lookups that keep a pipeline honest

Chaining them from Python

The whole family is a normal JSON-over-HTTP surface, so a small requests function is enough. This snippet was run against the live API and its output is reproduced below it.

import requests

API = "https://agentmediatools.com/api"
good = '{"title":"Café Crème: 10 Great Deals!","tags":["A","b"]}'

fmt = requests.post(f"{API}/json-format", json={"input": good}, timeout=20).json()
print(fmt["formatted"])

slug = requests.post(f"{API}/slugify", json={"text": "Café Crème: 10 Great Deals!"}, timeout=20).json()
print(slug["slug"])

diff = requests.get(f"{API}/diff",
                    params={"text1": "port=8080\nmode=fast",
                            "text2": "port=9090\nmode=fast"},
                    timeout=20).json()
print(diff["added"], diff["removed"], diff["common"])
{
  "title": "Café Crème: 10 Great Deals!",
  "tags": [
    "A",
    "b"
  ]
}
caf-crme-10-great-deals
['port=9090'] ['port=8080'] 1

Note the third output line again: the diff told you which line changed and how many lines the two versions share, without a diff library, a subprocess, or a temporary file.

What the MCP server exposes from this family

If your agent speaks MCP rather than REST, be precise about coverage. The hosted MCP server exposes text_diff from this group (same text1/text2 shape, described as "Compare two texts and show added/removed lines"). JSON formatting, case conversion, slugify, HTML-to-Markdown, the lookups, and cron validation are REST-only — there is no MCP tool name for them, so wire them as HTTP calls from your agent's tool layer instead of assuming a one-to-one mapping. Related deterministic helpers that do have MCP tools include hash_text, base64_encode, csv_convert, and timestamp_convert, which are covered in the developer utility API roundup.

Free-tier limits, and when a model is the wrong tool

Free tools need no authentication, so the only thing to design around is the daily allowance: 10 tool uses per day per IP for anonymous callers, 25 per day for a logged-in free account, and 25 requests per day on a free agent API key, with a 60-request-per-minute burst cap for anonymous traffic. A single agent run that slugifies 200 headlines will hit that ceiling fast, so batch in your own code: call /api/slugify once per unique title, cache the result in your database, and re-use it. Identity is worth setting up if you are doing this at volume — a free key lifts you to a documented 25 requests per day with the same endpoints.

The general rule: if the transformation has exactly one correct answer, send it to an endpoint rather than a model. Formatting JSON, changing case, producing a slug, and diffing two strings are all in that category. Save the tokens for the parts of your pipeline that genuinely need judgement.

Try it in the Toolbox

Paste JSON, run a diff, or convert HTML to Markdown in the browser — then call the same endpoints from your agent with an API key.

Open toolbox