# Grammar API
> Catch spelling mistakes in six languages — English, German, Spanish, French, Portuguese and Dutch — and get English style and grammar suggestions in one call. Spelling errors come with their position in the text and a ranked list of corrections; style suggestions flag repeated words, weasel words, passive voice, wordiness, clichés and more. A combined check returns spelling and style together (sorted by position), a spelling-only endpoint covers all six languages, a single-word endpoint returns corrections for one word, and a languages endpoint lists what is supported. Every endpoint takes text via the query string or the request body and returns lean JSON. Pure server-side computation (Hunspell dictionaries + write-good, no third-party upstream, no LLM cost), so responses are instant and always available. Ideal for editors and CMSs, form and comment validation, chat and email tools, and writing assistants.

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

## Pricing
- **Free** (Free) — 28,000 calls/Mo, 2 req/s
- **Basic** ($7/Mo) — 320,000 calls/Mo, 6 req/s
- **Pro** ($20/Mo) — 2,400,000 calls/Mo, 22 req/s
- **Mega** ($48/Mo) — 13,000,000 calls/Mo, 75 req/s

## Endpoints

### Grammar

#### `GET /v1/check` — Spelling + English style check

**Parameters:**
- `text` (query, required, string) — Text to check Example: `I recieve the the report`
- `lang` (query, optional, string) — en|de|es|fr|pt|nl Example: `en`
- `style` (query, optional, string) — Include style suggestions Example: `true`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/grammar-api/v1/check?text=I+recieve+the+the+report&lang=en&style=true"
```

**Response:**
```json
{
    "data": {
        "issues": [
            {
                "type": "spelling",
                "word": "recieve",
                "length": 7,
                "offset": 2,
                "message": "\"recieve\" may be misspelled",
                "suggestions": [
                    "receive",
                    "relieve"
                ]
            },
            {
                "type": "style",
                "length": 3,
                "offset": 14,
                "message": "\"the\" is repeated",
                "suggestions": []
            }
        ],
        "language": "en",
        "issue_count": 2,
        "style_count": 1,
        "spelling_count": 1
    },
    "meta": {
        "timestamp": "2026-05-30T22:48:28.481Z",
        "request_id": "f1527690-bd9c-437a-a282-ebb999da980a"
    },
    "status": "ok",
    "message": "Text checked",
    "success": true
}
```

#### `GET /v1/languages` — Supported languages

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

**Response:**
```json
{
    "data": {
        "count": 6,
        "languages": [
            {
                "code": "en",
                "name": "English",
                "style_check": true
            },
            {
                "code": "de",
                "name": "German",
                "style_check": false
            },
            {
                "code": "es",
                "name": "Spanish",
                "style_check": false
            },
            {
                "code": "fr",
                "name": "French",
                "style_check": false
            },
            {
                "code": "pt",
                "name": "Portuguese",
                "style_check": false
            },
            {
                "code": "nl",
                "name": "Dutch",
                "style_check": false
            }
        ]
    },
    "meta": {
        "timestamp": "2026-05-30T22:48:28.558Z",
        "request_id": "dff17407-73a2-4b4d-97ad-23b9e3aee604"
    },
    "status": "ok",
    "message": "Languages retrieved",
    "success": true
}
```

#### `GET /v1/spell` — Spelling check only

**Parameters:**
- `text` (query, required, string) — Text to check Example: `I recieve the the report`
- `lang` (query, optional, string) — Language code Example: `en`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/grammar-api/v1/spell?text=I+recieve+the+the+report&lang=en"
```

**Response:**
```json
{
    "data": {
        "language": "en",
        "misspelled": [
            {
                "type": "spelling",
                "word": "recieve",
                "length": 7,
                "offset": 2,
                "message": "\"recieve\" may be misspelled",
                "suggestions": [
                    "receive",
                    "relieve"
                ]
            }
        ],
        "misspelled_count": 1
    },
    "meta": {
        "timestamp": "2026-05-30T22:48:28.633Z",
        "request_id": "c25d3754-9391-49ed-bd34-f958315e966c"
    },
    "status": "ok",
    "message": "Spelling checked",
    "success": true
}
```

#### `GET /v1/suggest` — Corrections for a single word

**Parameters:**
- `word` (query, required, string) — Word Example: `recieve`
- `lang` (query, optional, string) — Language code Example: `en`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/grammar-api/v1/suggest?word=recieve&lang=en"
```

**Response:**
```json
{
    "data": {
        "word": "recieve",
        "correct": false,
        "language": "en",
        "suggestions": [
            "receive",
            "relieve"
        ]
    },
    "meta": {
        "timestamp": "2026-05-30T22:48:28.712Z",
        "request_id": "2a69846a-a34f-4565-8d24-c1e1a266e27d"
    },
    "status": "ok",
    "message": "Suggestions retrieved",
    "success": true
}
```


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