API Integration Guide

By Sarah Mitchell12 min read

API Overview

The TempMailSpot API allows developers to programmatically create temporary email addresses, check inboxes, and retrieve messages. Perfect for automated testing, CI/CD pipelines, and application integrations.

Base URL

https://tempmailspot.com/api/v1

Authentication

The public API requires no authentication for basic usage. Rate limits apply to prevent abuse.

Core Endpoints

Generate New Email Address

GET /api/v1/generate

Response:
{
  "email": "abc123@tempmailspot.com",
  "token": "session_token_here",
  "expiresAt": "2025-01-15T10:30:00Z"
}

Check Inbox

GET /api/v1/inbox?email={email}&token={token}

Response:
{
  "messages": [
    {
      "id": "msg_123",
      "from": "noreply@example.com",
      "subject": "Verify your email",
      "receivedAt": "2025-01-15T10:25:00Z",
      "hasAttachments": false
    }
  ]
}

Read Message

GET /api/v1/message/{id}?token={token}

Response:
{
  "id": "msg_123",
  "from": "noreply@example.com",
  "subject": "Verify your email",
  "body": "Click here to verify...",
  "html": "<html>...</html>",
  "attachments": []
}

Code Examples

JavaScript/Node.js

const response = await fetch('https://tempmailspot.com/api/v1/generate');
const { email, token } = await response.json();

// Check inbox
const inbox = await fetch(`https://tempmailspot.com/api/v1/inbox?email=${email}&token=${token}`);
const { messages } = await inbox.json();

Python

import requests

# Generate email
resp = requests.get('https://tempmailspot.com/api/v1/generate')
data = resp.json()
email, token = data['email'], data['token']

# Check inbox
inbox = requests.get(f'https://tempmailspot.com/api/v1/inbox?email={email}&token={token}')
messages = inbox.json()['messages']

cURL

# Generate email
curl https://tempmailspot.com/api/v1/generate

# Check inbox
curl "https://tempmailspot.com/api/v1/inbox?email=abc123@tempmailspot.com&token=your_token"

Rate Limits

  • Generate: 10 requests per minute
  • Inbox check: 30 requests per minute
  • Message read: 60 requests per minute

Exceeding limits returns HTTP 429. Implement exponential backoff in production.

Best Practices

  • Cache the session token—don't generate new emails unnecessarily.
  • Poll inbox every 5-10 seconds, not continuously.
  • Handle expiration gracefully—generate a new email when needed.
  • Store tokens securely if persisting across requests.

Recommended Privacy Tools

Tools mentioned in this guide to protect your privacy

Surfshark

VPN
We earn: 40% commission

Enhance your privacy with Surfshark

Learn More
via Impact

ExpressVPN

VPN
We earn: $36.00 commission

Lightning-fast VPN with servers in 94 countries. Best-in-class speeds and rock-solid security.

Learn More
via Impact

NordVPN

VPN
We earn: 40% commission

Military-grade encryption, 5,500+ servers worldwide, and zero-log policy. Perfect for secure browsing and accessing geo-restricted content.

Learn More
via Impact

We earn a commission if you make a purchase, at no additional cost to you. This helps us keep TempMailSpot free forever.