How to Add Email Verification to Your Signup Form with a REST API
Stop fake signups at the source. This step-by-step guide shows how to integrate real-time email verification into any web form using the NoMailBounce API.
Fake emails are the most common form of data pollution in web applications. Bots, typos, and users who enter throwaway addresses fill your database with contacts you can never reach. The downstream cost is high — inflated user counts, wasted onboarding emails, and eventually damaged sender reputation when you try to email those addresses.
The fix takes one API call. Verify the email before you create the account.
What Email Verification Checks
A good verification API runs multiple checks in a single request:
- Syntax validation — Is the format correct? (catches "user@gmial" or missing TLD)
- Domain check — Does the domain exist and have valid DNS records?
- MX record lookup — Does the domain accept email?
- SMTP verification — Does the specific mailbox exist on the mail server?
- Disposable detection — Is this a temporary/throwaway email service?
- Role-based detection — Is this a shared inbox like info@ or support@?
All of this happens in 1-3 seconds per email, fast enough for real-time form validation.
Getting Started
First, create a NoMailBounce account and generate an API key from your API Keys dashboard. The free tier includes starter credits so you can test the integration before committing.
API Endpoint
The single email verification endpoint is:
GET https://api.nomailbounce.com/verify?email={email}
Authorization: Bearer YOUR_API_KEYThe response includes a status (valid, invalid, risky, unknown), detailed sub-checks, and a confidence score.
Frontend Integration Example
Here is a practical example of verifying an email when the user finishes typing in a signup form. This uses a simple fetch call from JavaScript:
async function verifyEmail(email) {
const response = await fetch(
\`/api/verify-email?email=\${encodeURIComponent(email)}\`
);
const result = await response.json();
return result;
}
// Usage in form handler
const emailInput = document.getElementById("email");
emailInput.addEventListener("blur", async () => {
const result = await verifyEmail(emailInput.value);
if (result.status === "invalid") {
showError("This email address is not valid.");
} else if (result.status === "risky") {
showWarning("This email may not receive messages.");
}
});Important: Never call the verification API directly from the browser — this exposes your API key. Instead, create a backend proxy endpoint that forwards the request.
Backend Proxy Example (Node.js)
Here is a minimal Express endpoint that proxies the verification request:
const express = require("express");
const app = express();
app.get("/api/verify-email", async (req, res) => {
const { email } = req.query;
if (!email) return res.status(400).json({ error: "Email required" });
const response = await fetch(
\`https://api.nomailbounce.com/verify?email=\${encodeURIComponent(email)}\`,
{
headers: {
Authorization: \`Bearer \${process.env.NOMAILBOUNCE_API_KEY}\`,
},
}
);
const data = await response.json();
res.json(data);
});The API key stays on the server. The frontend only talks to your own backend.
Handling Verification Results
The API returns one of four statuses for each email:
| Status | Meaning | Recommended action |
|---|---|---|
| valid | The email exists and can receive mail | Allow signup |
| invalid | The email does not exist or the domain is dead | Block signup, show error |
| risky | Catch-all domain, disposable, or role-based | Allow with warning, or require confirmation |
| unknown | Could not determine (server timeout, etc.) | Allow signup, verify later in batch |
Most applications should block invalid emails outright, warn on risky, and allow valid and unknown.
Bulk Verification via API
For batch processing — like cleaning an imported list — use the bulk verification endpoint. Upload a list of emails and receive results asynchronously via webhook or polling:
POST https://api.nomailbounce.com/verify/bulk
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"emails": ["[email protected]", "[email protected]", ...],
"webhookUrl": "https://yourapp.com/webhook/verification-complete"
}This is useful when you need to clean thousands of emails that were collected before you added real-time verification.
Rate Limits and Best Practices
- Rate limit: 10 requests per second for single verification. Contact us for higher limits.
- Cache results: Store verification results for 30 days. Email validity does not change minute-to-minute.
- Verify on blur, not on keystroke: Wait until the user finishes typing before calling the API. This reduces unnecessary requests.
- Graceful degradation: If the API is unreachable, allow the signup and verify later. Do not block users due to a temporary API issue.
What This Costs
NoMailBounce uses a pay-as-you-go credit model. Each verification costs one credit. View current pricing — credits start at fractions of a cent per verification with volume discounts up to 60%.
Compare that to the cost of a damaged sender reputation, wasted ESP sends, and bloated databases full of addresses that will never convert.
Get started with a free account and test the API with your first batch of emails.