API Integration Guide

By TempMailSpot Editorial Team12 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

NordVPN

VPN

Encrypted tunneling across thousands of servers with an audited no-logs policy. For private browsing on untrusted networks.

Learn More

ExpressVPN

VPN

Consistently fast servers in 90 plus countries, an audited no-logs policy, and a clean app on every platform.

Learn More

Surfshark

VPN

Unlimited devices on one plan, with ad and tracker blocking built in. The budget pick that does not feel budget.

Learn More