Text to Slug Generator avatar

Text to Slug Generator

Pricing

Pay per event

Go to Apify Store
Text to Slug Generator

Text to Slug Generator

🔗 Convert text, titles, or headings to clean URL-friendly slugs. Batch-process thousands of strings with Unicode transliteration, stop-word removal, custom separators, and max-length truncation.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Stas Persiianenko

Stas Persiianenko

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

10 days ago

Last modified

Share

Convert any text, title, or heading into a clean, URL-friendly slug — instantly, in bulk, with full Unicode support.

Paste hundreds of blog post titles, product names, or category labels and get back SEO-optimized slugs in seconds. No scraping, no proxy, no waiting — pure computation at API scale.

🔍 What does it do?

Text to Slug Generator takes a list of text strings and converts each one into a valid URL slug: lowercase, hyphen-separated, with accented characters transliterated and special symbols stripped.

Input:

Café au Lait & Crêpes — A French Classic!
10 Best SEO Tips for 2024 (Proven Strategies)
Hello World: Getting Started with Node.js

Output:

cafe-au-lait-and-crepes-a-french-classic
10-best-seo-tips-for-2024-proven-strategies
hello-world-getting-started-with-nodejs

Works with any language, supports custom separators, optional stop-word removal, max-length truncation, and deduplication.


👥 Who is it for?

Content managers migrating a CMS

You have 5,000 article titles exported from WordPress or Drupal. You need slugs for the new platform. Paste them all in, export as CSV, done in under a minute.

SEO specialists building URL structures

You're planning a site architecture and need to verify every planned URL slug is clean, consistent, and keyword-dense. Remove stop words to keep slugs short and punchy.

Developers automating pipelines

Your n8n or Make.com workflow generates product listings dynamically and needs to create URL-safe IDs for each. Call this actor via API from any automation tool.

E-commerce teams adding new SKUs

You're adding 500 new products and need a slug for each one. Batch-process the entire catalog in one run instead of clicking through an admin UI one product at a time.

Data engineers standardizing identifiers

You need deterministic, reproducible slugs for database keys, file names, or API endpoints derived from human-readable labels.


✅ Why use it?

  • Zero configuration needed — paste your texts, get slugs. All options have sensible defaults.
  • Unicode/international support — accented characters (é, ü, ñ, ç), Cyrillic, Arabic, CJK (Chinese/Japanese/Korean), Thai, Hebrew, Greek and 30+ scripts transliterated automatically via any-ascii.
  • Stop-word removal — strip "the", "and", "of" etc. for shorter, more keyword-dense slugs.
  • Batch-optimized — process thousands of strings in a single run. No rate limits, no per-page overhead.
  • Consistent — same input always produces the same slug. Safe for use as a deterministic key generator.
  • Flexible separators — hyphen (-), underscore (_), or dot (.) depending on your platform conventions.
  • Max-length truncation — truncate at a word boundary to stay within CMS or routing constraints.
  • Deduplication — skip repeated inputs to avoid duplicate rows in your output.

📊 Output data

Each input text produces one output row:

FieldTypeDescription
indexnumberPosition of this text in the input array (0-based)
textstringOriginal input text, trimmed
slugstringThe generated URL-friendly slug
characterCountnumberNumber of characters in the slug
wordCountnumberNumber of words (segments between separators)
wasTruncatedbooleantrue if slug was shortened due to maxLength
stopWordsRemovedarrayWords removed by the stop-word filter

💰 How much does it cost to convert text to slugs?

This actor uses Pay-Per-Event (PPE) pricing — you only pay for what you use.

EventFREE tierBRONZE (Starter)SILVER (Scale)GOLD (Business)
Run started (one-time)$0.005$0.005$0.005$0.005
Per slug generated$0.00115$0.001$0.00078$0.0006

Example costs (Starter plan — $0.001/slug):

  • 100 slugs: ~$0.11 (start + 100 × $0.001)
  • 1,000 slugs: ~$1.01
  • 10,000 slugs: ~$10.01
  • 100,000 slugs: ~$100.01

Higher-tier plans get additional volume discounts — DIAMOND users pay just $0.00028/slug.

All runs include a free tier — new Apify accounts get $5 in free platform credits, enough to generate ~4,300 slugs at no charge (FREE tier pricing).


