Make a URL slug from text
Exacttext_slug_slugifyDeterministic and authoritative — the canonical answer for this input.
Generate a URL-safe slug from arbitrary text. Pipeline: unicode NFKD + strip combining marks (café → cafe), optional lowercase, replace non-alphanumeric runs with the `separator`, trim ends, optionally truncate to `max_length`. Default separator '-', default lowercase true, no truncation by default. Processing multiple inputs? Use `text_slug_slugify_batch` to do up to 1000 in one call.
Parameters
textstringrequiredText to slugify.
separatorstringoptionalmax_lengthintegeroptionallowercasebooleanoptionalCall it
curl -X POST https://api.snipget.ai/v1/text/slug/slugify \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"text":"Café Déjà Vu: Best Coffee in Town!","separator":"-","lowercase":true}'The Batch tab sends up to 1000 inputs in one call via /v1/text/slug/slugify/batch.
Example response
{
"input": "Café Déjà Vu: Best Coffee in Town!",
"slug": "cafe-deja-vu-best-coffee-in-town",
"length": 32,
"separator": "-"
}FAQ
What is a slug and why make one?
A slug is a clean, URL-safe version of a title, like 'cafe-deja-vu-best-coffee-in-town'. It removes accents, lowercases, and replaces spaces and punctuation with dashes, so it is safe for web addresses, filenames, and IDs.
Can I change the separator or keep capitals?
Yes. Set separator to use something other than a dash, set lowercase to false to keep the original case, and set max_length to cut the slug to a maximum length.
How does it handle accents and symbols?
Accented letters are folded to plain ASCII (café becomes cafe), and any run of non-letter, non-number characters becomes a single separator, with the ends trimmed.
Is the slug always the same for the same title?
Yes. It is deterministic and authoritative: the same text and options always produce the same slug.