Slugify API

Turn titles into clean URL slugs: accents removed (Vietnamese đ included), custom separator, optional case keeping and maximum length.

GETPOSThttps://apibox.io.vn/v1/slugify

Send a text (query string, JSON or form field, or raw text body) and get a URL-safe slug. Accents and diacritics are removed (Việt Nam becomes viet-nam, đ becomes d), special letters such as ß, æ, ø and ł are transliterated, apostrophes and quotes are dropped and every other run of non-alphanumeric characters becomes a single separator.

Options: separator can be - (default), _, . or an empty string; lowercase=false keeps the original case; max_length (1-1000) cuts the slug and removes a trailing separator.

The input text is limited to 10,000 characters.

Parameters

NameInTypeRequiredDefault
textbody|querystringyesText to slugify (max 10,000 characters). Can also be sent as a raw text body.
separatorbody|querystringno-Separator: -, _, . or empty. Other values fall back to -.
lowercasebody|querybooleannotrueConvert to lower case; false keeps the original case.
max_lengthbody|querynumbernoMaximum slug length (1-1000). No limit when omitted.

Example

curl "https://apibox.io.vn/v1/slugify?text=Xin%20ch%C3%A0o%20Vi%E1%BB%87t%20Nam!%20%C4%90%C3%A2y%20l%C3%A0%20APIBox" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "slug": "xin-chao-viet-nam-day-la-apibox"
}

Use cases

  • Generate permalinks for blog posts and product pages
  • Create file names or IDs from user-entered titles
  • Build SEO-friendly URLs for Vietnamese content
  • Normalize tags and category names

FAQ

Does it handle Vietnamese characters?

Yes. All tone marks are removed and đ/Đ become d/D, so "Xin chào Việt Nam" becomes xin-chao-viet-nam.

Can I use underscores instead of hyphens?

Yes, set separator=_. Allowed values are -, _, . and an empty string.

How do I limit the slug length?

Use max_length, for example max_length=60. A separator left at the end after cutting is removed.

Related APIs

Start with 1,000 free requests every month. Get free API key →