Back to blog
apislugifyurlstext-processing

Slugify API: Turn Any Title into a URL-Safe Slug

Your users type:

How To Clean LLM JSON Output!

You want that in a URL. So you reach for a slug library. It lowercases. Then you remember caps. Then the !. Then the spaces. By the time it handles Café & Co. with an accent and an ampersand, your "quick slug" is 40 lines and a dependency you don't trust.

One call does it:

curl -s -X POST https://textforge.co/v1/run \
-H "Content-Type: application/json" \
-d '{"input":"How To Clean LLM JSON Output!","pipeline":["slugify"]}'

Returns:

how-to-clean-llm-json-output

Lowercased, punctuation stripped, spaces to hyphens. That's the whole job. No SDK, no npm install, no accent-handling edge case you forgot about.

The Pipeline: Normalize Before You Slug

Raw titles are messy. slugify alone handles most of it, but if your input is ALL CAPS TITLE and you want lowercase output anyway, slugify already does that. The pipeline matters when you have mixed case like userAccountBalance — slugify leaves the casing, so chain it:

curl -s -X POST https://textforge.co/v1/run \
-H "Content-Type: application/json" \
-d '{"input":"userAccountBalance","pipeline":["kebabcase"]}'

Returns:

user-account-balance

kebabcase splits camelCase on boundaries and joins with hyphens. Use it for variable names; use slugify for human titles. They are different jobs.

Where This Breaks (and Doesn't)

slugify strips punctuation and collapses whitespace. It does not translate accented characters unless your input is already ASCII — Café stays café. If you need pure ASCII slugs, strip accents first (a future transform; for now post-process). Everything else — caps, spaces, symbols — is handled.

Use it for: blog post URLs, product page paths, filename sanitization, routing keys, any user-string that becomes a path segment.

Try It Now

Playground: textforge.co/playground — paste a title, pick slugify, see the slug.

Docs: textforge.co/docs — all 28 transforms, rate limits.

Free tier: 1,000 requests/day. No key. No signup.


Built this because every project reinvents the slug function badly. Free for 1K/day. GitHubDocsChangelog


Try it free

1,000 requests/day. No API key. No signup.

Open Playground →