Email Parser API: How to Parse Inbound Email to JSON

Last updated July 2026

Try it now: extract email data to Excel, CSV, or JSON

Convert your email files
No install

Connect a mailbox to pull .eml/.msg in bulk, or paste a raw email to test the converter now.

or paste an email to test
Output format
Columns to extract
Extract your own custom fields
Popular:

Create a free account to download. No credit card required.

Parse email to structured JSON with one API call

MailParse takes a raw email, reads the fields you name from the body and HTML tables, and returns clean JSON. See the email parser API, or read the walkthrough below.

Last updated July 2026

If you are receiving order confirmations, web-form notifications, or vendor emails and you want the data inside your own application, you have two honest choices: write and maintain parsing code yourself, or POST the message to an email parser API and get structured fields back. This walks through how the API route works, what the JSON looks like, and when it beats rolling your own regex.

What is an email parser API?

An email parser API is an HTTP endpoint that accepts an email and returns its contents as structured JSON. You send a raw message or connect a mailbox, name the fields you want such as order_number or invoice_total, and the API responds with those values plus the standard headers. It replaces the regex, MIME decoding, and string handling you would otherwise write and keep working yourself.

How do you parse an email with an API?

There are two ways to get an email into the API, and both end at the same JSON. Pick by where your mail already lives.

Approach How it works Best for
POST a raw emailSend the full .eml or .msg body to the endpoint and read the JSON responseApps that already capture mail, or a Mailgun or SendGrid webhook you want to hand off
Connect a mailboxLink Gmail, Outlook, Microsoft 365, or IMAP; new mail is parsed automatically and pushed to your webhookTeams whose mail arrives in a normal inbox and want no server to run

API behavior as of July 2026. Check the current endpoint reference before you build.

Either way the flow is the same three steps. First, get the message to the API by POSTing the raw email or connecting the inbox. Second, define the fields once: list the values you want by name, and the parser reads them from the body and from any HTML tables, no match pattern required. Third, consume the JSON: take the response inline from the POST, or have the API deliver each parsed message to a webhook URL you control.

What does the JSON response look like?

The response is a flat object with the standard email parts plus the custom fields you named. You get the sender, recipients, subject, date, and the plain-text and HTML body, then your own keys such as order_number, invoice_total, or tracking_number as clean values. Attachments come back as a list of file names, sizes, and MIME types, so you know what was attached without the parser opening the file.

That last point matters for planning: MailParse reads the email itself, meaning the body text and the rows inside HTML tables, not the contents of a PDF or spreadsheet attached to it. If the number you need lives inside a PDF invoice rather than the message, treat that as a separate document extraction step and merge the two results in your code.

Do I need to write regex to parse email with an API?

No. The point of a parsing API is that you describe each field in plain language once instead of authoring regular expressions. You name the value you want, and the parser finds it across messages even when a sender reorders lines or renames a heading. A regex keyed to fixed positions breaks the first time a vendor changes format, which is the maintenance cost teams are usually trying to escape.

How do I get parsed data to my app automatically?

Use webhooks. When you connect a mailbox or forward mail to a parsing address, the API POSTs each parsed message to a URL you set, so your application receives structured JSON the moment an email lands. If you would rather pull, you can poll the API for recent results on a schedule. Webhooks keep your integration event-driven and avoid a cron job checking an inbox.

Can the API parse HTML emails and tables?

Yes. Order confirmations, shipping notices, and reports often arrive as HTML with a real table of line items. The API reads those repeating rows into structured records, so a three-line order becomes three objects rather than one blob of text. This is the case that trips up hand-written parsers most, because table markup varies between senders and brittle string matching falls apart.

When should you use an email parsing API vs a no-code parser?

Use the API when the parsed data feeds software: a database write, a CRM record, an internal dashboard, or a downstream automation. Use the no-code path, where you connect a mailbox and export a spreadsheet, when a person is the consumer and the data lands in Excel or Google Sheets. Many teams use both: the API for the live pipeline and an export when someone needs to eyeball a batch.

The downstream step is where an API earns its keep. Once you have order or invoice fields as JSON, you can drop them straight into the system that acts on them, whether that is your order database or a workflow that automates the accounts payable side of vendor bills. The parser does the reading; your code does the routing.

Where this fits

An API is one way to consume a parse among several. The same extraction can also export to Excel, CSV, or a live Google Sheet when a human is the audience. To see the full endpoint and webhook setup, read the email parser API page, and to shape the output for a database or another service, see how to convert email to JSON. For a plain-language primer on what parsing does before you wire it up, start with what is email parsing.