# Keyboard Layout API
> Re-map text between keyboard layouts — the fix for text typed with the keyboard set to the wrong layout. The remap endpoint takes text, a source layout and a target layout, and rewrites each character to the one produced by the same physical key on the other layout. So text accidentally typed on a Dvorak-configured keyboard while you meant QWERTY (or the reverse) is recovered exactly, and because the mapping is position-preserving it round-trips perfectly. It supports QWERTY (US), Dvorak and Colemak, including the shifted symbols, and leaves characters that are not on a remappable key (spaces and accents) untouched. The layouts endpoint returns the full key map for each layout. Everything is computed locally and deterministically, so it is instant and private. Ideal for fixing wrong-layout typing, building text editors and IME tools, layout-learning aids, and cross-layout search. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This remaps between keyboard layouts; for classical ciphers (Caesar, ROT13, Morse) use a cipher API.

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

## Pricing
- **Free** (Free) — 6,435 calls/Mo, 2 req/s
- **Starter** ($8/Mo) — 15,950 calls/Mo, 8 req/s
- **Pro** ($28/Mo) — 210,500 calls/Mo, 20 req/s
- **Mega** ($66/Mo) — 1,095,000 calls/Mo, 50 req/s

## Endpoints

### Keyboard

#### `GET /v1/layouts` — List supported layouts

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

**Response:**
```json
{
    "data": {
        "count": 3,
        "layouts": [
            {
                "name": "QWERTY (US)",
                "slug": "qwerty",
                "lower_row": "`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./",
                "upper_row": "~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>?"
            },
            {
                "name": "Dvorak (US)",
                "slug": "dvorak",
                "lower_row": "`1234567890[]',.pyfgcrl/=\\aoeuidhtns-;qjkxbmwvz",
                "upper_row": "~!@#$%^&*(){}\"<>PYFGCRL?+|AOEUIDHTNS_:QJKXBMWVZ"
            },
            {
                "name": "Colemak (US)",
                "slug": "colemak",
                "lower_row": "`1234567890-=qwfpgjluy;[]\\arstdhneio'zxcvbkm,./",
                "upper_row": "~!@#$%^&*()_+QWFPGJLUY:{}|ARSTDHNEIO\"ZXCVBKM<>?"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-03T17:42:13.394Z",
        "request_id": "8aec397b-15ef-43c2-b17c-1bdf6243ccea"
    },
    "status": "ok",
    "message": "Layouts",
    "success": true
}
```

#### `GET /v1/remap` — Remap text between layouts

**Parameters:**
- `text` (query, required, string) — The text to convert Example: `hello`
- `from` (query, optional, string) — Source layout (default qwerty) Example: `qwerty`
- `to` (query, required, string) — Target layout Example: `dvorak`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/keyboardlayout-api/v1/remap?text=hello&from=qwerty&to=dvorak"
```

**Response:**
```json
{
    "data": {
        "to": "dvorak",
        "from": "qwerty",
        "input": "hello",
        "result": "d.nnr",
        "remapped_chars": 5,
        "unchanged_chars": 0
    },
    "meta": {
        "timestamp": "2026-06-03T17:42:13.503Z",
        "request_id": "bc6d43c8-1440-4bd6-8bcb-b371e24e093d"
    },
    "status": "ok",
    "message": "Remap layout",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "name": "Keyboard Layout API",
        "notes": "Position-preserving substitution over the 47 main keys (unshifted + shifted). remap(from,to) then remap(to,from) round-trips. Nothing is stored.",
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/remap",
                "params": {
                    "to": "target layout",
                    "from": "source layout (default qwerty)",
                    "text": "the text to convert"
                },
                "returns": "the remapped text"
            },
            {
                "path": "/v1/layouts",
                "params": [],
                "returns": "the supported layouts and their key maps"
            },
            {
                "path": "/v1/meta",
                "params": [],
                "returns": "this document"
            }
        ],
        "description": "Re-map text between keyboard layouts — the fix for text typed with the keyboard set to the wrong layout. The remap endpoint takes text, a source layout and a target layout, and rewrites each character to the one produced by the same physical key on the other layout. So text accidentally typed on a Dvorak-configured keyboard while you meant QWERTY (or the reverse) is recovered exactly, and because the mapping is position-preserving it round-trips perfectly. It supports QWERTY (US), Dvorak and Colemak, including the shifted symbols, and leaves characters that aren't on a
…(truncated, see openapi.json for full schema)
```


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