Slug Generator avatar

Slug Generator

Pricing

Pay per usage

Go to Apify Store
Slug Generator

Slug Generator

Professional-grade slug generation with international support and greedy word truncation. Create clean slugs each each time. It can process a high volume of (up to 10M) input titles seamlessly. Check README.md for all the details 🤘🏻

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Noopur A

Noopur A

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Share

👀 INDEX for quick reference:

⭐ Slug Generator - Complete README ⭐

📑 Table of Contents

  1. What is a Slug?
  2. What It Does?
  3. Quick Start
  4. Examples
  5. What It Does (Features)?
  6. What It Doesn't Do?
  7. Greedy Truncation (Word-Aware) -
  8. Input Formats
  9. Valid Input Examples -
  10. Configuration Options
  11. How Much Input Can It Process?
  12. Performance & Limits
  13. Output
  14. Error Messages & Fixes
  15. Use Cases
  16. Why Do You Need It?
  17. How Does This Save You Time?
  18. Does It Always Work?
  19. API Integration

What is a Slug? 🤔

Good question! A slug is a URL-friendly version of a title. Here are some examples:

summer-cool-shirts-to-rock https://www.example.com/this-is-a-slug this_slug_has_underscore_for_word_separator you.can.also.use.period.as.a.separator

These are what you find in the URL bar or when you inspect the code of a website. With this Slug Generator Actor, you can batch-create them instantly!


What It Does? 🧐

Generate clean, URL-friendly slugs from titles in bulk. Handles international characters (German, French, Italian, Slavic, Nordic), preserves word boundaries, and ensures every slug is unique.


❕Quick Start

Paste titles (one per line) Choose format (plain text, CSV, JSON, TSV) Set output character limit (default: 60) Run


Examples -

Basic Transformation - Input: My Awesome Blog Post! Output: my-awesome-blog-post

International Characters - Input: München Coffee Shop Output: munchen-coffee-shop (accents removed)

Symbol & Special Character Removal - Input: Mod#eRn tech$niQues to faRmin*g Output: modern-techniques-to-farming

Numbers & Extra Spaces - Input: Mod#3eRn tech$ni9Ques to faRmin1*g Output: mod-3-ern-techni-9-ques-to-farmin-1-g

⚠️ Note: Typos are not fixed. Numbers and typos in your input stay as-is.


What It Does (Features)?

Accepts only valid input in the form of a "string" Accepts multiple formats: Plain text, JSON, CSV, TSV

Accepts URL Share the URL to your input data stored on your cloud storage

Make sure the input data shared via URL is accessible Check URL sharing permissions in your cloud storage settings

Removes symbols and special characters Handles international characters (German ü→ue, French é→e, etc.)

