REST API

Build anything with our API.

A clean, versioned REST API to generate inboxes, retrieve messages, and integrate TempMail into your own applications.

Fast & Reliable

Sub-100ms response times globally. 99.9% uptime SLA with automatic failover.

Secure by Default

All requests require an API key over HTTPS. TLS 1.3 enforced. Keys rotatable instantly.

Fully Documented

Every endpoint has parameters, types, examples, and error codes. See the API Reference.

Webhook Support

Push message events to your server instead of polling — Premium feature.

Rate Limits

10 req/min on Free. 120 req/min and 50k/day on Premium. Limits in response headers.

Official SDKs

JavaScript, Python, and PHP SDKs. Community SDKs for Go, Ruby, and Rust.

Generate & read in 10 lines.
JavaScript
// 1. Generate address
const { email } = await fetch(
  'https://api.tempmail.io/v1/generate_email.php?key=YOUR_KEY'
).then(r => r.json());

// 2. Poll inbox every 5s
const msgs = await fetch(
  `https://api.tempmail.io/v1/inbox.php?key=YOUR_KEY&email=${email}`
).then(r => r.json());

// 3. Read message & extract OTP
const msg = await fetch(
  `https://api.tempmail.io/v1/read.php?key=YOUR_KEY&email=${email}&id=${msgs[0].id}`
).then(r => r.json());

console.log('OTP:', msg.otp); // "482910"
All routes
GET/generate_email.phpNew address
GET/inbox.phpList messages
GET/read.phpRead message
GET/receive_emails.phpTrigger fetch
DEL/delete.phpDelete address
POST/webhook.phpRegister webhook
POST/domains.phpAdd domain
Base: https://api.tempmail.io/v1
Full API Reference

Ready to integrate?

Get your API key on a Premium plan and start building in minutes.

Get API access