# Text Tools API
> A fast, fully-local text-utilities toolkit: convert between 10 case styles (upper, lower, title, sentence, camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, dot.case), generate URL-friendly slugs, compute text statistics (word, character, sentence, line and paragraph counts, average word length and reading time), and produce lorem-ipsum placeholder text by words, sentences or paragraphs. Pure server-side compute, no third-party upstream, so responses are instant and always available. Ideal for CMS, editors, developer tools, forms and content pipelines.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/text-api/..."
```

## Pricing
- **Free** (Free) — 15,000 calls/Mo, 3 req/s
- **Basic** ($4/Mo) — 250,000 calls/Mo, 15 req/s
- **Pro** ($13/Mo) — 1,400,000 calls/Mo, 50 req/s
- **Mega** ($36/Mo) — 7,000,000 calls/Mo, 150 req/s

## Endpoints

### Text

#### `GET /v1/case` — Convert text to a case style

**Parameters:**
- `text` (query, required, string) — Text to convert Example: `Hello World Foo`
- `to` (query, required, string) — upper, lower, title, sentence, camel, pascal, snake, kebab, constant, dot Example: `snake`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/text-api/v1/case?text=Hello+World+Foo&to=snake"
```

**Response:**
```json
{
    "data": {
        "case": "snake",
        "input": "Hello World Foo",
        "result": "hello_world_foo"
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:25.703Z",
        "request_id": "1cd0c8ad-7e8e-4568-a9c7-5651e7742959"
    },
    "status": "ok",
    "message": "Case converted",
    "success": true
}
```

#### `GET /v1/lorem` — Generate lorem ipsum

**Parameters:**
- `paragraphs` (query, optional, string) — Number of paragraphs (default 3) Example: `3`
- `sentences` (query, optional, string) — Number of sentences
- `words` (query, optional, string) — Number of words

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/text-api/v1/lorem?paragraphs=3"
```

**Response:**
```json
{
    "data": {
        "text": "Tempor do nisi dolor velit commodo minim eu do ullamco fugiat eu commodo. Non sint ex dolor nostrud sunt reprehenderit do ex qui ea aute. Id officia incididunt non aute est ut laborum elit mollit. Eu sed deserunt veniam non culpa lorem irure. Ex veniam consectetur esse aliquip elit.\n\nVeniam magna sit adipiscing excepteur pariatur aliqua occaecat tempor eu quis enim dolore aliquip. Est aute ex reprehenderit deserunt labore id irure tempor lorem sunt nisi ullamco. Consectetur et ex enim consequat adipiscing. Qui duis enim non ex labore dolore excepteur duis.\n\nSunt incididunt tempor eiusmod dolor proident. Veniam qui occaecat exercitation anim labore quis sunt ut aliqua excepteur ad laboris occaecat. Excepteur irure irure ut laboris consequat esse exercitation proident elit velit cupidatat culpa cillum minim. Commodo aute id consectetur sunt ut consequat sit.",
        "unit": "paragraphs",
        "count": 3
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:25.777Z",
        "request_id": "d708822d-d825-4930-b950-28337a9ce9bd"
    },
    "status": "ok",
    "message": "Lorem generated",
    "success": true
}
```

#### `GET /v1/slug` — Generate a URL slug

**Parameters:**
- `text` (query, required, string) — Text to slugify Example: `Héllo, World!`
- `separator` (query, optional, string) — Separator char (default -) Example: `-`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/text-api/v1/slug?text=H%C3%A9llo%2C+World%21&separator=-"
```

**Response:**
```json
{
    "data": {
        "slug": "hello-world",
        "input": "Héllo, World!"
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:25.827Z",
        "request_id": "b00d5685-5401-49f9-9f84-3eb7cf3e5c8c"
    },
    "status": "ok",
    "message": "Slug generated",
    "success": true
}
```

#### `GET /v1/stats` — Compute text statistics

**Parameters:**
- `text` (query, required, string) — Text to analyse Example: `Hello world. This is a test!`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/text-api/v1/stats?text=Hello+world.+This+is+a+test%21"
```

**Response:**
```json
{
    "data": {
        "lines": 1,
        "words": 6,
        "sentences": 2,
        "characters": 28,
        "paragraphs": 1,
        "avg_word_length": 3.83,
        "characters_no_spaces": 23,
        "reading_time_minutes": 0.03
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:25.912Z",
        "request_id": "17db5001-34d3-4f96-9579-8ddcf3d205f7"
    },
    "status": "ok",
    "message": "Stats computed",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/text-api
OpenAPI spec: https://www.oanor.com/api/text-api/openapi.json
