# Migrate from Bouncer to Tomba

This guide will help you seamlessly transition from Bouncer to Tomba's email verification service, offering superior data attributes, smart caching, and competitive pricing.

---

## Why Choose Tomba Over Bouncer?

| Feature                     | Bouncer          | Tomba                                     |
| --------------------------- | ---------------- | ----------------------------------------- |
| **Accuracy**                | 95-97%           | 99%+                                      |
| **Pricing**                 | $0.006 per email | More competitive rates with better value  |
| **Data Attributes**         | 8-10 fields      | 15+ comprehensive attributes              |
| **Catchall Detection**      | Basic            | Advanced with confidence scoring          |
| **Speed**                   | Fast             | Ultra-fast with optimized infrastructure  |
| **Bulk Verification**       | Yes              | Yes, with better batch processing         |
| **API Access**              | REST API         | REST API + MCP integration                |
| **Smart Caching**           | No               | 3-month automatic caching (saves credits) |
| **SMTP Provider Detection** | Limited          | Advanced provider identification          |
| **Data Sources**            | Not provided     | Source tracking with URLs and timestamps  |
| **Whois Data**              | Basic            | Comprehensive domain registration details |

---

## Key Advantages of Tomba

### 1. Superior Data Intelligence

Tomba provides 15+ data attributes vs Bouncer's 8-10 fields, including:

- SMTP provider identification (Google Workspace, Microsoft 365, etc.)
- Complete MX records array
- Domain whois information
- Email source tracking with URLs and timestamps
- Greylisting detection
- Advanced risk scoring

### 2. Smart Caching System

**Tomba's unique advantage**: Automatic 3-month verification caching

- Skip verification if email was checked within the last 3 months
- Free cached results (no credits charged)
- Instant response times for cached emails
- Automatic freshness management

This feature alone can save you 40-60% on verification costs for recurring contact validation.

### 3. Rich Data Attributes (15+ Fields)

Tomba provides comprehensive verification data with 15+ attributes:

- **Verification Results**: `status` (valid/invalid/accept_all/etc.), `result` (deliverable/undeliverable/risky), `score` (0-100)
- **SMTP Intelligence**: `smtp_provider` (e.g., "Google Workspace"), `smtp_server`, `smtp_check`
- **MX Infrastructure**: Complete `mx.records` array, `mx_check` validation
- **Email Quality Signals**: `accept_all`, `greylisted`, `block`, `gibberish`, `regex`
- **Email Type Detection**: `disposable`, `webmail`
- **Domain Insights**: `whois` data including registrar, creation date, referral URL
- **Data Provenance**: `sources` array with URIs, extraction dates, and page status

**Example comprehensive response:**

```json
{
    "data": {
        "email": {
            "email": "dayna.winter@shopify.com",
            "result": "deliverable",
            "status": "valid",
            "score": 99,
            "smtp_provider": "Google Workspace",
            "mx": {
                "records": [
                    "aspmx.l.google.com",
                    "alt1.aspmx.l.google.com",
                    "alt2.aspmx.l.google.com",
                    "alt4.aspmx.l.google.com",
                    "alt3.aspmx.l.google.com"
                ]
            },
            "mx_check": true,
            "smtp_server": true,
            "smtp_check": true,
            "accept_all": true,
            "greylisted": false,
            "block": false,
            "gibberish": false,
            "disposable": false,
            "webmail": false,
            "regex": true,
            "whois": {
                "registrar_name": "markmonitor inc.",
                "referral_url": "http://www.markmonitor.com",
                "created_date": "2005-03-11T06:18:03+01:00"
            }
        },
        "sources": [
            {
                "uri": "https://www.shopify.com/blog/black-friday-cyber-monday-shopify-apps",
                "website_url": "www.shopify.com",
                "extracted_on": "2022-11-07T13:16:42+01:00",
                "last_seen_on": "2022-11-07T13:16:42+01:00",
                "still_on_page": true
            }
        ]
    }
}
```

### 4. Better Developer Experience

