JUHE API Marketplace
API Service

Temp Mail

Creates temporary, disposable email addresses and allows fetching of received messages for enhanced privacy and testing.

99.9%
Uptime
32ms
Avg Response
10K+
Daily Requests
Temp Mail Response
1{
2 "code": "0",
3 "msg": "success",
4 "data": [
5 {
6 "id": "email_id_1",
7 "from": "sender@example.com",
8 "subject": "Welcome!",
9 "body": "Hello, this is a test email.",
10 "attachments": []
11 }
12 ]
13}
JSON13 lines

API Introduction

About this API

The Temp Mail API is a powerful and reliable tool designed for developers who need a temporary email solution. It allows you to programmatically generate disposable, anonymous email addresses on the fly and to receive and read emails sent to these addresses. In today's privacy- and security-conscious online environment, this API is the ideal choice for protecting users' real email addresses, avoiding spam, completing automated testing, and securing registration processes. With simple API calls, you can seamlessly integrate full temporary mail functionality into your application, providing users with a secure and convenient "digital shield".

Key Features

  • Instant Mailbox Generation: Quickly create a temporary mailbox with a unique address, with the option to use different domains.
  • Email Reception and Reading: Check for and retrieve a list of emails sent to the temporary mailbox in real-time, and read the detailed content of each email, including sender, subject, body, and attachments.
  • Lifecycle Management: Generated mailboxes have a preset lifecycle (e.g., 600 seconds) and are automatically destroyed upon expiration, ensuring privacy. It also supports manually deleting or extending the validity of a mailbox.
  • Security and Privacy Protection: Helps users avoid exposing their real personal email addresses when registering on unknown websites or services, effectively preventing spam, phishing emails, and potential data breaches.
  • RESTful Architecture: Adopts a standard RESTful API design, returning easy-to-parse JSON formatted data, which makes integration on various programming languages and platforms simple and fast.

Use Cases

Scenario 1: Automate Software Testing Processes (QA Automation)

Situation: A quality assurance (QA) team needs to test its application's user registration, email verification, and password reset functions. Implementation: At the beginning of an automated test script (e.g., using Selenium or Playwright), the script first calls the Temp Mail API to create a new temporary email address. The script then uses this temporary email to complete the application's registration process. Next, the script polls the API's email reading endpoint to wait for and retrieve the verification email sent by the application, from which it parses the verification link or code to complete account activation. This process can be repeated hundreds of times to test the system's stability and reliability without polluting any real email inboxes.

Scenario 2: A "Register with Temporary Email" Feature to Protect User Privacy

Situation: A privacy-focused browser plugin or service wants to offer users the option to protect their personal information when registering on third-party websites. Implementation: When a user is on a registration page, the plugin can offer a "Generate Temporary Email" button. When clicked, the plugin calls the Temp Mail API in the background to create a temporary email and automatically fills the address into the webpage's input field. A small window in the plugin's interface displays the emails received by this temporary mailbox in real-time. The user can directly click the verification link in this small window to complete registration, all without leaving the current page and with their real email fully protected.

Scenario 3: Bypass "Email Required to View Content" Restrictions

Situation: Users browsing the web often encounter websites that require an email address to download a report or view hidden content. Implementation: A developer can create a simple web application or browser extension. When a user encounters such a situation, they can visit this application, click a button, and the application will call the Temp Mail API to generate a temporary email address. The user copies this address and pastes it into the target website. Then, the user returns to the application and clicks "Refresh Inbox" to see the email sent by the website containing the download link. This provides users with a quick and convenient way to get the content they want while avoiding subsequent marketing email harassment.

How it Works: Endpoints & Response

This API primarily works through two core endpoints: one for creating mailboxes and another for reading emails.

Create Mailbox Endpoint Example: https://hub.juheapi.com/temp-mail/v1/create A successful request returns a JSON object containing the newly generated email address and an id (or token) for subsequent queries.

Read Mail Endpoint Example: https://hub.juheapi.com/temp-mail/v1/get-emails Using the id obtained in the previous step, calling this endpoint can retrieve a list of all emails received by that mailbox. As the example response shows, it returns an array of email objects, each containing key information like id, from, subject, and body. Developers can easily parse this information and present it to the user.

Quick Actions

Pricing

FREE
Get Started with 10 requests
No Credit Card Required
Free tier:10 requests
Rate limit:10 req/min
Response time:~32ms

API Explorer

Test API calls directly in your browser with our interactive explorer tool.