xtract.bot
POST /api/slugify

Generate URL slugs from arbitrary strings. Lowercases, transliterates accented characters, strips punctuation, and replaces whitespace with hyphens.

Converts a string into a URL-friendly slug: - Lowercases (configurable). - Transliterates accented characters (`é` → `e`, `ß` → `ss`, Cyrillic / Greek / etc. → closest Latin equivalent). - Strips punctuation. - Replaces runs of whitespace with a single separator (default `-`). Useful for blog-post URLs, GitHub-style anchor IDs, predictable filenames from user-supplied titles.

Inputs

NameTypeDefaultDescription
input*stringText to slugify.
separatorstring"-"Joiner between words (typically `-` or `_`).
lowercasebooleantrueLowercase the output.
decamelizebooleantrueSplit `camelCase`/`PascalCase` into separate words first.
preserveCharactersstringCharacters from this string are preserved literally instead of replaced (e.g. `_/` to keep underscores and slashes).

Response

Modes: json, text. Cache: yes (24h TTL).

Code samples

Built from the title example.


curl -X POST https://api.xtract.bot/api/slugify \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
  -H "X-Api-Key: $XTRACT_API_KEY" \
  -d '{
  "input": "10 Things You Should Know About Rust!",
  "separator": "-"
}'