- Official SDKs for 10+ languages (Node.js, Python, PHP, Ruby, Go, C#, etc.)
- Model Context Protocol (MCP) support for AI integrations
- Comprehensive API documentation
- OpenAPI/Swagger specification

### 5. More Integration Options

- Google Sheets add-on
- Microsoft Excel add-in
- Chrome/Firefox/Edge/Safari extensions
- Zapier and n8n workflows
- Direct CRM integrations
- Apify integration

---

## Migration Steps

### Step 1: Get Your Tomba API Credentials

1. Sign up at [app.tomba.io](https://app.tomba.io)
2. Navigate to **API** → **API Keys**
3. Copy your **API Key** and **Secret Key**

### Step 2: Update API Endpoints

**Bouncer endpoint:**

```
POST https://api.usebouncer.com/v1/email/verify
```

**Tomba endpoint:**

```
GET https://api.tomba.io/v1/email-verifier?email={email}
```

### Step 3: Update Authentication

**Bouncer authentication:**

```javascript
{
  "headers": {
    "x-api-key": "your_bouncer_key"
  }
}
```

**Tomba authentication:**

```javascript
{
  "headers": {
    "X-Tomba-Key": "your_api_key",
    "X-Tomba-Secret": "your_secret_key"
  }
}
```

### Step 4: Update Response Mapping

**Bouncer response:**

```json
{
    "email": "test@example.com",
    "status": "deliverable",
    "reason": "accepted_email",
    "domain": {
        "name": "example.com",
        "acceptAll": false,
        "disposable": false
    },
    "account": {
        "role": false,
        "disabled": false,
        "fullMailbox": false
    }
}
```

**Tomba response (with 15+ attributes):**

```json
{
    "data": {
        "email": "test@example.com",
        "status": "valid",
        "result": "deliverable",
        "score": 100,
        "smtp_provider": "Google Workspace",
        "mx": {
            "records": ["mx1.example.com", "mx2.example.com"]
        },
        "mx_check": true,
        "smtp_server": true,
        "smtp_check": true,
        "accept_all": false,
        "greylisted": false,
        "block": false,
        "disposable": false,
        "webmail": false,
        "gibberish": false,
        "regex": true,
        "whois": {
            "registrar_name": "namecheap inc.",
            "created_date": "2010-05-15T10:30:00+00:00"
        }
    }
}
```

---

## Code Migration Examples

### Node.js

**Before (Bouncer):**

```javascript
const axios = require("axios");

async function verifyEmail(email) {
    const response = await axios.post(
        "https://api.usebouncer.com/v1/email/verify",
        { email: email },
        {
            headers: {
                "x-api-key": process.env.BOUNCER_KEY,
            },
        },
    );

    return response.data;
}
```

**After (Tomba):**

```javascript
const axios = require("axios");

async function verifyEmail(email) {
    const response = await axios.get(`https://api.tomba.io/v1/email-verifier`, {
        params: { email: email },
        headers: {
            "X-Tomba-Key": process.env.TOMBA_KEY,
            "X-Tomba-Secret": process.env.TOMBA_SECRET,
        },
    });

    // Access rich data attributes
    const data = response.data.data;
    console.log(`Status: ${data.status}`);
    console.log(`SMTP Provider: ${data.smtp_provider}`);
    console.log(`Score: ${data.score}`);

    return data;
}
```

**Using Tomba SDK:**

```javascript
const Tomba = require("tomba");

const client = new Tomba.Client()
    .setKey(process.env.TOMBA_KEY)
    .setSecret(process.env.TOMBA_SECRET);

const verifier = new Tomba.Verifier(client);

async function verifyEmail(email) {
    const result = await verifier.emailVerifier({ email: email });
    return result.data;
}
```

### Python

**Before (Bouncer):**

```python
import requests

def verify_email(email):
    response = requests.post(
        'https://api.usebouncer.com/v1/email/verify',
        json={'email': email},
        headers={'x-api-key': os.environ['BOUNCER_KEY']}
    )
    return response.json()
```

**After (Tomba):**

```python
import requests

def verify_email(email):
    response = requests.get(
        'https://api.tomba.io/v1/email-verifier',
        params={'email': email},
        headers={
            'X-Tomba-Key': os.environ['TOMBA_KEY'],
            'X-Tomba-Secret': os.environ['TOMBA_SECRET']
        }
    )
    data = response.json()['data']

    # Access rich attributes
    print(f"Status: {data['status']}")
    print(f"SMTP Provider: {data.get('smtp_provider', 'N/A')}")
    print(f"Score: {data['score']}")

    return data
