The TempMail API allows you to programmatically manage temporary email addresses and incoming emails. All API endpoints follow RESTful principles and respond in JSON format.
http://t-email.org/api/v1
Note: API requests are subject to rate limits (30 requests/minute).
Check the X-RateLimit-Remaining
field in response headers to monitor your remaining requests.
/emails?email={email}&limit={limit}&page={page}
Get all emails for a specific temporary email address.
Parameter | Type | Required | Description |
---|---|---|---|
string | Yes | Temporary email address | |
limit | integer | No | Number of emails per page (default: 20, max: 100) |
page | integer | No | Page number (default: 1) |
{
"success": true,
"data": {
"emails": [
{
"id": 123,
"temp_email_id": 456,
"message_id": "<[email protected]>",
"from": "[email protected]",
"subject": "Test Email Subject",
"is_read": false,
"is_starred": false,
"received_at": "2023-04-28T14:22:33.000000Z"
}
],
"pagination": {
"total": 5,
"per_page": 20,
"current_page": 1,
"last_page": 1
}
}
}
/messages/{id}?email={email}
Get detailed content of a specific email message.
Parameter | Type | Required | Description |
---|---|---|---|
id | integer | Yes | Email message ID |
string | Yes | Temporary email address |
/domains
Get a list of all available domains.
{
"success": true,
"data": [
{
"id": 1,
"name": "tempmail.example.com"
},
{
"id": 2,
"name": "disposable.example.org"
}
]
}
Status Code | Error Type | Description |
---|---|---|
400 | Bad Request | Invalid request parameters |
404 | Not Found | Email or message not found |
429 | Too Many Requests | Request limit exceeded |
500 | Server Error | Server error |
// Example of fetching emails
async function getEmails(tempEmail) {
try {
const response = await fetch(`http://t-email.org/api/v1/emails?email=${tempEmail}&limit=10`);
const data = await response.json();
if (data.success) {
console.log('Emails:', data.data.emails);
} else {
console.error('Error:', data.message);
}
} catch (error) {
console.error('API error:', error);
}
}