Documentation

Integrate LeadCop.

Protect your registration forms and email lists from disposable, temporary, and fake email addresses. This guide covers everything from a simple no-code setup to full backend API integration.

Quick Start

The fastest way to protect your website — no programming needed. You just need to copy and paste one line of code.

3 steps to protect any website

  1. 1

    Create a free account

    Sign up — no credit card required. Your API key is generated automatically.

    Create free account →
  2. 2

    Copy the script tag

    Paste this snippet just before the closing </body> tag in your website's HTML:

    HTML
    <script
      src="https://leadcop.io/leadcop-email-validator.js"
      data-api-key="YOUR_API_KEY">
    </script>
  3. 3

    That's it — you're protected

    LeadCop automatically finds every email input field on your site. When someone types a disposable email, they'll see an error.

    ✅ Real-time validation as users type.

Authentication

There are two ways to use LeadCop. Pick the one that matches where your validation runs — the key type differs for each.

No-code · in the browser

Embedded script & plugins

Drop the script tag on your site. It validates form inputs client-side and calls /api/public/check-email for you.

Uses a domain-locked key via data-api-key.

Code · on your server

REST API

Call POST /api/check-email directly from your backend for full control over the validation response.

Uses your primary key via the Authorization header.

Bearer token (REST API)

Send your primary API key from the dashboard in the Authorization header on every request.

HTTP Header
Authorization: Bearer YOUR_API_KEY

Primary keys are server-to-server only. Calling the REST API with your primary key from a browser returns 403. For client-side / form validation use a domain-locked key(created per website in the dashboard), or better, the embedded script.

Server-to-server header

When calling from your own backend, add the X-LeadCop-Source header so the request is treated as a trusted server-to-server call (bypasses the browser-origin check).

HTTP Header
Authorization: Bearer YOUR_API_KEY
X-LeadCop-Source: server

API Endpoint

A single endpoint validates an email and returns a full reputation breakdown. Send the email in the request body.

POSThttps://leadcop.io/api/check-email

Example request (cURL)

bash
curl -X POST https://leadcop.io/api/check-email \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-LeadCop-Source: server" \
  -H "Content-Type: application/json" \
  -d '{"email": "test@mailinator.com"}'

Request body

JSON
{
  "email": "test@mailinator.com"
}

Response · 200 OK

JSON
{
  "isDisposable": true,
  "domain": "mailinator.com",
  "reputationScore": 40,
  "riskLevel": "Poor",
  "tags": ["disposable"],
  "reasons": ["Disposable email provider detected"],
  "isValidSyntax": true,
  "isRoleAccount": false,
  "isFreeEmail": false,
  "isInvalidTld": false,
  "didYouMean": null,
  "mxValid": true,
  "smtpValid": true,
  "requestsRemaining": 999
}

Response fields

isDisposableboolean

True if the domain is a disposable/temporary provider (or blocked by your policy).

reputationScorenumber

0–100 quality score. Higher is safer; combines every signal below.

riskLevelstring

Human-readable band: Excellent, Good, Medium, Poor, or Critical.

didYouMeanstring | null

Suggested correction for a likely domain typo, e.g. "gmail.com" for "gmial.com".

isRoleAccountboolean | null

True for role addresses like info@ or admin@. Null if your plan lacks role detection.

isFreeEmailboolean | null

True for free providers (Gmail, Yahoo…). Null if your plan lacks free-provider detection.

isInvalidTldboolean

True if the top-level domain is not a valid, recognized TLD.

mxValidboolean

True if the domain has valid MX (mail exchange) records.

tagsstring[]

Machine-readable labels, e.g. ["disposable", "role_account"].

reasonsstring[]

Human-readable explanations for the score and any block.

requestsRemainingnumber

Requests left in your current billing period.

Error Codes

400 Bad Request

Invalid request payload

The request body was missing the 'email' field, was empty, or was not valid JSON. Returns { "error": "Invalid request payload" }.

401 Unauthorized

Invalid API Key

The Authorization header is missing, malformed, or the API key does not match any account.

403 Forbidden

Key used in the wrong context

Either a primary key was called from a browser (primary keys are server-to-server only), or a domain-locked key was used on a domain it isn't authorized for.

429 Too Many Requests

Rate limit exceeded

Either your monthly request quota is used up (upgrade your plan), or you exceeded your per-minute burst limit (rate limit = plan requests/second × 60). Retry after slowing down.

500 Internal Server Error

Transient server error

A temporary error on our side. Requests are safe to retry — the embedded script and plugins fail open, so form submissions are never blocked by an outage.

🛍️

Shopify Integration

Add LeadCop validation to your Shopify storefront. This will protect your newsletter signups, contact forms, and customer registration inputs.

Theme Integration (theme.liquid)

  1. Go to your Shopify Admin and click on Online Store > Themes.
  2. Click the ... (Actions) button next to your active theme, then select Edit Code.
  3. Open the layout/theme.liquid file.
  4. Scroll to the very bottom of the file and paste the following script tag immediately before the closing </body> tag:
