deterministic
no-api-key
text
unicode
slug

Slug generator: Unicode-aware URL slug with transliteration

Slug generator: turn arbitrary text into a URL-safe slug. Decomposes accents, transliterates German umlauts, Scandinavian and Turkish letters, the ligatures that lose meaning under plain NFD, and Cyrillic (Russian, Ukrainian, Belarusian, Bulgarian, Serbian, Macedonian; language from lang or inferred from the letters). Lowercases, collapses separators, truncates on a word boundary. Returns the slug plus what was removed.

Output (data): slug, length, truncated, source_length, transliterated [{from, to}] for every mapped character, removed (characters dropped entirely, deduplicated; includes the Cyrillic soft and hard signs and the Ukrainian apostrophe). Cyrillic: Ukrainian follows the 2010 national system (Київ Україна -> kyiv-ukraina); Belarusian, Bulgarian, Serbian and Macedonian use ASCII slug tables; Russian letters use BGN/PCGN (Привет -> privet); other Cyrillic letters use ISO 9:1995 without diacritics.

Deterministic: identical input returns identical output, so the response is served with Cache-Control: private, max-age=31536000, immutable (the paying client may cache it indefinitely; shared caches must not, because the response is paid).

Price: $0.05 USDC per call (x402, Base). Route contract version 1.0.0. Docs: https://api.duoleads.com/docs#text-slug

get/v1/text/slug

Request

  • Base URL: https://api.duoleads.com
  • URL: https://api.duoleads.com/v1/text/slug
  • Auth: none declared

Query parameters

textstring required

Text to slugify, at most 2048 characters. Accepted: at most 2048 characters.

separator'-' | '_' | '.' | ''

Separator: - (default), _, . or empty. Accepted: -, _, . or empty.

maxinteger

Maximum slug length 1-512, default 96. Truncates at the last complete word. Accepted: integer 1-512.

case'lower' | 'preserve' | 'upper'

lower (default), preserve or upper. Accepted: lower, preserve, upper.

langstring

ISO 639-1 code for locale-sensitive folding (de: ü->ue) and the Cyrillic table (ru, uk, be, bg, sr, mk). Default locale-neutral; for Cyrillic the language is then inferred from letters unique to Ukrainian, Belarusian, Serbian or Macedonian, else Russian BGN/PCGN letters with ISO 9 (accents folded) for the rest. Accepted: an ISO 639-1 language code.

Response

Paid and settled. data is route-specific; a route that judges its input returns 200 with data.valid: false for a bad value.

okunknown required
route'/v1/text/slug' required
version'1.0.0' required

Changes

No recorded changes to this operation across all 1 revision of this API.