SoonOne MCP server, all 40 APIs as agent tools. See how it works

AI-powered email processing and data extraction

Email Parser API

Transform unstructured email data into actionable insights with our AI-powered Email Parser API. Extract key information, analyze content, and automate email processing workflows with ease.

Our Email Parser API is a robust solution that processes email content to extract structured data, including sender and recipient details, subject lines, message bodies, attachments, and metadata with enterprise-grade reliability.

Free tier included, no credit card required. One key works across all 40 APIs.

At a glance
Processing Speed
<2s
Data Fields
30+
File Formats
10+

Key features

  • Automate email processing and data extraction at scale
  • Extract structured data from email headers and content
  • Process email attachments including PDFs and documents
  • Multi-encoding support for international emails
  • Advanced metadata extraction and analysis
  • Integrate seamlessly with your existing workflows and applications

Built for

  • Customer support ticket automation
  • Email marketing analytics
  • Legal document processing
  • CRM data synchronization
  • Compliance and audit workflows
  • Business intelligence dashboards
  • Invoice and receipt processing
  • Lead generation and qualification

Try it

Build the request for your data

Edit the parameters below and see the exact curl command and JSON response you will get. No key required to preview.

POST/v1/email/text
Open in Playground
Request · HTTP
POST /parser/v1/email/text HTTP/1.1
Host: api.apicodex.io
Host: api.apicodex.io
Content-Type: application/json
X-Api-Key: YOUR_API_KEY
"email": "From: sender@example.com\nTo: recipient@example.com\nSubject: Test Email\n\nHello, this is a test email."
Response · JSON
200 OK
{
"subject": "Test Email for Email Parser API",
"from": [
  {
    "name": "John Doe",
    "address": "sender@example.com"
  }
],
"to": [
  {
    "name": "Jane Smith",
    "address": "recipient@example.com"
  }
],
"cc": [
  {
    "name": "CC User",
    "address": "cc@example.com"
  }
],
"bcc": [
  {
    "name": "BCC User",
    "address": "bcc@example.com"
  }
],
"date": "2025-05-12T09:00:00.000Z",
"message_id": "<abc123@example.com>",
"in_reply_to": "<original123@example.com>",
"references": "<ref123@example.com>",
"priority": null,
"attachments": [
  {
    "filename": "test-document.pdf",
    "contentType": "application/pdf",
    "content": "%PDF-1.3\n...",
    "size": 430
  }
],
"html": "<!DOCTYPE html>\n<html>\n...",
"text": "Hello,\n\nThis is a test email...",
"headers": {
  "return-path": [
    {
      "value": [
        {
          "address": "sender@example.com",
          "name": ""
        }
      ],
      "initial": "<sender@example.com>"
    }
  ],
  "delivered-to": [
    {
      "value": [
        {
          "address": "recipient@example.com",
          "name": ""
        }
      ],
      "initial": "recipient@example.com"
    }
  ]
}
}

Documentation

Email Parser API Documentation

The Email Parser API provides comprehensive parsing and extraction of email data. This documentation outlines how to effectively integrate and utilize the API for processing email content, extracting attachments, and analyzing message structures.

Base URL

url
https://api.apicodex.io/parser

Authentication

Authenticate every request with your API key: send it in an X-Api-Key header, or pass it as an ?apikey= query parameter.

headers
{
"X-Api-Key": "YOUR_API_KEY"
}

Request and response

Illustrative values. Confirm current endpoint behavior, quotas, and data freshness in the API documentation before production use.

request · http
POST /v1/email/text HTTP/1.1
Host: api.apicodex.io
Content-Type: application/json
X-Api-Key: YOUR_API_KEY

{
"email": "From: sender@example.com\nTo: recipient@example.com\nSubject: Test Email\n\nHello, this is a test email."
}
response · json
{
"subject": "Test Email for Email Parser API",
"from": [
  {
    "name": "John Doe",
    "address": "sender@example.com"
  }
],
"to": [
  {
    "name": "Jane Smith",
    "address": "recipient@example.com"
  }
],
"cc": [
  {
    "name": "CC User",
    "address": "cc@example.com"
  }
],
"bcc": [
  {
    "name": "BCC User",
    "address": "bcc@example.com"
  }
],
"date": "2025-05-12T09:00:00.000Z",
"message_id": "<abc123@example.com>",
"in_reply_to": "<original123@example.com>",
"references": "<ref123@example.com>",
"priority": null,
"attachments": [
  {
    "filename": "test-document.pdf",
    "contentType": "application/pdf",
    "content": "%PDF-1.3\n...",
    "size": 430
  }
],
"html": "<!DOCTYPE html>\n<html>\n...",
"text": "Hello,\n\nThis is a test email...",
"headers": {
  "return-path": [
    {
      "value": [
        {
          "address": "sender@example.com",
          "name": ""
        }
      ],
      "initial": "<sender@example.com>"
    }
  ],
  "delivered-to": [
    {
      "value": [
        {
          "address": "recipient@example.com",
          "name": ""
        }
      ],
      "initial": "recipient@example.com"
    }
  ]
}
}

