Introducing our Snowflake Data Cloud Native Application: AI-Driven Data Quality built into SQL statements! Learn More

Email Validation API Code Examples



API: Email Validation

Register for API Key

Python

This example demonstrates how to make an HTTP GET request using Python's built-in modules.


import urllib.request
import json

api_key = 'your-api-key-here'
email = 'joesmith@amazon.com'

url = f'https://api.interzoid.com/getemailinfo?license={api_key}&email={email}'

with urllib.request.urlopen(url) as response:
    data = json.loads(response.read().decode())
    print(data)
        

Node.js

This example shows how to perform an HTTP GET request using Node.js without external libraries.


const https = require('https');

const apiKey = 'your-api-key-here';
const email = 'joesmith@amazon.com';

const url = `https://api.interzoid.com/getemailinfo?license=${apiKey}&email=${email}`;

https.get(url, (resp) => {
  let data = '';

  resp.on('data', (chunk) => {
    data += chunk;
  });

  resp.on('end', () => {
    const jsonData = JSON.parse(data);
    console.log(jsonData);
  });

}).on("error", (err) => {
  console.log("Error: " + err.message);
});
        

Go

This example uses Go's net/http package to make an HTTP GET request.


package main

import (
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    apiKey := "your-api-key-here"
    email := "joesmith@amazon.com"

    url := fmt.Sprintf("https://api.interzoid.com/getemailinfo?license=%s&email=%s", apiKey, email)

    resp, err := http.Get(url)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, _ := ioutil.ReadAll(resp.Body)

    var result map[string]interface{}
    json.Unmarshal(body, &result)

    fmt.Println(result)
}
        

Java

This example demonstrates how to make an HTTP GET request using Java's HttpURLConnection.


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import org.json.JSONObject;

public class ApiExample {
    public static void main(String[] args) throws Exception {
        String apiKey = "your-api-key-here";
        String email = "joesmith@amazon.com";

        String url = "https://api.interzoid.com/getemailinfo?license=" + apiKey + "&email=" + email;

        URL obj = new URL(url);
        HttpURLConnection con = (HttpURLConnection) obj.openConnection();

        con.setRequestMethod("GET");

        BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
        String inputLine;
        StringBuffer response = new StringBuffer();

        while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
        in.close();

        JSONObject jsonObj = new JSONObject(response.toString());
        System.out.println(jsonObj.toString(4));
    }
}
        

TypeScript

This example uses TypeScript with Node's https module to make an HTTP GET request.


import * as https from 'https';

const apiKey = 'your-api-key-here';
const email = 'joesmith@amazon.com';

const url = `https://api.interzoid.com/getemailinfo?license=${apiKey}&email=${email}`;

https.get(url, (resp) => {
  let data = '';

  resp.on('data', (chunk: string) => {
    data += chunk;
  });

  resp.on('end', () => {
    const jsonData = JSON.parse(data);
    console.log(jsonData);
  });

}).on("error", (err: Error) => {
  console.log("Error: " + err.message);
});
        

Rust

This example uses Rust's standard library to make an HTTP GET request.


use reqwest;
use serde_json::Value;

#[tokio::main]
async fn main() -> Result<(), Box> {
    let api_key = "your-api-key-here";
    let email = "joesmith@amazon.com";

    let url = format!("https://api.interzoid.com/getemailinfo?license={}&email={}", api_key, email);

    let resp = reqwest::get(&url).await?.text().await?;
    let json: Value = serde_json::from_str(&resp)?;
    println!("{}", json);
    Ok(())
}
        

C#

This example uses C#'s HttpClient class to make an HTTP GET request.


using System;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;

namespace ApiExample
{
    class Program
    {
        static async Task Main(string[] args)
        {
            string apiKey = "your-api-key-here";
            string email = "joesmith@amazon.com";

            string url = $"https://api.interzoid.com/getemailinfo?license={apiKey}&email={email}";

            HttpClient client = new HttpClient();
            var response = await client.GetStringAsync(url);

            var json = JObject.Parse(response);
            Console.WriteLine(json.ToString());
        }
    }
}
        

R

This example uses R's built-in functions to make an HTTP GET request.


api_key <- 'your-api-key-here'
email <- 'joesmith@amazon.com'

url <- paste0('https://api.interzoid.com/getemailinfo?license=', api_key, '&email=', email)

response <- readLines(url, warn = FALSE)
data <- jsonlite::fromJSON(response)
print(data)
        

Scala

This example uses Scala's standard library to make an HTTP GET request.


import scala.io.Source
import play.api.libs.json._

object ApiExample {
  def main(args: Array[String]): Unit = {
    val apiKey = "your-api-key-here"
    val email = "joesmith@amazon.com"

    val url = s"https://api.interzoid.com/getemailinfo?license=$apiKey&email=$email"

    val response = Source.fromURL(url).mkString
    val json = Json.parse(response)
    println(Json.prettyPrint(json))
  }
}