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

# Email Validation

> Validate email addresses and detect disposable, temporary, or fraudulent email providers in real time.

## Endpoint

```
GET /email/{email}
```

Validates an email address and returns comprehensive information including disposability status, MX records, domain reputation, and more.

***

## Parameters

<ParamField path="email" type="string" required>
  The email address to validate (e.g., `[email protected]`)
</ParamField>

***

## Request Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.fraudiant.com/email/[email protected]" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.fraudiant.com/email/[email protected]', {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  });

  const data = await response.json();
  console.log(data);
  ```

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

  headers = {'Authorization': 'Bearer YOUR_API_KEY'}
  response = requests.get(
      'https://api.fraudiant.com/email/[email protected]',
      headers=headers
  )

  data = response.json()
  print(data)
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, 'https://api.fraudiant.com/email/[email protected]');
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      'Authorization: Bearer YOUR_API_KEY'
  ]);

  $response = curl_exec($ch);
  $data = json_decode($response, true);
  curl_close($ch);
  ?>
  ```
</CodeGroup>

***

## Response Fields

<ResponseField name="status" type="integer">
  HTTP status code indicating the result of the request

  * `200`: Success
  * `400`: Invalid input
  * `429`: Rate limit exceeded
</ResponseField>

<ResponseField name="email" type="string">
  The email address that was checked. This is the normalized form of the input email.
</ResponseField>

<ResponseField name="normalized_email" type="string">
  The standardized, canonical form of the email address
</ResponseField>

<ResponseField name="domain" type="string">
  The domain portion extracted from the email address
</ResponseField>

<ResponseField name="domain_age_in_days" type="integer | null">
  The number of days since the domain was registered. Returns `null` if the age is unknown.
</ResponseField>

<ResponseField name="mx" type="boolean">
  Indicates whether the domain has valid MX (Mail Exchange) records configured
</ResponseField>

<ResponseField name="mx_records" type="array">
  List of MX records for the domain. Empty array if `mx` is `false`.
</ResponseField>

<ResponseField name="disposable" type="boolean">
  **Key Field**: Indicates whether the email uses a temporary or disposable email domain
</ResponseField>

<ResponseField name="disposable_provider" type="string | null">
  The provider domain name if the email is disposable, otherwise `null`
</ResponseField>

<ResponseField name="public_domain" type="boolean">
  Indicates whether the email uses a public email service like Gmail, Yahoo Mail, or Outlook
</ResponseField>

<ResponseField name="relay_domain" type="boolean">
  Indicates whether the email uses a domain that provides email forwarding services
</ResponseField>

<ResponseField name="alias" type="boolean">
  **Deprecated**: Use `normalized_email` field instead for alias detection
</ResponseField>

<ResponseField name="role_account" type="boolean">
  Indicates whether the email is a role-based account (e.g., `support@`, `admin@`, `info@`) rather than a personal account
</ResponseField>

<ResponseField name="did_you_mean" type="string | null">
  Suggested correction if there's a likely typo in the email address (e.g., `gmial.com` → `gmail.com`)
</ResponseField>

<ResponseField name="blocklisted" type="boolean">
  Indicates whether the email's domain is on your account's custom blocklist (Pro feature)
</ResponseField>

<ResponseField name="spam" type="boolean">
  Indicates whether the domain is associated with spam or other abusive activities
</ResponseField>

***

## Response Examples

### Success Response (Valid Email)

```json theme={null}
{
  "status": 200,
  "email": "[email protected]",
  "normalized_email": "[email protected]",
  "domain": "example.com",
  "domain_age_in_days": 1234,
  "mx": true,
  "mx_records": ["mail.example.com"],
  "disposable": false,
  "disposable_provider": null,
  "public_domain": false,
  "relay_domain": false,
  "alias": false,
  "role_account": false,
  "did_you_mean": null,
  "blocklisted": false,
  "spam": false
}
```

### Disposable Email Detected

```json theme={null}
{
  "status": 200,
  "email": "[email protected]",
  "normalized_email": "[email protected]",
  "domain": "tempmail.com",
  "domain_age_in_days": 456,
  "mx": true,
  "mx_records": ["mx1.tempmail.com"],
  "disposable": true,
  "disposable_provider": "tempmail.com",
  "public_domain": false,
  "relay_domain": false,
  "alias": false,
  "role_account": false,
  "did_you_mean": null,
  "blocklisted": false,
  "spam": true
}
```

<Warning>
  When `disposable: true`, you should typically **block or flag** this email to prevent fraud.
</Warning>

### Typo Suggestion

```json theme={null}
{
  "status": 200,
  "email": "[email protected]",
  "normalized_email": "[email protected]",
  "domain": "gmial.com",
  "domain_age_in_days": null,
  "mx": false,
  "mx_records": [],
  "disposable": false,
  "disposable_provider": null,
  "public_domain": false,
  "relay_domain": false,
  "alias": false,
  "role_account": false,
  "did_you_mean": "[email protected]",
  "blocklisted": false,
  "spam": false
}
```

<Info>
  The `did_you_mean` field suggests `gmail.com` instead of `gmial.com`, helping you catch user typos.
</Info>

***

## Error Responses

### Invalid Email (400)

```json theme={null}
{
  "status": 400,
  "error": "The email address is invalid."
}
```

### Rate Limit Exceeded (429)

```json theme={null}
{
  "status": 429,
  "error": "Too many requests"
}
```

<Card title="Learn About Rate Limits" icon="gauge" href="/api-reference/rate-limits">
  View rate limit details and best practices
</Card>

***

## Common Use Cases

<AccordionGroup>
  <Accordion title="Block disposable emails during signup">
    ```javascript theme={null}
    const response = await fetch(`https://api.fraudiant.com/email/${userEmail}`, {
      headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
    });

    const data = await response.json();

    if (data.disposable) {
      return { error: 'Disposable email addresses are not allowed' };
    }

    // Proceed with registration
    ```
  </Accordion>

  <Accordion title="Detect role-based accounts">
    ```javascript theme={null}
    if (data.role_account) {
      console.log('This is a role-based email (e.g., support@, info@)');
      // Handle accordingly
    }
    ```
  </Accordion>

  <Accordion title="Suggest corrections for typos">
    ```javascript theme={null}
    if (data.did_you_mean) {
      return {
        message: `Did you mean ${data.did_you_mean}?`,
        suggestion: data.did_you_mean
      };
    }
    ```
  </Accordion>

  <Accordion title="Check MX records for deliverability">
    ```javascript theme={null}
    if (!data.mx || data.mx_records.length === 0) {
      console.warn('Email domain has no valid MX records');
      // Email may not be deliverable
    }
    ```
  </Accordion>
</AccordionGroup>

***

## Best Practices

<CardGroup cols={2}>
  <Card title="Cache Results" icon="database">
    Cache validation results to reduce API calls for the same email address
  </Card>

  <Card title="Handle Errors Gracefully" icon="shield-check">
    Always handle rate limits and validation errors in your application
  </Card>

  <Card title="Use Normalized Email" icon="check">
    Store the `normalized_email` field in your database for consistency
  </Card>

  <Card title="Combine Multiple Signals" icon="chart-network">
    Use multiple fields (`disposable`, `spam`, `mx`) for better fraud detection
  </Card>
</CardGroup>
