# Email Parser API
> Parse a raw email (RFC 822 / MIME / .eml) into clean, structured data. Send the raw message (or a URL to a .eml file) and get back the sender, recipients (to / cc / bcc / reply-to) with names and addresses split out, the subject, the parsed date, the Message-ID, In-Reply-To and References (for threading), priority, the plain-text and HTML bodies, every header, and metadata for each attachment (filename, content type, size, content-id — never the binary payload). A /v1/headers endpoint returns just the header map. Parsing is fully local (no third-party service) and nothing is stored. Live. 3 endpoints. Built for inbound-email processing, .eml viewers, mailbox import, ticketing and email-automation pipelines. Distinct from address validation and SPF/DMARC checks.

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

## Pricing
- **Free** (Free) — 1,580 calls/Mo, 2 req/s
- **Starter** ($8/Mo) — 32,000 calls/Mo, 8 req/s
- **Pro** ($27/Mo) — 190,000 calls/Mo, 20 req/s
- **Mega** ($63/Mo) — 970,000 calls/Mo, 50 req/s

## Endpoints

### Email

#### `GET /v1/headers` — Parse email headers

**Parameters:**
- `email` (query, required, string) — Raw email Example: `From: Ada <ada@example.com>
To: Charles <charles@example.com>
Subject: Engine notes
Date: Wed, 22 Oct 2008 12:58:39 +0000
Message-ID: <abc@example.com>
Content-Type: text/plain

Hello Charles!`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/emailparse-api/v1/headers?email=From%3A+Ada+%3Cada%40example.com%3E%0D%0ATo%3A+Charles+%3Ccharles%40example.com%3E%0D%0ASubject%3A+Engine+notes%0D%0ADate%3A+Wed%2C+22+Oct+2008+12%3A58%3A39+%2B0000%0D%0AMessage-ID%3A+%3Cabc%40example.com%3E%0D%0AContent-Type%3A+text%2Fplain%0D%0A%0D%0AHello+Charles%21"
```

**Response:**
```json
{
    "data": {
        "count": 6,
        "headers": {
            "to": "\"Charles\" <charles@example.com>",
            "date": "\"2008-10-22T12:58:39.000Z\"",
            "from": "\"Ada\" <ada@example.com>",
            "subject": "Engine notes",
            "message-id": "<abc@example.com>",
            "content-type": "{\"value\":\"text/plain\",\"params\":{}}"
        }
    },
    "meta": {
        "timestamp": "2026-06-02T16:52:02.016Z",
        "request_id": "fcbcf154-070e-4498-beba-75fdb12aecea"
    },
    "status": "ok",
    "message": "Parse email headers",
    "success": true
}
```

#### `GET /v1/parse` — Parse a raw email

**Parameters:**
- `email` (query, required, string) — Raw email (RFC822/MIME) — or use url Example: `From: Ada <ada@example.com>
To: Charles <charles@example.com>
Subject: Engine notes
Date: Wed, 22 Oct 2008 12:58:39 +0000
Message-ID: <abc@example.com>
Content-Type: text/plain

Hello Charles!`
- `url` (query, optional, string) — URL to a .eml file instead

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/emailparse-api/v1/parse?email=From%3A+Ada+%3Cada%40example.com%3E%0D%0ATo%3A+Charles+%3Ccharles%40example.com%3E%0D%0ASubject%3A+Engine+notes%0D%0ADate%3A+Wed%2C+22+Oct+2008+12%3A58%3A39+%2B0000%0D%0AMessage-ID%3A+%3Cabc%40example.com%3E%0D%0AContent-Type%3A+text%2Fplain%0D%0A%0D%0AHello+Charles%21"
```

**Response:**
```json
{
    "data": {
        "cc": null,
        "to": {
            "text": "\"Charles\" <charles@example.com>",
            "addresses": [
                {
                    "name": "Charles",
                    "address": "charles@example.com"
                }
            ]
        },
        "bcc": null,
        "date": "2008-10-22T12:58:39.000Z",
        "from": {
            "text": "\"Ada\" <ada@example.com>",
            "addresses": [
                {
                    "name": "Ada",
                    "address": "ada@example.com"
                }
            ]
        },
        "html": null,
        "text": "Hello Charles!",
        "subject": "Engine notes",
        "priority": null,
        "reply_to": null,
        "message_id": "<abc@example.com>",
        "references": null,
        "attachments": [],
        "in_reply_to": null,
        "attachment_count": 0
    },
    "meta": {
        "timestamp": "2026-06-02T16:52:02.137Z",
        "request_id": "a5fbde91-64ce-4fc3-95e1-017a9014d2f3"
    },
    "status": "ok",
    "message": "Parse a raw email",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "auth": "none upstream; this gateway requires x-api-key",
        "name": "Email Parser API",
        "note": "Parse a raw email (RFC 822 / MIME / .eml). Pass ?email= the raw message or ?url= a .eml URL. /v1/parse returns from/to/cc/subject/date/message-id, the plain and HTML bodies and attachment metadata (filename, type, size — never the binary content); /v1/headers returns all header lines. Distinct from email-api (address validation). Live, nothing stored.",
        "source": "Local MIME parsing (mailparser) — no key, no upstream",
        "endpoints": 3
    },
    "meta": {
        "timestamp": "2026-06-02T16:52:02.245Z",
        "request_id": "1ca20070-c78b-4508-ad45-2774571dbe0a"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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