Preserves word boundaries (doesn't merge words) Ensures uniqueness (no duplicate slugs)

  • example - sample slug (multiple duplicate input ) gets a suffix at the end of the slug
  • sample-slug-1, sample-slug-2, sample-slug-3 . . .

Greedy truncation (completes words, doesn't cut them off) Real-time progress tracking (see processing status)

Self-testing (verifies everything is working before processing)


⚠️ What It Doesn't Do?

Does not fix typos (typos in input stay as typos in output) Does not generate SEO-optimized titles (generates slugs, not titles) Does not automatically fix bad/toxic input (invalid input is rejected)


Greedy Truncation (Word-Aware) -

Input: Latest and greatest sneakers and shoes collection

Example 1 - Limit: 20 characters

  • ❌ Bad (cuts word): latest-and-greatest-s
  • ✅ Good (completes word): latest-and-greatest-sneakers

The slug generator doesn't cut words in half. If the limit is 20 characters but completing the next word extends to 28, it includes the full word for readability.

Example 2 - Default limit: 60 characters

  • Output: latest-and-greatest-sneakers-and-shoes-collection

No broken words, clean output, always readable.


Why This Works Better?

Limit: 5 Output: latest Length: 6 Status: ✅ Completes word

Limit: 20 Output: latest-and-greatest-sneakers Length: 28 Status: ✅ Completes word

Limit: Default 60 Output: latest-and-greatest-sneakers-and-shoes-collection Length: 50 Status: ✅ Completes word


⚠️ Input Formats -

Plain Text: One title per line CSV: Comma-separated values TSV: Tab-separated values JSON: Array of strings


Valid Input Examples -

Plain text in Apify UI: My First Blog Post Latest Product Name Summer Collection 2026 Product Four Product Five


JSON (newline-separated): json

{ "titles": "My First Blog Post\nLatest Product Name\nSummer Collection 2026" }

JSON (array): json

{ "titles": ["Product 1", "Product 2", "Product 3"], "format": "json", "separator": "_", "limit": 80 }

CSV: json

{ "titles": "product1,product2,product3", "format": "csv", "separator": "-", "limit": 60 }


Configuration Options -

Separator: Choose -, _, or . (default: -)

  • → hyphen/dash (most common for SEO) _ → underscore . → period/dot

Truncation Limit: 1 - 1000 characters (default: 60)

The slug generator will complete the active word and not cut it abruptly

Format: Specify input format (text, CSV, JSON, TSV)


How Much Input Can It Process?

It's up to you. Whether you have 10 titles, 100, 1,000, 10K, or 100K+ lines — all of it gets processed fast and smooth.


💠 Performance & Limits -

Processing Speed 100 titles: ~20ms 1,000 titles: ~200ms 10,000 titles: ~2 seconds 100,000 titles: ~20 seconds

Maximum Input Max 1,000 characters per individual title Theoretical max: 10M+ titles (takes ~30 minutes to process)

Memory Usage Optimized for low RAM consumption Batch clean up prevents memory spikes Processes efficiently even with large datasets

Scalability This actor is built to scale. Whether you have 10 titles or 10 million, it processes deterministically and reliably.


Output -

Dataset with two columns: original: Your input title slug: Generated slug


⚠️ Error Messages & Fixes -

Invalid Inputs (Rejected -> Actor Stops)

Input: null Status: ❌ Rejected Error: INPUT_FAILURE

Input: {} Status: ❌ Rejected Error: Missing 'titles' field

Input: {titles: 123} Status: ❌ Rejected Error: Must be String or Array

Input: {titles: ""} Status: ❌ Rejected Error: Empty string

Input: {titles: []} Status: ❌ Rejected Error: Empty array

Input: {titles: " "} Status: ❌ Rejected Error: Whitespace only


⚠️ Invalid Per-Row Inputs (Accepted but Skipped)

Input: {titles: "!!!"} Status: ✅ Accepted (skipped) Reason: Empty after transformation

Input: {titles: "###"} Status: ✅ Accepted (skipped) Reason: Empty after transformation

Input: {titles: " "} Status: ✅ Accepted (skipped) Reason: Empty after trimming

Input: {titles: "\n\n\n"} Status: ✅ Accepted (skipped) Reason: Empty after processing

Input: {titles: "My Blog"} Status: ✅ Accepted Reason: Processes normally

Input: {titles: ["Title1", "Title2"]} Status: ✅ Accepted Reason: Processes normally


⚠️ To Fix Invalid Input?

Make sure your input doesn't fall under any of these types:

❌ null or undefined ❌ Number: 123 ❌ Boolean: true ❌ Object without titles field: {} ❌ titles is a number: {titles: 123} ❌ titles is an object: {titles: {}} ❌ Empty string: {titles: ""} ❌ Empty array: {titles: []} ❌ Whitespace only: {titles: " "}


Use Cases?

E-commerce product URLs Blog post permalinks Content management systems API integrations


Why Do You Need It?

Are you planning on creating slugs manually? 🤨 Or do you know the sorcery of Excel formulas or a Python script to do batch conversion?

Ask yourself: Will it remove symbols and special characters? Will it provide clean slug output every time? What about German, French, Italian, Slavic, Nordic character conversions to plain English alphabets? 😈 This tool does all of that automatically.


How Does This Save You Time?

If an input is not processed, will I be informed - What went wrong? How to fix it? How many inputs were processed? How many were left out or turned into ugly slugs?

✅ Yes to all of the above.

Do you like those strings of alphanumeric and symbols clogging up your titles in the URL?

this#%^-is&%_not%@&)_what+587@%will*#!help24$&_you%@

That slug is a nightmare to even read. This tool fixes that.


Does It Always Work? Yes. Always.

How? Because it's designed to handle most commonly occurring edge cases. You won't lose money on any invalid input, system crash, or unforeseen errors. Before the slug generator engine runs, it does a self-test to check everything is running in order.


🔗 API Integration -

This actor can be integrated into your applications via Apify's REST API.


Example: JavaScript

const response = await fetch('https://api.apify.com/v2/acts/{actor-id}/runs', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ titles: "Product 1\nProduct 2\nProduct 3", format: "text", separator: "-", limit: 60 }) });

const result = await response.json(); console.log(result.data.output);


Example: Python

import requests

response = requests.post( 'https://api.apify.com/v2/acts/{actor-id}/runs', json={ "titles": "Product 1\nProduct 2\nProduct 3", "format": "text", "separator": "-", "limit": 60 }, headers={'Authorization': 'Bearer YOUR_API_TOKEN'} )

slugs = response.json()['data'] ['output']


Getting Your API Token -

Go to Apify console Settings → Integrations → API tokens Copy your token Use in Authorization header


End of README 👋🏻