> ## 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.

# Last Name Verification

> Validate and detect last names

### Introduction

This API helps you validate last names to ensure they are real and not fake. By validating last names, you can improve the quality of user data and prevent spam or bot submissions.

**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>

***

### **Last Name Verification**:<br />

Response when verifying a last name.

<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",
      "lastname": "Trump"
    }'
  ```

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

  url = "https://api.vishodi.com/api/v1"
  payload = {
      "model": "user_verification",
      "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",
      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",
      "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",
          "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\", "
              + "\"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": null,
    "firstname": null,
    "lastname": "musk"
  },
  "request_count": 1,
  "name_verification": {
    "lastname": {
      "value": "musk",
      "prediction": "LABEL_1",
      "confidence": 0.9997
    }
  }
}
```

**Model:** `user_verification`

* **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

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