> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vishodi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Complete User Verification

> Code Snippets

<img style={{ borderRadius: '5px' }} src="https://mintcdn.com/vishodi/CAP6wS9LMf91VZ0u/images/user%20verification.jpg?fit=max&auto=format&n=CAP6wS9LMf91VZ0u&q=85&s=e009b3022d39bd1819265867da47d7df" alt="Hero Light" width="1536" height="1024" data-path="images/user verification.jpg" />

### Introduction

This API is designed to help you protect your site’s signup, contact forms, or any other forms from fake names and disposable emails. By validating user details, you can ensure the authenticity of the data being submitted and improve the quality of your user interactions.

**Request Limits:**

* **Free Plan**: 25 requests/month
* **Basic Plan**: 30,000 requests/month
* **Pro Plan**: 65,000 requests/month

<Card title="Access Your Dashboard" href="https://dashboard.vishodi.com/api">
  Replace `<api-key>` with your API key from the dashboard.
</Card>

***

### **First Name + Last Name + Disposable Email Verification**:<br />

Response when all data is provided.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.vishodi.com/api/v1" \
    -H "X-API-Token: <api-key>" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "user_verification",
      "email": "email@disposable.com",
      "firstname": "Donald",
      "lastname": "Trump"
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.vishodi.com/api/v1"
  payload = {
      "model": "user_verification",
      "email": "email@disposable.com",
      "firstname": "Donald",
      "lastname": "Trump"
  }
  headers = {
      "X-API-Token": "<api-key>",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)
  print(response.text)
  ```

  ```javascript JavaScript theme={null}
  fetch("https://api.vishodi.com/api/v1", {
    method: "POST",
    headers: {
      "X-API-Token": "<api-key>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      model: "user_verification",
      email: "email@disposable.com",
      firstname: "Donald",
      lastname: "Trump"
    })
  })
    .then(response => response.text())
    .then(data => console.log(data))
    .catch(error => console.error("Error:", error));
  ```

  ```php PHP theme={null}
  <?php
  $url = "https://api.vishodi.com/api/v1";

  $data = [
      "model" => "user_verification",
      "email" => "email@disposable.com",
      "firstname" => "Donald",
      "lastname" => "Trump"
  ];

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "X-API-Token: <api-key>",
      "Content-Type: application/json"
  ]);

  $response = curl_exec($ch);
  curl_close($ch);
  echo $response;
  ?>
  ```

  ```go GO theme={null}
  package main

  import (
      "bytes"
      "fmt"
      "io"
      "net/http"
  )

  func main() {
      payload := []byte(`{
          "model": "user_verification",
          "email": "email@disposable.com",
          "firstname": "Donald",
          "lastname": "Trump"
      }`)

      req, _ := http.NewRequest("POST", "https://api.vishodi.com/api/v1", bytes.NewBuffer(payload))
      req.Header.Set("X-API-Token", "<api-key>")
      req.Header.Set("Content-Type", "application/json")

      resp, _ := http.DefaultClient.Do(req)
      defer resp.Body.Close()

      body, _ := io.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```

  ```java JAVA theme={null}
  import java.net.*;
  import java.io.*;

  public class Main {
      public static void main(String[] args) throws Exception {
          URL url = new URL("https://api.vishodi.com/api/v1");
          HttpURLConnection conn = (HttpURLConnection) url.openConnection();
          conn.setRequestMethod("POST");
          conn.setRequestProperty("X-API-Token", "<api-key>");
          conn.setRequestProperty("Content-Type", "application/json");
          conn.setDoOutput(true);

          String payload = "{\"model\": \"user_verification\", "
              + "\"email\": \"email@disposable.com\", "
              + "\"firstname\": \"Donald\", "
              + "\"lastname\": \"Trump\"}";

          try(OutputStream os = conn.getOutputStream()) {
              os.write(payload.getBytes());
              os.flush();
          }

          try(BufferedReader br = new BufferedReader(
              new InputStreamReader(conn.getInputStream()))) {
              String line;
              while ((line = br.readLine()) != null) {
                  System.out.println(line);
              }
          }
          conn.disconnect();
      }
  }
  ```
</CodeGroup>

```bash Response (200) theme={null}
{
  "status": "success",
  "received_data": {
    "model": "user_verification",
    "email": "test@example.com",
    "firstname": "Donald",
    "lastname": "Trump"
  },
  "request_count": 3,
  "email_verification": {
    "emailAddress": "test@example.com",
    "disposable": false,
    "username": "test",
    "domain": "example.com",
    "dnsCheck": "Pass",
    "syntexCheck": "Pass"
  },
  "name_verification": {
    "firstname": {
      "value": "Donald",
      "prediction": "LABEL_1",
      "confidence": 0.9993
    },
    "lastname": {
      "value": "Trump",
      "prediction": "LABEL_1",
      "confidence": 0.9998
    }
  }
}
```

**Model:** `user_verification`

* **"disposable": false** Indicates a valid Email
* **"disposable": true** Indicates a disposable/temporary Email
* **LABEL\_1**: Indicates a valid name
* **LABEL\_0**: Indicates an invalid name

**Request Count Explanation:**\
`request_count` represents the number of fields included in a request, and these many requests will be deducted from your plan. For example:

* First name + Last name + Disposable email = 3
* First name + Last name = 2

***

### **Partial Data - Email and FirstName Only**:<br />

Simply remove the attributes you don't want in the response. For example, include only firstname and email.

```bash cURL theme={null}
curl -X POST "https://api.vishodi.com/api/v1" \
  -H "X-API-Token: <api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "user_verification",
    "email": "email@disposable.com",
    "firstname": "Donald"
  }'
```

```bash Response (200) theme={null}
{
  "status": "success",
  "received_data": {
    "model": "user_verification",
    "email": "test@example.com",
    "firstname": "John",
    "lastname": null
  },
  "request_count": 2,
  "email_verification": {
    "emailAddress": "test@example.com",
    "disposable": false,
    "username": "test",
    "domain": "example.com",
    "dnsCheck": "Pass",
    "syntexCheck": "Pass"
  },
  "name_verification": {
    "firstname": {
      "value": "John",
      "prediction": "LABEL_1",
      "confidence": 0.9993
    }
  }
}
```

***

### **Empty string provided**:<br />

Response when an empty string is provided.

```bash cURL theme={null}
curl -X POST "https://api.vishodi.com/api/v1" \
  -H "X-API-Token: <api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "user_verification",
    "email": "email@disposable.com",
    "firstname": "Donald",
    "lastname": ""
  }'
```

```bash Response (200) theme={null}
{
  "status": "success",
  "received_data": {
    "model": "user_verification",
    "email": "10min@disposable.site",
    "firstname": "Donald",
    "lastname": ""
  },
  "request_count": 2,
  "email_verification": {
    "emailAddress": "10min@disposable.site",
    "disposable": true,
    "username": "10min",
    "domain": "disposable.site",
    "dnsCheck": "Pass",
    "syntexCheck": "Pass"
  },
  "name_verification": {
    "firstname": {
      "value": "Donald",
      "prediction": "LABEL_1",
      "confidence": 0.9993
    }
  }
}
```

***

### **Permutations of Requests:**

You can make requests using the following combinations:

1. All three fields: Email, First name, Last name
2. Email and First name only
3. Email and Last name only
4. First name and Last name only
5. Email only
6. First name only
7. Last name only

<Card title="API Playground" href="/user-verification-api/endpoint/create" icon="key">
  Explore the API Playground to test and interact with the endpoints.
</Card>
