API Access to Temporary Emails

Powerful REST API for temporary emails. For testing, integrations, security, and more.
$ 
{
  "email": "test@domain.com",
  "ttl": 86400
}{
  "messages": [
    {
      "id": "xxxxx",
      "from": "\"Facebook\" <registration@facebookmail.com>",
      "to": "test@domain.com",
      "cc": [],
      "subject": "FB-00000 is your confirmation code",
      "body_text": "Don't share this code with anyone. Hi Mike,\n\nOne more step to sign up...",
      "body_html": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional...",
      "created_at": "2025-10-23T09:32:44.734595Z",
      "attachments": null
    }
  ]
}{
  "id": "xxxxx",
  "from": "\"Facebook\" <registration@facebookmail.com>",
  "to": "test@domain.com",
  "cc": null,
  "subject": "FB-00000 is your confirmation code",
  "body_text": "Don't share this code with anyone. Hi Mike,\n\nOne more step to sign up...",
  "body_html": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional...",
  "created_at": "2025-10-23T09:32:44.734595Z",
  "attachments": []
}{}
No messages

Designed and optimized for your workflow

We've built the Temp Mail API to fit right into your workflow. Here are some popular use cases:

  • Automate Email Testing

    Generate unique test emails, extract OTP codes, and verify workflows without manual tasks or inbox clutter.

    E2E, OTP, user forms, multi-role testing.

    PlaywrightCypressSelenium
  • CI/CD Integration

    Integrate email verification into GitHub Actions, Jenkins, and GitLab CI for continuous, hands-off pipelines.

    80%+ of organizations worldwide use CI/CD.

    GitHubGitLabJenkins
  • GDPR-Compliant Environments

    Use temporary emails in dev/staging to prevent costly fines and automate compliance with global data protection standards.

    GDPR fines have exceeded €5.8B since 2018.

    GDPR
  • Web Scraping & Data Extraction

    Save hours collecting market, pricing, and competitor insights with seamless integration of popular web scraper and data parsing tools.

    Market research, lead generation, catalogs.

    PuppeteerOctoparseScrapy

Simple integration

Our API is a modern JSON API that surfaces all of the info you'll need to build any experience. For seamless integration, we offer official libraries for Python, PHP, Go, and other languages.

Official libraries
PythonPHPGoNet
domains = client.list_domains()
for domain in domains:
    print(f"Domain: {domain.name}")
    print(f"Type: {domain.type.value}")
email = client.create_email()
print(f"Email: {email.email}")
messages = client.list_email_messages("test@example.com")
for message in messages:
    print(f"From: {message.from_addr}")
    print(f"Subject: {message.subject}")
    print(f"CC: {message.cc}")
    print(f"Attachments: {len(message.attachments or [])}")

$client = \TempMailIo\TempMailPhp\Factory::createDomainClient(
  'YOUR_API_KEY'
);
$response = $client->getAvailableDomains();

foreach ($response->successResponse->domains as $domain) {
  // Iterate over domains
}
$client = \TempMailIo\TempMailPhp\Factory::createEmailClient(
  'YOUR_API_KEY'
);
$response = $client->create();

echo "Email: " . $response->successResponse->email . PHP_EOL;
$client = \TempMailIo\TempMailPhp\Factory::createEmailClient(
  'YOUR_API_KEY'
);
$response = $emailClient->getMessages('test@example.com');

foreach ($response->successResponse->messages as $message) {
  // Iterate over messages
}

domains := client.ListDomains(context.Background())
for _, d := range domains.Domains {
  fmt.Printf("Domain: %s, Type: %s\n", d.Name, d.Type)
}
email := client.CreateEmail(
  context.Background(),
  tempmail.CreateEmailOptions{
    Domain: "example.com"
  }
)

fmt.Printf(
  "Created temporary email: %s (TTL: %s)\n",
  email.Email,
  email.TTL
)
messages := client.ListEmailMessages(
  context.Background(),
  "your_email@example.com"
)

fmt.Printf("Fetched %d messages.\n", len(messages))



{
  "domains": [
    {
      "name": "public1.com",
      "type": "public"
    },
    {
      "name": "public2.com",
      "type": "public"
    },
    {
      "name": "premium1.com",
      "type": "premium"
    }
  ]
}
{
  "email": "example@domain.com",
  "ttl": 86400
}
{
  "messages": [
    {
      "id": "xxxxx",
      "from": "\"Facebook\" <registration@facebookmail.com>",
      "to": "example@domain.com",
      "cc": [],
      "subject": "FB-00000 is your confirmation code",
      "body_text": "Don't share this code with anyone. Hi Mike,\n\nOne more step to sign up...",
      "body_html": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional...",
      "created_at": "2025-10-23T09:32:44.734595Z",
      "attachments": null
    }
  ]
}

Choose the right plan for you

Frequently asked questions

Couldn't find something? Learn more in our help center.

Get started with our API

Boost your productivity and save hours of manual work using powerful API for temporary email generation.
Loved by 3,500+ subscribers
  • Cancel anytime
  • 30-day money-back guarantee