Quickstart: your first verification in five minutes
Get an API key, send one request with an email address, read the status and send_advice in the reply. The same five steps work in every language; the code for Node.js, Python, PHP, Go and Ruby is below. Prefer raw HTTP? See the API reference.
The five steps
- Get a key. Create one on the API keys page. It starts with sv_live_ and is shown once. Put it in an environment variable called SIMPLEVERIFIER_KEY and keep it on your server.
- Add the client. Use the draft files for your language (below), or call the endpoint over plain HTTP.
- Make the call. Pass one address. A slow mail server can make a call take up to about 30 seconds, so set a timeout of 30 seconds and do not block a sign-up form on it forever.
- Read the verdict. Only valid means the mail server confirmed the mailbox. risky means delivery is unconfirmed (catch-all domain, role address, Outlook or iCloud, a server that would not answer). invalid will bounce. Read send_advice for the action.
- Handle errors. 402 means your plan has no API access or the yearly quota is used. 429 means more than 120 calls a minute: wait Retry-After. The clients retry 429 and 503 for you.
Node.js
Needs Node 18 or later.
1. Add the client
Coming soon to npm. Until it is published: Unzip the draft into your project, run npm install and npm run build inside it, then import from that folder. Or paste the single-file client from the SDKs page. Download the Node.js draft (zip, MIT).
Source (MIT): github.com/Ahmedmkarrar/simpleverifier-node
2. Verify an address
import { SimpleVerifier } from "simpleverifier";
const sv = new SimpleVerifier(); // reads SIMPLEVERIFIER_KEY
const result = await sv.verifyEmail("jane@company.com");
console.log(result.status, result.send_advice); // "valid" "safe"
if (result.status === "invalid") {
// ask the visitor for another address
}3. Handle 402 and 429
import { SimpleVerifier, PaymentRequiredError, RateLimitError } from "simpleverifier";
try {
await sv.verifyEmail(email);
} catch (error) {
if (error instanceof PaymentRequiredError) {
// plan has no API access, or the yearly quota is used
} else if (error instanceof RateLimitError) {
// already retried twice; error.retryAfter is the wait in seconds
} else {
throw error;
}
}No package? The Node.js HTTP guide uses only the standard library.
Python
Needs Python 3.9 or later.
1. Add the client
Coming soon to PyPI. Until it is published: Unzip the draft, then pip install ./python (the folder with pyproject.toml). Or paste the standard-library client from the SDKs page. Download the Python draft (zip, MIT).
Source (MIT): github.com/Ahmedmkarrar/simpleverifier-python
2. Verify an address
from simpleverifier import SimpleVerifier
sv = SimpleVerifier() # reads SIMPLEVERIFIER_KEY
result = sv.verify_email("jane@company.com")
print(result["status"], result.get("send_advice")) # valid safe
if result["status"] == "invalid":
... # ask the visitor for another address3. Handle 402 and 429
from simpleverifier import PaymentRequiredError, RateLimitError
try:
sv.verify_email(email)
except PaymentRequiredError:
... # plan has no API access, or the yearly quota is used
except RateLimitError as error:
... # already retried twice; error.retry_after is the wait in secondsNo package? The Python HTTP guide uses only the standard library.
PHP
Needs PHP 8.1 or later with ext-curl.
1. Add the client
Coming soon to Packagist. Until it is published: Unzip the draft, copy the two files in src/ into your project and require both. Download the PHP draft (zip, MIT).
Source (MIT): github.com/Ahmedmkarrar/simpleverifier-php
2. Verify an address
<?php
require "src/Exceptions.php";
require "src/Client.php";
$sv = new SimpleVerifier\Client(); // reads SIMPLEVERIFIER_KEY
$result = $sv->verifyEmail("jane@company.com");
echo $result["status"], " ", $result["send_advice"] ?? "";
if ($result["status"] === "invalid") {
// ask the visitor for another address
}3. Handle 402 and 429
try {
$sv->verifyEmail($email);
} catch (SimpleVerifier\PaymentRequiredException $e) {
// plan has no API access, or the yearly quota is used
// $e->retryAfter is the seconds until the quota resets when present
} catch (SimpleVerifier\RateLimitException $e) {
// already retried twice
}No package? The PHP HTTP guide uses only the standard library.
Go
Needs Go 1.21 or later, standard library only.
1. Add the client
go get github.com/Ahmedmkarrar/simpleverifier-go@latestSource (MIT): github.com/Ahmedmkarrar/simpleverifier-go
2. Verify an address
package main
import (
"context"
"fmt"
simpleverifier "github.com/Ahmedmkarrar/simpleverifier-go"
)
func main() {
c, err := simpleverifier.New("") // reads SIMPLEVERIFIER_KEY
if err != nil {
panic(err)
}
res, err := c.Verify(context.Background(), "jane@company.com")
if err != nil {
panic(err)
}
fmt.Println(res.Status, res.SendAdvice)
}3. Handle 402 and 429
_, err := c.Verify(ctx, email)
var apiErr *simpleverifier.APIError
switch {
case errors.Is(err, simpleverifier.ErrPaymentRequired):
// plan has no API access, or the yearly quota is used
case errors.Is(err, simpleverifier.ErrRateLimited):
// already retried twice
case errors.As(err, &apiErr):
fmt.Println(apiErr.Status, apiErr.Message, apiErr.RetryAfter)
}No package? The Go HTTP guide uses only the standard library.
Ruby
Needs Ruby 2.6 or later, standard library only.
1. Add the client
Coming soon to RubyGems. Until it is published: Unzip the draft, copy lib/ into your project and require "simpleverifier". Download the Ruby draft (zip, MIT).
Source (MIT): github.com/Ahmedmkarrar/simpleverifier-ruby
2. Verify an address
require "simpleverifier"
sv = SimpleVerifier::Client.new # reads SIMPLEVERIFIER_KEY
result = sv.verify_email("jane@company.com")
puts "#{result["status"]} #{result["send_advice"]}"
if result["status"] == "invalid"
# ask the visitor for another address
end3. Handle 402 and 429
begin
sv.verify_email(email)
rescue SimpleVerifier::PaymentRequiredError => e
# plan has no API access, or the yearly quota is used; e.retry_after may be set
rescue SimpleVerifier::RateLimitError
# already retried twice
endNo package? The Ruby HTTP guide uses only the standard library.
Test it first
Import the Postman collection or the Insomnia export, set apiKey, and send a request. The OpenAPI file describes every field. GET /api/v1/me checks a key without spending a verification.
Common questions
- How do I verify an email address with the SimpleVerifier API?
- Create an API key, then send GET or POST https://simpleverifier.com/api/v1/verify with the address as email and the key as a Bearer token. The reply has a status of valid, risky or invalid, a reason and a send_advice of safe, care, retry or do_not_send.
- Which plans include the API?
- Pro, Business and Agency. Starter and Growth cover CSV verification in the dashboard and get a 402 from the API.
- Is there an official package for my language?
- Drafts for Node.js, Python, PHP, Go and Ruby exist and are free to copy (MIT). None is on a package registry yet, so these quickstarts show how to use the draft files today. The API itself is live, and plain HTTP works from any language.