API Documentation
Back to App

Worker API Reference

Automate your workflow with our simple JSON API. Integrate standard temporary email capabilities directly into your bots, scripts, or applications.

Base URL:https://temp-email-worker.manulsinul99.workers.dev

List DomainsGET

Retrieve a list of all active domains available for creating email aliases.

GET/api/domains
Response Example
{
  "domains": [
    "example.com",
    "domainanda.my.id"
  ]
}

Generate AddressPOST

Create a new temporary email address. You can optionally specify a custom prefix and domain.

POST/api/generate
Request Body (JSON)
{
  "prefix": "custom_name",  // Optional
  "domain": "example.com"   // Optional
}
Response
{
  "prefix": "custom_name",
  "domain": "example.com",
  "address": "[email protected]"
}

Check InboxGET

Fetch emails for a specific address. Supports text search filtering which is ideal for OTP extraction.

GET/api/inbox/:address
addressURL ParamFull email address
limitQueryMax messages (default 20)
searchQueryFilter by subject/body
Example: Search for OTP
GET /api/inbox/[email protected]?search=Facebook
Response
{
  "emails": [
    {
      "id": 12,
      "sender": "[email protected]",
      "subject": "123456 is your confirmation code",
      "body_text": "Here is your code: 123456 ...",
      "received_at": "2024-03-20T10:00:00Z"
    }
  ]
}

Get MessageGET

Retrieve the full content (HTML/Text) of a specific email message by its ID.

GET/api/message/:id
idURL ParamMessage ID (integer)
Response
{
  "id": 12,
  "address": "[email protected]",
  "sender": "[email protected]",
  "subject": "Hello World",
  "body_text": "Plain text content...",
  "body_html": "<div>HTML content...</div>",
  "received_at": "2024-03-20T10:00:00Z"
}

Global StatsGET

Get the total count of generated temporary email addresses across the platform.

GET/api/stats
Response
{
  "total_emails": 15420
}

Python Automation Example

import requests
import time

BASE_URL = "https://temp-email-worker.manulsinul99.workers.dev"

# 1. Generate Email
res = requests.post(f"{BASE_URL}/api/generate", json={})
address = res.json()['address']
print(f"Listening on: {address}")

# 2. Poll for specific OTP
print("Waiting for Facebook OTP...")
while True:
    res = requests.get(f"{BASE_URL}/api/inbox/{address}", params={"search": "Facebook"})
    emails = res.json()['emails']
    
    if emails:
        print(f"OTP Found: {emails[0]['body_text']}")
        break
    
    time.sleep(3)