🚀 How to use it (step by step)

  1. Open the actor on the Apify Store and click Try for free.
  2. Paste your texts into the "Texts to convert" field — one per line, or as a JSON array.
  3. Choose a separator (hyphen is the default and most common for URLs).
  4. Enable options as needed: lowercase (default on), stop-word removal, max length.
  5. Click Start — results appear in the dataset within seconds.
  6. Export as JSON, CSV, or XLSX from the dataset view.

For automation, use the Apify API or connect via MCP.


⚙️ Input parameters

ParameterTypeDefaultDescription
textsarray of strings(required)List of text strings to convert. Each produces one output row.
separatorstring"-"Word separator: -, _, or .
lowercasebooleantrueConvert output to lowercase. Recommended for all URLs.
localestring""BCP 47 locale for transliteration hints (e.g., "de", "fr", "tr"). Leave blank for generic.
maxLengthinteger0Maximum slug length in characters. 0 = unlimited. Truncation happens at a word boundary.
removeStopWordsbooleanfalseStrip common English stop words (a, the, and, or, in, of, …).
customStopWordsarray of strings[]Additional words to strip, in any language.
deduplicatebooleanfalseSkip duplicate input texts (one output per unique text).

📦 Output examples

Basic conversion

Input:

{
"texts": ["Hello, World! This is a Test"],
"separator": "-",
"lowercase": true
}

Output:

{
"index": 0,
"text": "Hello, World! This is a Test",
"slug": "hello-world-this-is-a-test",
"characterCount": 26,
"wordCount": 6,
"wasTruncated": false,
"stopWordsRemoved": []
}

With stop-word removal

Input:

{
"texts": ["The Best Guide to URL Slugs for SEO"],
"removeStopWords": true
}

Output:

{
"index": 0,
"text": "The Best Guide to URL Slugs for SEO",
"slug": "best-guide-url-slugs-seo",
"characterCount": 24,
"wordCount": 5,
"wasTruncated": false,
"stopWordsRemoved": ["the", "to", "for"]
}

With max length

Input:

{
"texts": ["A Very Long Title That Should Be Truncated After a Certain Point"],
"maxLength": 30
}

Output:

{
"index": 0,
"text": "A Very Long Title That Should Be Truncated After a Certain Point",
"slug": "a-very-long-title-that-should",
"characterCount": 29,
"wordCount": 6,
"wasTruncated": true,
"stopWordsRemoved": []
}

International / accented text

Input:

{
"texts": ["Café au Lait & Crêpes", "Über den Wolken", "Ñoño y más ñoño"]
}

Output:

[
{ "index": 0, "slug": "cafe-au-lait-and-crepes", ... },
{ "index": 1, "slug": "uber-den-wolken", ... },
{ "index": 2, "slug": "nono-y-mas-nono", ... }
]

💡 Tips and best practices

  • Keep slugs short — enable removeStopWords and set maxLength: 60 for SEO-friendly URLs under most CMS character limits.
  • Use hyphens, not underscores — Google treats hyphens as word separators but underscores as connectors. Stick with - for blog posts and product pages.
  • Test your locale — if you're processing German or Turkish text, set locale to "de" or "tr" for correct transliteration (e.g., ü → ue in German context).
  • Use customStopWords for brand names, common short words specific to your niche, or words that add no SEO value in your content category.
  • Deduplication for catalog imports — enable deduplicate: true when processing a product catalog that may have repeated names to avoid duplicate URL conflicts.
  • Batch everything in one run — up to 100,000 texts per run is practical. There's no throttling or pagination overhead for pure computation.

🔌 Integrations

WordPress / WooCommerce bulk migration

Export post titles from WordPress (wp post list --fields=ID,post_title --format=csv), convert slugs with this actor, then import back with wp post update {ID} --post_name={slug}. Automate the loop via n8n.

Contentful / Strapi CMS pipeline

Add a "slug" field to your content type. Build a Make.com scenario: new entry created → send title to this actor via API → write returned slug back to the entry. Fully automated, zero developer involvement after setup.

E-commerce product feeds

When ingesting supplier product feeds (CSV/XML), run titles through this actor before inserting to your database. Guarantees all product URLs are consistent, even when supplier titles change capitalization or punctuation between feed updates.