```

**Using Tomba SDK:**

```python
from tomba import Client, Verifier

client = Client()
client.set_key(os.environ['TOMBA_KEY'])
client.set_secret(os.environ['TOMBA_SECRET'])

verifier = Verifier(client)

def verify_email(email):
    result = verifier.email_verifier(email=email)
    return result['data']
```

### PHP

**Before (Bouncer):**

```php
<?php
function verifyEmail($email) {
    $ch = curl_init('https://api.usebouncer.com/v1/email/verify');
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['email' => $email]));
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        'x-api-key: ' . $_ENV['BOUNCER_KEY'],
        'Content-Type: application/json'
    ]);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $response = curl_exec($ch);
    curl_close($ch);

    return json_decode($response);
}
```

**After (Tomba):**

```php
<?php
function verifyEmail($email) {
    $ch = curl_init('https://api.tomba.io/v1/email-verifier?email=' . urlencode($email));
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        'X-Tomba-Key: ' . $_ENV['TOMBA_KEY'],
        'X-Tomba-Secret: ' . $_ENV['TOMBA_SECRET']
    ]);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $response = curl_exec($ch);
    curl_close($ch);

    $data = json_decode($response)->data;

    // Access rich attributes
    echo "Status: " . $data->status . "\n";
    echo "SMTP Provider: " . ($data->smtp_provider ?? 'N/A') . "\n";
    echo "Score: " . $data->score . "\n";

    return $data;
}
```

**Using Tomba SDK:**

```php
<?php
require 'vendor/autoload.php';

use Tomba\Client;
use Tomba\Services\Verifier;

$client = new Client();
$client->setKey($_ENV['TOMBA_KEY'])
       ->setSecret($_ENV['TOMBA_SECRET']);

$verifier = new Verifier($client);

function verifyEmail($email) {
    global $verifier;
    $result = $verifier->emailVerifier(['email' => $email]);
    return $result['data'];
}
```

---

## Status Mapping

| Bouncer Status  | Tomba Status | Tomba Result    | Notes                               |
| --------------- | ------------ | --------------- | ----------------------------------- |
| `deliverable`   | `valid`      | `deliverable`   | Direct mapping                      |
| `undeliverable` | `invalid`    | `undeliverable` | Direct mapping                      |
| `accept_all`    | `accept_all` | `risky`         | Catch-all domain                    |
| `unknown`       | `unknown`    | `risky`         | Unable to verify                    |
| `disposable`    | `disposable` | `undeliverable` | Temporary email                     |
| `role`          | `valid`      | `deliverable`   | Check `sources` for contact context |

---

## Bulk Verification Migration

### Bouncer Bulk Process

```javascript
// Bouncer bulk verification
const verifyBulk = async (emails) => {
    const response = await axios.post(
        "https://api.usebouncer.com/v1.1/email/verify/batch",
        { emails: emails },
        {
            headers: {
                "x-api-key": process.env.BOUNCER_KEY,
            },
        },
    );
    return response.data;
};
```

### Tomba Bulk Process (with Smart Caching)

```javascript
// Tomba bulk verification
const verifyBulk = async (emails) => {
    const response = await axios.post(
        "https://api.tomba.io/v1/bulk/email-verifier",
        { emails: emails },
        {
            headers: {
                "X-Tomba-Key": process.env.TOMBA_KEY,
                "X-Tomba-Secret": process.env.TOMBA_SECRET,
            },
        },
    );

    // Benefit: Cached emails are free and instant
    return response.data;
};
```

**Key advantage**: Tomba's smart caching means repeat verifications within 3 months are free and instant!

---

## Advanced Features

### 1. Model Context Protocol (MCP) Support

Integrate email verification directly with AI tools:

```javascript
// MCP configuration for Claude Desktop
{
  "mcpServers": {
    "tomba": {
      "command": "npx",
      "args": ["-y", "@tomba-io/mcp"]
    }
  }
}
```

### 3. Source Tracking

Understand where emails were found:

```javascript
const data = await verifyEmail("test@example.com");

