Free Temp Mail API

Free Temp Mail API

Free Temp Mail API — Disposable & Temporary Email API (No Sign-Up)

MTempMail offers a free temp mail API — a simple REST API for creating disposable, temporary email inboxes and reading their messages, with a ready-to-use public API key. It is free, needs no registration or credit card, and works from any programming language, script, or AI agent. Use it to receive verification codes, OTPs, confirmation links and attachments in automated tests, bots, sign-up flows and AI workflows.

Free public API key: pub_nRn1hUwpdmZvxQNVWDfoXgKyF7dIm9nRIIIt1qDw
Base URL: https://mtempmail.com/api

Quick start — get a temporary email in one request

# 1) Create a disposable email address
curl -X POST https://mtempmail.com/api/emails/pub_nRn1hUwpdmZvxQNVWDfoXgKyF7dIm9nRIIIt1qDw

# 2) Read the inbox for that address
curl https://mtempmail.com/api/messages/pub_nRn1hUwpdmZvxQNVWDfoXgKyF7dIm9nRIIIt1qDw/YOUR_EMAIL

# 3) List available domains
curl https://mtempmail.com/api/domains/pub_nRn1hUwpdmZvxQNVWDfoXgKyF7dIm9nRIIIt1qDw/all

All responses are JSON. Use the public key in place of {apiKey} in any endpoint documented below. The free public key is rate-limited to about 120 requests per minute per IP. Need higher limits? A private key is available in your account.

Why use MTempMail’s free temp mail API?

  • Free and no sign-up — a public key is provided, so you can start instantly.
  • Real inboxes — receive verification emails, OTP codes, links and file attachments.
  • Any stack or AI agent — plain HTTP + JSON; call it from Python, Node.js, PHP, cURL or an LLM tool.
  • Multiple domains — free .com and .edu domains to choose from.
  • Fast and reliable — instant address generation and real-time message delivery.

Endpoint: api/domains/{apiKey}/{type}

Method: GET

Parameters:

  • apiKey - Your API key.
  • type - Type of domains to fetch (free, premium, all).

Example Request:

GET api/domains/your-api-key/all

Example Response:

{
    "status": true,
    "data": {
        "domains": [
            {
                "domain": "free.com",
                "type": "Free"
            },
            {
                "domain": "lobage.com",
                "type": "Free"
            },
            {
                "domain": "premium.com",
                "type": "Premium"
            }
        ]
    }
}

Endpoint: api/emails/{apiKey}

Method: POST

Parameters:

  • apiKey - Your API key.

Example Request:

POST api/emails/your-api-key

Example Response:

{
    "status": true,
    "data": {
        "email": "[email protected]",
        "domain": "example.com",
        "ip": "127.0.0.1",
        "fingerprint": "eef780ab2ec7535e66c1405c0bff1c64",
        "expire_at": "2025-01-01T00:00:00.000000Z",
        "created_at": "2025-01-01T00:00:00.000000Z",
        "id": 1,
        "email_token": "email_token"
    }
}

Code examples: use the free temp mail API in any language

The temp mail API is plain HTTP with JSON responses, so you can call it from any language or tool. Here are copy-paste examples using the free public key.

Python

import requests
KEY  = "pub_nRn1hUwpdmZvxQNVWDfoXgKyF7dIm9nRIIIt1qDw"
BASE = "https://mtempmail.com/api"

# 1) Create a disposable inbox
res   = requests.post(f"{BASE}/emails/{KEY}").json()
email = res["data"]["email"]
print("Temp email:", email)

# 2) Poll for the verification email
inbox = requests.get(f"{BASE}/messages/{KEY}/{email}").json()
print(inbox)

Node.js (fetch)

const KEY  = "pub_nRn1hUwpdmZvxQNVWDfoXgKyF7dIm9nRIIIt1qDw";
const BASE = "https://mtempmail.com/api";

const { data } = await (await fetch(`${BASE}/emails/${KEY}`, { method: "POST" })).json();
const email = data.email;
const inbox = await (await fetch(`${BASE}/messages/${KEY}/${email}`)).json();
console.log(email, inbox);

PHP

$key  = "pub_nRn1hUwpdmZvxQNVWDfoXgKyF7dIm9nRIIIt1qDw";
$base = "https://mtempmail.com/api";
$ctx  = stream_context_create(["http" => ["method" => "POST"]]);
$res  = json_decode(file_get_contents("$base/emails/$key", false, $ctx), true);
$email = $res["data"]["email"];
$inbox = json_decode(file_get_contents("$base/messages/$key/$email"), true);

What can you build with a disposable email API?

  • Automated QA and CI pipelines — create a fresh inbox per test run to verify sign-up, email confirmation and OTP flows without touching a real mailbox.
  • Bots and AI agents — let an autonomous agent register on a site and read the verification email programmatically, with no human in the loop.
  • Web scraping and automation — get past email-gated content or downloads that require confirming a link.
  • Load and integration testing — generate many disposable addresses on demand to exercise your email flows at scale.
  • Privacy-first tooling — build apps that never expose a user’s real inbox to third-party sign-ups.

Tips and best practices

Email delivery can take a moment, so poll the messages endpoint every few seconds until the expected message arrives instead of requesting it once immediately. Cache the list of available domains rather than fetching it on every call. Always handle HTTP 401 (invalid or missing key) and HTTP 429 (rate limit exceeded) with a short exponential back-off. Because the free public key is shared, keep within roughly 120 requests per minute per IP; if you need dedicated limits, guaranteed throughput, or a key that is not shared for production traffic, use a private API key from your account instead of the public one.


Free temp mail API — frequently asked questions

Is there a free temp mail API?

Yes. MTempMail provides a free temporary email (temp mail) API with a public key, so anyone can create disposable inboxes and read messages programmatically with no sign-up.

How do I get a temporary email address via API?

Send a POST request to https://mtempmail.com/api/emails/pub_nRn1hUwpdmZvxQNVWDfoXgKyF7dIm9nRIIIt1qDw. The JSON response returns a new disposable email address you can use immediately.

Do I need an API key or account to use it?

No account is required. Use the free public key shown above. For higher rate limits, a private key is available in your account.

Can AI agents and bots use this disposable email API?

Yes. The API is plain HTTP and JSON and is designed to be called by scripts, bots and AI agents. It is rate-limited per IP to keep it fair for everyone.

What can I build with a temporary email API?

Automated sign-up and verification testing, QA of OTP flows, bot account creation, scraping that needs email confirmation, and AI agents that must receive an email code.

Is the MTempMail API really free?

Yes, the public temp mail API is free to use within the rate limit, with no credit card required.