Introduction
Developers often need simple, disposable emails for testing or privacy-driven features. A Temp Mail API helps you generate and manage these addresses programmatically.
Why Use a Temp Mail API
- Testing: Receives test emails without cluttering your inbox.
- Privacy: Masks real addresses for user privacy.
- Automation: Scripted workflow for QA and development.
JuheAPI Overview and Credentials
JuheAPI offers a stable temp mail service through simple HTTP requests.
Base URL and Endpoints
- Base URL:
https://hub.juheapi.com/
- Endpoint Examples:
- POST
/temp-mail/v1/create
– Create temp address - POST
/temp-mail/v1/get-emails
– Get emails for a temp address - GET
/temp-mail/v1/list-domains
– List available domains
- POST
API Keys Setup
- Sign up at JuheAPI.
- Obtain your API key from the dashboard.
Prerequisites
- Python 3.7+ or Node.js 14+
- API key from JuheAPI
- Basic HTTP client knowledge
Integration in Python
Install Dependencies
pip install requests
Create Temp Address
import requests
API_KEY = 'your_api_key_here'
BASE_URL = 'https://hub.juheapi.com'
create_url = f'{BASE_URL}/temp-mail/v1/create'
headers = {'Authorization': f'Bearer {API_KEY}'}
response = requests.post(create_url, headers=headers)
print(response.json())
Get Emails
get_emails_url = f'{BASE_URL}/temp-mail/v1/get-emails'
payload = {'address': 'you@tempdomain.com'}
response = requests.post(get_emails_url, headers=headers, json=payload)
print(response.json())
List Domains
list_domains_url = f'{BASE_URL}/temp-mail/v1/list-domains'
response = requests.get(list_domains_url, headers=headers)
print(response.json())
Integration in Node.js
Setup Project
npm init -y
npm install axios
Create Temp Address
const axios = require('axios');
const API_KEY = 'your_api_key_here';
const BASE_URL = 'https://hub.juheapi.com';
(async () => {
const createUrl = `${BASE_URL}/temp-mail/v1/create`;
const res = await axios.post(createUrl, {}, {
headers: { Authorization: `Bearer ${API_KEY}` }
});
console.log(res.data);
})();
Get Emails
(async () => {
const getEmailsUrl = `${BASE_URL}/temp-mail/v1/get-emails`;
const payload = { address: 'you@tempdomain.com' };
const res = await axios.post(getEmailsUrl, payload, {
headers: { Authorization: `Bearer ${API_KEY}` }
});
console.log(res.data);
})();
List Domains
(async () => {
const domainsUrl = `${BASE_URL}/temp-mail/v1/list-domains`;
const res = await axios.get(domainsUrl, {
headers: { Authorization: `Bearer ${API_KEY}` }
});
console.log(res.data);
})();
Error Handling and Best Practices
- Check status codes before parsing responses.
- Retry logic for network errors.
- Validate input to avoid malformed requests.
Security Considerations
- Never hardcode keys in public repos.
- Use environment variables for secret storage.
- Limit API key permissions if supported.
Practical Use Cases
- App sign-up flows for test users.
- QA pipelines that require email verification.
- Disposable contact forms for support trials.
Conclusion
Integrating JuheAPI's Temp Mail API in Python and Node.js gives you a fast way to interact with disposable email addresses for workflows and testing.