// Access source information
data.sources.forEach((source) => {
    console.log(`Found on: ${source.uri}`);
    console.log(`Extracted: ${source.extracted_on}`);
    console.log(`Still active: ${source.still_on_page}`);
});
```

---

## Testing Your Migration

### Parallel Testing Script

```javascript
const testMigration = async (testEmails) => {
    for (const email of testEmails) {
        // Verify with Bouncer
        const bouncerResult = await verifyWithBouncer(email);

        // Verify with Tomba
        const tombaResult = await verifyWithTomba(email);

        // Compare results
        console.log(`Email: ${email}`);
        console.log(`Bouncer: ${bouncerResult.status}`);
        console.log(
            `Tomba: ${tombaResult.status} (${tombaResult.score} score)`,
        );
        console.log(`Extra data: SMTP Provider - ${tombaResult.smtp_provider}`);
        console.log(`---`);
    }
};

// Test with sample emails
testMigration([
    "valid@example.com",
    "invalid@example.com",
    "catchall@example.com",
]);
```

### Cost Comparison

```javascript
// Calculate cost savings with caching
const calculateSavings = (monthlyVolume, repeatRate) => {
    const bouncerCost = monthlyVolume * 0.006;
    const tombaCost = monthlyVolume * (1 - repeatRate) * 0.005; // Cached = free

    const savings = bouncerCost - tombaCost;
    const savingsPercent = (savings / bouncerCost) * 100;

    console.log(`Monthly volume: ${monthlyVolume}`);
    console.log(`Repeat rate: ${repeatRate * 100}%`);
    console.log(`Bouncer cost: $${bouncerCost.toFixed(2)}`);
    console.log(`Tomba cost: $${tombaCost.toFixed(2)}`);
    console.log(
        `Savings: $${savings.toFixed(2)} (${savingsPercent.toFixed(1)}%)`,
    );
};

// Example: 10k monthly verifications with 40% repeat rate
calculateSavings(10000, 0.4); // Save 40% on cached verifications
```

---

## Migration Checklist

- [ ] Sign up for Tomba account
- [ ] Generate API credentials
- [ ] Install Tomba SDK (optional but recommended)
- [ ] Update API endpoints in your code
- [ ] Update authentication headers
- [ ] Update response parsing logic to leverage new attributes
- [ ] Test with sample emails (parallel testing)
- [ ] Update bulk verification code
- [ ] Update error handling
- [ ] Monitor performance and accuracy
- [ ] Review cost savings from smart caching
- [ ] Update documentation
- [ ] Train team on new features
- [ ] Complete full migration

---

## Support and Resources

- [Tomba API Documentation](https://docs.tomba.io)
- [Email Verifier Attributes](https://docs.tomba.io/attributes/verifier)
- [Bulk Verification Guide](https://docs.tomba.io/bulks/email-verifier)
- [SDKs and Libraries](https://docs.tomba.io/libraries)
- [Support Portal](https://help.tomba.io)

Need help with migration? Contact our support team for personalized assistance.

---

## FAQ

**Q: Will I lose any features by switching from Bouncer?**
A: No! Tomba provides all Bouncer features plus 15+ data attributes, smart caching, MCP integration, and source tracking.

**Q: How does the 3-month caching work?**
A: When you verify an email, Tomba caches the result for 3 months. If you verify the same email again within this period, you get instant results without using credits.

**Q: What about emails I verify regularly (like in CRM)?**
A: This is where Tomba excels! With 3-month caching, recurring verifications are free, potentially saving you 40-60% on costs.

**Q: How long does migration take?**
A: Most migrations can be completed in 1-2 hours. Our SDK makes it even faster with minimal code changes.

**Q: Can I test before fully migrating?**
A: Yes! Sign up for a free account with 25 verifications to test the service and compare results.

**Q: What if I need help with bulk migration?**
A: Our enterprise support team can assist with bulk data migration, code review, and optimization strategies.

**Q: How do I access the SMTP provider information?**
A: It's automatically included in the response as `smtp_provider`. No additional calls needed!

**Q: Are the source URLs always available?**
A: Sources are provided when the email was found in our database. This gives valuable context about where contacts originated.