Shopify collection slugs

Shopify calls these "handles". Use this actor in a Zapier workflow: new collection created → generate handle → update via Shopify Admin API. Keeps your SEO-friendly URL conventions consistent across the whole store.

Static site generators (Jekyll, Hugo, 11ty)

Pre-generate slugs for your content pipeline. Run this actor on your content spreadsheet before pushing to your repo, then use the slugs directly as file names ({slug}.md).


🛠 API usage

Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('automation-lab/text-to-slug-generator').call({
texts: [
'Hello World! This is a Test',
'Café au Lait & Crêpes',
'10 Best SEO Tips for 2024',
],
separator: '-',
lowercase: true,
removeStopWords: false,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
// [{ slug: 'hello-world-this-is-a-test', ... }, ...]

Python

from apify_client import ApifyClient
client = ApifyClient(token="YOUR_API_TOKEN")
run = client.actor("automation-lab/text-to-slug-generator").call(run_input={
"texts": [
"Hello World! This is a Test",
"Café au Lait & Crêpes",
"10 Best SEO Tips for 2024",
],
"separator": "-",
"lowercase": True,
"removeStopWords": False,
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
for item in items:
print(item["slug"])

cURL

curl -X POST \
"https://api.apify.com/v2/acts/automation-lab~text-to-slug-generator/runs?token=YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"texts": [
"Hello World! This is a Test",
"Café au Lait & Crêpes"
],
"separator": "-",
"lowercase": true
}'

🤖 MCP — AI assistant integration

Connect Text to Slug Generator directly to Claude, Cursor, or any MCP-compatible AI assistant and convert slugs with a natural language prompt.

Claude Code (terminal)

$claude mcp add --transport http apify "https://mcp.apify.com"

Claude Desktop / Cursor / VS Code

Add to your MCP config:

{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com"
}
}
}

Your AI assistant will use OAuth to authenticate with your Apify account on first use.

Example prompts

  • "Generate URL slugs for these 20 blog post titles: [paste titles]"
  • "Convert these product names to underscored slugs with stop words removed"
  • "Create slugs for these French article titles with locale set to fr"
  • "Process this CSV of 500 titles and give me back a table with original and slug columns"

⚖️ Legality and data usage

This actor performs pure local computation — it does not make any HTTP requests to external websites, does not scrape any service, and does not use any proxies. All processing happens inside the actor runtime using only the input you provide.

  • No terms of service concerns — no websites are accessed.
  • No personal data collected — the actor only processes the strings you provide and returns them transformed.
  • GDPR-safe — input and output data are stored only in your own Apify dataset, under your account.

❓ FAQ

Q: What happens to non-Latin characters (Chinese, Arabic, Cyrillic, Korean)? A: All Unicode characters are transliterated to ASCII using the any-ascii library, which covers 100+ scripts. Chinese → Pinyin romanization, Japanese Kana → Romaji, Korean Hangul → Revised Romanization, Arabic → consonant romanization, Cyrillic → Latin equivalents. These are phonetically approximate and perfect for URL slugs.

Q: Does it preserve numbers in slugs? A: Yes. Numbers are kept as-is. "Top 10 Tips""top-10-tips".

Q: Can I use it with underscores for Python package names? A: Yes — set separator: "_".

Q: The slug is empty after stop-word removal — why? A: If your text consists entirely of stop words (e.g., "The And Or"), the actor falls back to the full word list and won't produce an empty slug.

Q: I have 1 million titles. Will it time out? A: The default timeout is 300 seconds. At ~10,000 slugs/second processing speed, you can safely process ~1–2 million titles per run. For larger batches, split into multiple runs or contact us for guidance.

Q: The slug for my German text looks wrong (ü became u, not ue). A: The any-ascii library maps German ü→u, ö→o, ä→a — standard ASCII transliteration. The locale field is stored in output metadata but does not change any-ascii behavior. For locale-specific conventions (e.g., German ü→ue), pre-process your text with a specialized tool before passing to this actor.

Q: How do I export results as a CSV? A: After the run, open the dataset tab and click ExportCSV. You can also use the Apify API: GET /v2/datasets/{id}/items?format=csv.