Back to Home Tiếng Việt

OTP Mail .online

Secure virtual email for OTP verification

API Documentation

Integrate OTPMail into your application

Base URL

https://api.otpmail.online
GET /api/{email}

Get the latest email for a specific email address.

Parameters

email string required

Full email address (e.g., test@otpmail.online)

Query Parameters

html boolean optional

Add ?html=true to get the original HTML content of the email.

Example

curl https://api.otpmail.online/api/test@otpmail.online

Response

{
  "success": true,
  "mail": {
    "sender": "noreply@example.com",
    "subject": "Your verification code",
    "content": "Your OTP code is 123456",
    "time": "02:30:00"
  },
  "otp": "123456"
}

When the inbox is empty or expired, the API can return HTTP 200 with success: false.

{
  "success": false,
  "error": "Waiting for email..."
}
GET /api/domains

Get a list of all active domains on the system.

Example

curl https://api.otpmail.online/api/domains

Response

{
  "success": true,
  "domains": [
    "otpmail.online",
    "cubongman.online",
    "bongman.shop"
  ]
}

Public vs Private Domains

Public Domain

Listed on the website and /api/domains. Anyone can read emails via the API without authentication.

Private Domain

Not listed publicly. Requires an API Key to access emails. When you add a domain and choose "Private API Key", you receive a unique key tied to that domain.

Using your API Key

For private domains, pass your key via query parameter or header:

# Query parameter
curl "https://api.otpmail.online/api/test@yourdomain.com?api_key=sk_live_abc123..."

# Or HTTP header (Recommended)
curl -H "x-api-key: sk_live_abc123..." https://api.otpmail.online/api/test@yourdomain.com

Rate Limiting

  • Emails are auto-deleted after 10 minutes
  • Use a 10-second polling interval per inbox. Excessive automated reads may be rate-limited.

Status Codes

Code Meaning
200 Success; an empty inbox may return success=false in a 200 response
404 Endpoint not found or unsupported route
429 Rate limit exceeded
500 Server error
429 Rate limit exceeded 500 Server error

Code Examples

Python

import requests

# Get email from Public Domain
res = requests.get("https://api.otpmail.online/api/test@otpmail.online")

# Get email from Private Domain (requires API Key)
headers = {"x-api-key": "sk_live_abc123..."}
res = requests.get("https://api.otpmail.online/api/test@yourdomain.com", headers=headers)

data = res.json()
if data["success"]:
    print(f"OTP: {data['otp']}")
    print(f"From: {data['mail']['sender']}")
else:
    print("No email yet")

JavaScript

// Get email from Public Domain
let res = await fetch("https://api.otpmail.online/api/test@otpmail.online");

// Get email from Private Domain (requires API Key)
res = await fetch("https://api.otpmail.online/api/test@yourdomain.com", {
    headers: { "x-api-key": "sk_live_abc123..." }
});

const data = await res.json();
if (data.success) {
    console.log(`OTP: ${data.otp}`);
    console.log(`From: ${data.mail.sender}`);
}

cURL

# Get email from Public Domain
curl -s https://api.otpmail.online/api/test@otpmail.online | jq .

# Get email from Private Domain
curl -H "x-api-key: sk_live_abc123..." https://api.otpmail.online/api/test@yourdomain.com | jq .
© 2026 OTPMail.online • Instant verification solution
Receive OTP Temp Mail Temp Mail API 10 Minute Mail Testing Email Blog About Contact Privacy Terms FAQ API