HTML
<script
  src="https://leadcop.io/leadcop-email-validator.js"
  data-api-key="YOUR_API_KEY">
</script>

Ensure you replace YOUR_API_KEY with your actual public API key from the LeadCop dashboard.

🔌

WordPress Integration

Protect your WordPress site using our native plugin. It automatically integrates with default registration, comments, WooCommerce, and popular form builders.

Plugin Setup (No Code)

  1. In your WordPress Admin, go to Plugins > Add New.
  2. Search for “LeadCop” in the plugin directory.
  3. Click Install Now on the LeadCop plugin, then Activate.
  4. Open the new LeadCop menu item in your admin sidebar.
  5. Paste your API key into the settings field and click Save Settings.

LeadCop is published on the official WordPress.org directory, so it installs in one click — no file downloads. View on WordPress.org →

Prefer a manual install?

Download the .zip from the WordPress.org page, then go to Plugins > Add New > Upload Plugin, select the file, and click Install Now.

Supported Form Systems out-of-the-box:

  • ✅ WordPress Registration
  • ✅ Comment Forms
  • ✅ WooCommerce Checkout
  • ✅ Contact Form 7
  • ✅ WPForms
  • ✅ Gravity Forms

Alternative: Script tag (No plugin)

Don’t want a plugin? Add the same script your other sites use. Paste it before the closing </body> tag — either in your theme’s footer.php, or with a header/footer code plugin (e.g. “WPCode” or “Insert Headers and Footers”).

HTML
<script
  src="https://leadcop.io/leadcop-email-validator.js"
  data-api-key="YOUR_API_KEY">
</script>

Wix Integration

Configure LeadCop on your Wix website. Choose the method depending on whether your site is on a Wix Premium or Wix Free plan.

Method 1: Wix Premium (Custom Code)

  1. Go to your Wix Dashboard and select Settings.
  2. Scroll down to the Advanced section and click on Custom Code.
  3. Click + Add Custom Code in the top right.
  4. Paste the LeadCop script tag in the code box.
  5. Set Place Code in to Body - end.
  6. Select All Pages (or specify your Contact page) and click Apply.

Method 2: Wix Free (HTML Embed workaround)

Wix Free does not support Custom Code. You must embed a custom HTML form and the LeadCop script inside a single HTML Element (iframe):

HTML
<form action="YOUR_FORM_SUBMIT_URL" method="POST">
  <input type="email" name="email" required />
  <button type="submit">Submit</button>
</form>

<script
  src="https://leadcop.io/leadcop-email-validator.js"
  data-api-key="YOUR_API_KEY">
</script>
🕸️

Webflow Integration

Add LeadCop to your Webflow project. It will automatically intercept native Webflow form submissions.

Site-wide Integration

  1. Go to your Webflow Project Settings.
  2. Click on the Custom Code tab.
  3. Paste the script tag into the Footer Code text area (before the closing </body> tag).
  4. Click Save Changes and publish your site.
HTML
<script
  src="https://leadcop.io/leadcop-email-validator.js"
  data-api-key="YOUR_API_KEY">
</script>
🎨

Framer Integration

Inject the LeadCop script into your Framer website to protect signup forms and lead capture widgets.

Framer Custom Code Settings

  1. Open your project in Framer and click on the Project Settings (gear icon).
  2. In the left sidebar, click on General.
  3. Scroll down to the Custom Code section.
  4. In the End of <body> input field, paste your LeadCop script tag:
HTML
<script
  src="https://leadcop.io/leadcop-email-validator.js"
  data-api-key="YOUR_API_KEY">
</script>

Click Save and publish your changes.

⚛️

Next.js & React Integration

For dynamic React or Next.js applications, query the LeadCop REST API directly from your client components or server-side actions.

Client-side React Hook

Create a custom hook to perform real-time checks as the user types (using a 500ms debounce to limit API requests):

TypeScript
import { useState, useEffect } from "react";

export function useEmailCheck(email: string) {
  const [result, setResult] = useState({ isDisposable: false, checking: false });

  useEffect(() => {
    if (!email || !email.includes("@")) return;

    const delay = setTimeout(async () => {
      setResult(prev => ({ ...prev, checking: true }));
      try {
        // Use a domain-locked key here — primary keys are server-to-server only
        // and will return 403 when called from a browser. Create a domain-locked
        // key in the dashboard under API Keys → New Key.
        const res = await fetch("https://leadcop.io/api/public/check-email", {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({ email, apiKey: "YOUR_DOMAIN_LOCKED_KEY" }),
        });
        const data = await res.json();
        setResult({ isDisposable: !!data.isDisposable, checking: false });
      } catch {
        setResult({ isDisposable: false, checking: false });
      }
    }, 500);

    return () => clearTimeout(delay);
  }, [email]);

  return result;
}

Frequently Asked Questions

Protect your growth.

Set up takes under 2 minutes. Start for free today and clean your lead data instantly.

Start for free today