Code examples

cURL
curl -X POST "/v1/email/upload" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -F "file=@email.eml"

Endpoints

POST /v1/email/upload

Upload an .eml file to parse and extract information.

curl -X POST "/v1/email/upload" -H "X-Api-Key: YOUR_API_KEY" -F "file=@email.eml"

POST /v1/email/text

Send raw email content to parse and extract information.

curl -X POST "/v1/email/text" -H "Content-Type: application/json" -d '{"email": "From: sender@example.com..."}'

Pricing

Email Parser API Pricing

One key, one subscription, all 40 APIs. Start free and upgrade when you grow. No minimums, no lock-in.

This API costs 25 credits per request. Credits are shared across every API on your plan.

Estimate your monthly cost

Drag the slider to match your expected request volume. We will recommend the cheapest plan that covers it.

10,000

Recommended plan

Pro

$99.99 /month

Credits used250,000
Credits included250,000
Cost per 1K requests$9.999
Choose Pro

Free

Free
1,000 credits · ~40 requests/mo · 2 rps
  • All 40 APIs included
  • No credit card required
  • Full documentation and examples
Start for free

Starter

Popular
$29.99/month
50,000 credits · ~2,000 requests/mo · 10 rps
  • All 40 APIs included
  • Email support
  • Usage dashboard and analytics
Start with Starter

Pro

$99.99/month
250,000 credits · ~10,000 requests/mo · 25 rps
  • All 40 APIs included
  • Priority support
  • Up to 5 API keys
Start with Pro

Need a different plan?

Tell us about your API, volume, or support requirements.

Contact us

Coming soon · MCP

Use the Email Parser API from your AI agent

The API Codex MCP server will expose this API, and the other 39, to Claude, Cursor and any MCP client as tools. Same key, same credits, one config entry.

About the MCP server

FAQ

Frequently asked questions

The Email Parser API supports both raw email text and standard .eml files, which are the universal format for storing email messages. You can upload an .eml file directly via the /v1/email/upload endpoint or send raw email content as a JSON string to the /v1/email/text endpoint. The API automatically detects the input format and applies the appropriate parsing strategy. For .eml files, the parser handles the full MIME structure including multipart boundaries, encoded headers, and nested content. For raw text input, it parses RFC 5322-compliant email format with headers separated from the body by a blank line. Both methods return identical structured JSON output.

The API extracts over 30 data fields from each email message. This includes all addressing headers (From, To, Cc, Bcc) with separated display names and email addresses, the Subject line decoded from any encoding, and the Date parsed into ISO-8601 format. Message content is extracted in both HTML and plain text versions. Attachments are catalogued with filename, MIME content type, size, and base64-encoded content. Routing metadata includes Message-ID, In-Reply-To, and References headers for threading, plus Received headers showing the email's server path. Priority flags, Return-Path, and all raw headers are also included in the structured JSON response.

The API automatically detects and processes all email attachments during parsing. For each attachment, the response includes the original filename, MIME content type (such as application/pdf or image/jpeg), file size in bytes, and the attachment content encoded in base64 format. You can decode the base64 string to reconstruct the original file in your application. The API distinguishes between regular attachments that users explicitly added and inline attachments like embedded images referenced in HTML content. It handles all standard file types including documents, images, archives, and spreadsheets. For emails with multiple attachments, each is returned as a separate object in the attachments array.

Yes, the API provides comprehensive character encoding support for parsing international emails. It handles UTF-8, UTF-16, ISO-8859 family encodings for European languages, Windows-1251 for Cyrillic, Windows-1256 for Arabic, Shift_JIS and ISO-2022-JP for Japanese, GB2312 and GBK for Chinese, EUC-KR for Korean, and many other regional encodings. The parser automatically detects the encoding specified in the Content-Type charset header and applies the correct decoder. When no encoding is specified, it uses heuristic detection based on byte patterns. All output is normalized to UTF-8 for consistent processing. Content-Transfer-Encoding methods like quoted-printable and base64 are fully supported as well.

Yes, the Email Parser API is built to handle complex and deeply nested email structures that challenge simpler parsers. It correctly processes multipart/mixed messages with attachments, multipart/alternative messages with both text and HTML versions, and multipart/related messages with inline images. The parser handles forwarded messages containing embedded original emails, email chains with quoted content, and messages with multiple levels of MIME nesting. It identifies MIME boundary markers, recursively processes each section according to its content type, and maintains the hierarchical relationships between parts. This makes it reliable for processing business correspondence, automated notification emails, and complex marketing messages.

The Email Parser API processes most standard emails in under 2 seconds, with simple text-only messages completing in under 500 milliseconds. Processing time scales with email complexity and attachment size. Emails with large attachments or deeply nested MIME structures may take slightly longer. The API accepts emails up to 10MB in total size, which accommodates the vast majority of business emails. For optimal performance with high-volume processing, we recommend implementing asynchronous workflows using job queues and processing emails in parallel batches. The API supports concurrent requests across all paid plans, allowing you to scale throughput by increasing parallelism rather than waiting for sequential responses.