# Morse Code API
> Morse code conversion as an API, computed locally and deterministically. The encode endpoint turns text into International Morse code, mapping A–Z, the digits 0–9 and common punctuation to dots and dashes, separating letters with a space and words with a slash, and listing any unsupported characters it skipped. The decode endpoint turns Morse code back into text, accepting word separators written as a slash, a pipe or a wide gap, and marking unrecognised symbols. The timing endpoint computes the PARIS-standard timing from a words-per-minute speed — the dot duration is 1200/WPM milliseconds, a dash is three dots, and the gaps are one, three and seven dot units for intra-character, inter-character and word spacing — and, given a Morse message, the total number of units and the transmission time. The word PARIS is exactly 50 units, which defines the WPM scale. Everything is computed locally and deterministically, so it is instant and private. Ideal for amateur-radio, aviation, education, accessibility, puzzle and game app developers, signalling and CW-training tools, and learning Morse. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is Morse code; for Base64 and JWT use an encoding API and for Caesar and substitution ciphers 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/morse-api/..."
```

## Pricing
- **Free** (Free) — 5,500 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 46,000 calls/Mo, 6 req/s
- **Pro** ($12/Mo) — 235,000 calls/Mo, 15 req/s
- **Mega** ($38/Mo) — 1,300,000 calls/Mo, 40 req/s

## Endpoints

### Morse

#### `GET /v1/decode` — Morse to text

**Parameters:**
- `morse` (query, required, string) — Morse code Example: `... --- ...`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/morse-api/v1/decode?morse=...+---+..."
```

**Response:**
```json
{
    "data": {
        "note": "Decoded International Morse. Word separators '/', '|' or wide gaps are accepted; unrecognised symbols become '?' and are listed.",
        "text": "SOS",
        "inputs": {
            "morse": "... --- ..."
        },
        "unknown_symbols": []
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:33.213Z",
        "request_id": "3c06c473-8c02-45a2-abe4-d741399b6504"
    },
    "status": "ok",
    "message": "Morse to text",
    "success": true
}
```

#### `GET /v1/encode` — Text to Morse

**Parameters:**
- `text` (query, required, string) — Text to encode Example: `SOS`

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

**Response:**
```json
{
    "data": {
        "note": "International Morse. Letters are separated by a space and words by ' / '. Unsupported characters are skipped and listed.",
        "morse": "... --- ...",
        "inputs": {
            "text": "SOS"
        },
        "characters_encoded": 3,
        "skipped_characters": []
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:33.331Z",
        "request_id": "93ebec8f-73f0-4928-bd40-e1e837bd55fa"
    },
    "status": "ok",
    "message": "Text to Morse",
    "success": true
}
```

#### `GET /v1/timing` — Morse timing

**Parameters:**
- `wpm` (query, required, string) — Words per minute Example: `20`
- `morse` (query, optional, string) — Optional Morse message for its duration Example: `... --- ...`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/morse-api/v1/timing?wpm=20&morse=...+---+..."
```

**Response:**
```json
{
    "data": {
        "note": "PARIS standard: dot = 1200/WPM ms; dash = 3 dots; gaps are 1 (intra-character), 3 (inter-character) and 7 (word) dot units. The word 'PARIS' is exactly 50 units.",
        "dot_ms": 60,
        "inputs": {
            "wpm": 20
        },
        "dash_ms": 180,
        "word_gap_ms": 420,
        "message_units": 27,
        "message_duration_s": 1.62,
        "message_duration_ms": 1620,
        "inter_character_gap_ms": 180,
        "intra_character_gap_ms": 60
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:33.425Z",
        "request_id": "1535bf35-54cf-4eaa-b8d2-cac2330b49e9"
    },
    "status": "ok",
    "message": "Morse timing",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "International Morse: letters split by a space, words by ' / '. Timing uses the PARIS standard, dot = 1200/WPM ms. Supports A–Z, 0–9 and common punctuation.",
        "service": "morse-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/decode": "Morse code back to text.",
            "GET /v1/encode": "Text to International Morse code.",
            "GET /v1/timing": "Dot/dash/gap durations from WPM, and the duration of an optional Morse message."
        },
        "description": "Morse code converter: encode text to International Morse, decode Morse back to text, and compute PARIS-standard timing (dot/dash durations and message duration) from words per minute."
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:33.526Z",
        "request_id": "b2f735e2-7373-4b7a-9791-ac29d5f59ece"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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