# Slugify API

> Slugify converts text into clean, URL-friendly slugs with custom separators and optional lowercase formatting. Pass any raw string to get back the original text and its normalized slug with accents stripped and spaces replaced.

**Endpoint:** `POST https://api.apiverve.com/v1/slugify`  
**Category:** Text Processing  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/slugify

## Overview

Slugify works by normalizing text, removing accents, stripping special characters, and replacing spaces with separators. Supports both hyphen and underscore separators with optional lowercase conversion. Use it to create SEO-friendly URL slugs for blog posts, product pages and permalinks.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/slugify" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello World! This is a Test & Example","separator":"-","lowercase":true}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `text` | string | Yes | The text to convert to a slug |
| `separator` | string | No | The separator character. default -. One of: -, _ |
| `lowercase` | boolean | No | Convert to lowercase (default: true). default true |

## Response fields

- `original` — string · Original input text before slugification
- `slug` — string · URL-friendly slug generated from the input text
- `separator` — string · Separator character used to join words in the slug
- `lowercase` — boolean · Whether the slug was converted to lowercase
- `length` — number · Number of characters in the generated slug

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "original": "Hello World! This is a Test & Example",
    "slug": "hello-world-this-is-a-test-example",
    "separator": "-",
    "lowercase": true,
    "length": 34
  }
}
```

## Use cases

- **URL Generation** — Create SEO-friendly URLs for blog posts, articles, and product pages from titles
- **File Naming** — Generate safe filenames from user input or document titles for file storage systems
- **Database Keys** — Create readable, URL-safe identifiers for database records and API resources
- **Link Management** — Generate clean, shareable links for content that are both readable and SEO-optimized

## SDKs

- **npm** — `npm install @apiverve/slugify` (https://www.npmjs.com/package/@apiverve/slugify)
- **PyPI** — `pip install apiverve-slugify` (https://pypi.org/project/apiverve-slugify/)
- **NuGet** — `dotnet add package APIVerve.API.Slugify` (https://www.nuget.org/packages/APIVerve.API.Slugify)
- **Source** — https://github.com/apiverve/slugify-api

## More

- Full reference: https://docs.apiverve.com/ref/slugify
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
