# Title Case API
> Convert a heading to proper headline (title) case the way editors do — not a naive capitalise-every-word. It capitalises the first and last words and all the major words, while keeping articles (a, an, the), coordinating conjunctions (and, but, or…) and prepositions lowercase, and always capitalises the word right after a colon. Choose AP style (lowercases short prepositions, capitalises longer ones) or Chicago style (lowercases prepositions of any length). Hyphenated compounds such as well-known and state-of-the-art are handled correctly. Perfect for article and blog titles, headings, SEO meta titles, product and section names, and CMS tooling. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. Distinct from a plain title/sentence case converter, which capitalises every word.

## 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/titlecase-api/..."
```

## Pricing
- **Free** (Free) — 1,175 calls/Mo, 2 req/s
- **Starter** ($2/Mo) — 10,150 calls/Mo, 8 req/s
- **Pro** ($22/Mo) — 152,500 calls/Mo, 20 req/s
- **Mega** ($60/Mo) — 805,000 calls/Mo, 50 req/s

## Endpoints

### Title Case

#### `GET /v1/titlecase` — Title-case a heading

**Parameters:**
- `text` (query, required, string) — The heading Example: `the lord of the rings: the two towers`
- `style` (query, optional, string) — ap|chicago (default ap) Example: `ap`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/titlecase-api/v1/titlecase?text=the+lord+of+the+rings%3A+the+two+towers&style=ap"
```

**Response:**
```json
{
    "data": {
        "input": "the lord of the rings: the two towers",
        "style": "ap",
        "result": "The Lord of the Rings: The Two Towers"
    },
    "meta": {
        "timestamp": "2026-06-03T09:25:10.020Z",
        "request_id": "241d8a4b-7c3d-4a32-b68c-1e3cde3873fa"
    },
    "status": "ok",
    "message": "Title-case a heading",
    "success": true
}
```

### Reference

#### `GET /v1/styles` — Style minor-word lists

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/titlecase-api/v1/styles"
```

**Response:**
```json
{
    "data": {
        "styles": [
            {
                "name": "ap",
                "note": "Associated Press — lowercases articles, conjunctions and short prepositions.",
                "minor_words": [
                    "a",
                    "an",
                    "and",
                    "as",
                    "at",
                    "but",
                    "by",
                    "for",
                    "if",
                    "in",
                    "into",
                    "is",
                    "nor",
                    "of",
                    "off",
                    "on",
                    "or",
                    "out",
                    "per",
                    "so",
                    "the",
                    "to",
                    "up",
                    "v",
                    "via",
                    "vs",
                    "yet"
                ]
            },
            {
                "name": "chicago",
                "note": "Chicago Manual of Style — also lowercases longer prepositions.",
                "minor_words": [
                    "a",
                    "about",
                    "above",
                    "across",
                    "after",
                    "against",
                    "along",
                    "amid",
                    "among",
                    "an",
                    "and",
                    "around",
                    "
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/titlecase-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "name": "Title Case API",
        "notes": "The first word, the last word and the word after a colon are always capitalised. Nothing is stored.",
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/titlecase",
                "params": {
                    "text": "the heading (required)",
                    "style": "ap|chicago (default ap)"
                },
                "returns": "the title-cased text"
            },
            {
                "path": "/v1/styles",
                "params": [],
                "returns": "the minor-word lists for each style"
            },
            {
                "path": "/v1/meta",
                "params": [],
                "returns": "this document"
            }
        ],
        "description": "Convert a heading to proper headline (title) case in AP or Chicago style — capitalising the first and last words and all major words, while keeping articles, conjunctions and prepositions lowercase (unless first/last or after a colon). Handles hyphenated compounds. This is real editorial title case, not a naive capitalise-every-word. Pure local, no key."
    },
    "meta": {
        "timestamp": "2026-06-03T09:25:10.224Z",
        "request_id": "e7721c46-7f54-460c-bc63-4807daf5669f"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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