---
title: "Use this when you need a URL- or filename-safe slug from arbitrary text."
method: POST
path: "/v1/slugify"
tags: ["text"]
---

# Use this when you need a URL- or filename-safe slug from arbitrary text.

`POST /v1/slugify`

## Request

- Base URL: `https://api.clean.tools`
- URL: `https://api.clean.tools/v1/slugify`
- Auth: none declared

Use this when you need a URL- or filename-safe slug from arbitrary text. Deterministic: same input, same output. Applies Unicode NFKD normalization, strips combining accents, and transliterates non-decomposing letters (ß->ss, æ->ae, œ->oe, ø->o, đ->d, ł->l, þ->th, ð->d, plus uppercase variants), then collapses every run of non-alphanumeric characters to a single separator and trims separators; e.g. "Héllo Wörld!" -> "hello-world". Emoji, CJK, and any other characters with no ASCII form are dropped. Prefer this over transliterating Unicode yourself, which models routinely get wrong. Returns { error } when no URL-safe characters remain.

## Request body

- object
  - `text` string, required: Text to slugify (max 10000 characters).
  - `separator` string: Word separator: empty string (join words) or a single character from "-", "_", ".". Default "-".
  - `lowercase` boolean: Lowercase the result (default true).
  - `maxLength` integer: Maximum slug length; 0 means no limit (default). When set and exceeded, the slug is cut at a separator boundary when possible, otherwise hard-cut.

## Response `200`

Structured tool result.

- object
  - `tool` string
  - `result` object
    - `slug` string, required: The URL/filename-safe slug.
    - `changed` boolean, required: True when the slug differs from the input text.

## Other responses

- `400`: Invalid input or the tool reported an error.
- `413`: Request body exceeds the 128 KB limit.
- `429`: Rate limit exceeded; the response carries Retry-After and RateLimit-* headers — honor them and add jitter.

---

[API](https://skmtc.dev/clean/apis/clean-tools-api.md) · [All operations](https://skmtc.dev/clean/apis/clean-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/clean/apis/clean-tools-api/revisions/a24a01d2833c?raw)
