Verify an email address in Java

Checking that an address parses is a regex. Checking that it can actually receive mail requires a DNS lookup, a disposable-provider list and a scoring model. This endpoint does all three in one call.

Java

HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://autorev.rohnelt.dev/v1/email/verify?email=john.doe@gmail.com"))
    .header("Authorization", "Bearer " + apiKey).build();
System.out.println(HttpClient.newHttpClient()
    .send(req, HttpResponse.BodyHandlers.ofString()).body());

Response

{
  "email": "john.doe@gmail.com",
  "status": "deliverable",
  "score": 87,
  "normalized": "johndoe@gmail.com",
  "has_mx": true,
  "is_disposable": false,
  "is_role": false,
  "did_you_mean": null
}

The three checks that matter

  1. MX reachability. A domain with no MX and no A record cannot receive mail at all - that is a hard bounce you can avoid for free.
  2. Disposable detection. Blocks trial abuse at signup.
  3. Typo correction. gmial.con becomes a "did you mean gmail.com?" prompt instead of a lost customer.

Verify at scale, not one at a time

The same checks over a REST API: 250 calls per period free, no credit card, no sales call.

Get an API key Read the docs