Skip to content

Slug

What this does

Converts human-readable text into a slug: lowercase, hyphen-separated, safe for URLs and filenames. Accents are normalised, punctuation removed, and spaces collapsed.

Who it is for

  • Blog and CMS auto-slugs from headlines
  • Product SKU or handle generators
  • Email campaign UTM-friendly paths
  • Anyone cleaning up messy titles for the web

Try it

https://fetch.li/v1/slug?text=Hello World! A UK Guide

Other examples:

https://fetch.li/v1/slug?text=Café au Lait - Special Edition
https://fetch.li/v1/slug?text=2026 Bank Holiday Planner

HTTP example

GET /v1/slug?text=Hello%20World!%20A%20UK%20Guide HTTP/1.1
Host: fetch.li
Accept: application/json

curl

curl -sS "https://fetch.li/v1/slug?text=Hello%20World!%20A%20UK%20Guide"

JavaScript fetch

const title = "Hello World! A UK Guide";
const response = await fetch(
  `https://fetch.li/v1/slug?text=${encodeURIComponent(title)}`
);
const { slug } = await response.json();
console.log(slug);

Python requests

import requests

response = requests.get(
    "https://fetch.li/v1/slug",
    params={"text": "Hello World! A UK Guide"},
)
response.raise_for_status()
print(response.json()["slug"])

Example JSON response

{
  "text": "Hello World! A UK Guide",
  "slug": "hello-world-a-uk-guide",
  "length": 22
}

Parameters

Parameter Required Type Description
text Yes string Source text (max 500 characters)

Errors that can happen

HTTP error.code When
400 invalid_body Missing or empty text, or text too long
429 rate_limited Demo limit exceeded
500 internal Unexpected server error

Demo

GET endpoints work without an API key on the public demo tier (60 calls per hour per IP). POST /v1/vibe/classify needs a key.