# Migrate from Bounceban to Tomba

This guide will help you seamlessly transition from Bounceban to Tomba's email verification service, offering superior accuracy, more data attributes, and better integration options.

---

## Why Choose Tomba Over Bounceban?

| Feature                    | Bounceban     | Tomba                            |
| -------------------------- | ------------- | -------------------------------- |
| **Accuracy**               | 95-97%        | 99%+                             |
| **Pricing**                | Pay-as-you-go | Flexible plans with better rates |
| **Catchall Detection**     | Basic         | Advanced with confidence scoring |
| **Speed**                  | Standard      | Ultra-fast with caching          |
| **Bulk Verification**      | Yes           | Yes, with advanced API           |
| **API Access**             | REST API      | REST API + MCP + SDKs            |
| **Data Attributes**        | Limited       | 15+ comprehensive attributes     |
| **Real-time Verification** | Yes           | Yes, with smart caching          |
| **SMTP Provider Info**     | No            | Yes, detailed provider detection |
| **Integration Options**    | Basic         | Extensive (50+ integrations)     |

---

## Key Advantages of Tomba

### 1. Superior Accuracy

- 99%+ accuracy rate with advanced verification
- Multi-layered SMTP validation
- Real-time mailbox checking
- Machine learning-enhanced detection

### 2. Richer Data Attributes

### 2. 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
            }
        ]
    }
}
```

### 3. Better Developer Experience

- Official SDKs for 10+ languages
- Model Context Protocol (MCP) support
- Comprehensive API documentation
- OpenAPI/Swagger specification

### 4. Smart Verification Caching

- 3-month automatic caching
- Free cached results
- Instant response times
- Automatic freshness management

### 5. More Integration Options

- Google Sheets add-on
- Microsoft Excel add-in
- Chrome extension
- Zapier/n8n workflows
- Direct CRM integrations

---

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

**Bounceban endpoint:**

```
POST https://api.bounceban.com/v1/verify
```

**Tomba endpoint:**

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

### Step 3: Update Authentication

**Bounceban authentication:**

```javascript
{
  "api_key": "your_bounceban_key"
}
```

**Tomba authentication:**

```javascript
// Headers (more secure)
{
  "X-Tomba-Key": "your_api_key",
  "X-Tomba-Secret": "your_secret_key"
}
```

### Step 4: Update Response Handling

**Bounceban response:**

```json
{
    "email": "test@example.com",
    "status": "valid",
    "free_email": false,
    "disposable": false,
    "role_account": false
}
```

**Tomba response:**

```json
{
    "data": {
        "email": "test@example.com",
        "status": "valid",
        "result": "deliverable",
        "score": 100,
        "regex": true,
        "mx_records": ["mail.example.com"],
        "mx_check": true,
        "smtp_server": true,
        "smtp_check": true,
        "smtp_provider": "Google Workspace",
        "accept_all": false,
        "block": false,
        "gibberish": false,
        "disposable": false,
        "webmail": false,
        "greylisted": false
    }
}
```

---

## Code Migration Examples

### Node.js

**Before (Bounceban):**

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

async function verifyEmail(email) {
    const response = await axios.post("https://api.bounceban.com/v1/verify", {
        api_key: process.env.BOUNCEBAN_KEY,
        email: email,
    });

    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 },
        headers: {
            "X-Tomba-Key": process.env.TOMBA_KEY,
            "X-Tomba-Secret": process.env.TOMBA_SECRET,
        },
    });

    return response.data.data;
}

// Or use the official Tomba SDK
import { TombaClient, Domain } from "tomba";

// Init Tomba
const client = new TombaClient();
const domain = new Domain(client);

client
    .setKey("ta_xxxx") // Your Key
    .setSecret("ts_xxxx"); // Your Secret

let result = verifier.emailVerifier("b.mohamed@tomba.io");

result
    .then((response) => {
        console.log(response);
    })
    .catch((err) => {
        console.log(err);
    });
```

### Python

**Before (Bounceban):**

```python
import requests

def verify_email(email):
    response = requests.post(
        'https://api.bounceban.com/v1/verify',
        json={
            'api_key': os.environ['BOUNCEBAN_KEY'],
            'email': email
        }
    )
    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']
        }
    )
    return response.json()['data']

# Or use the official SDK
from tomba import Client, Verifier

client = Client(os.environ['TOMBA_KEY'], os.environ['TOMBA_SECRET'])
verifier = Verifier(client)

def verify_email(email):
    return verifier.email_verifier(email)
```

### PHP

**Before (Bounceban):**

```php
<?php
function verifyEmail($email) {
    $data = [
        'api_key' => $_ENV['BOUNCEBAN_KEY'],
        'email' => $email
    ];

    $ch = curl_init('https://api.bounceban.com/v1/verify');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
    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);

    return json_decode($response)->data;
}

// Or use the official SDK
require 'vendor/autoload.php';
use Tomba\Client;
use Tomba\Services\Verifier;

$client = new Client($_ENV['TOMBA_KEY'], $_ENV['TOMBA_SECRET']);
$verifier = new Verifier($client);

function verifyEmail($email) {
    return $verifier->emailVerifier($email);
}
```

---

## Status Mapping

| Bounceban Status | Tomba Status | Tomba Result    | Description                    |
| ---------------- | ------------ | --------------- | ------------------------------ |
| `valid`          | `valid`      | `deliverable`   | Email is valid and deliverable |
| `invalid`        | `invalid`    | `undeliverable` | Email is invalid               |
| `catch_all`      | `accept_all` | `risky`         | Domain accepts all emails      |
| `unknown`        | `unknown`    | `risky`         | Could not verify               |
| `disposable`     | `disposable` | `undeliverable` | Temporary email service        |

---

## Bulk Verification Migration

**Bounceban bulk approach:**

```javascript
// Sequential verification
for (const email of emails) {
    await verifyEmail(email);
}
```

**Tomba bulk approach:**

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

    return response.data;
};
```

---

## Advanced Features in Tomba

### 1. SMTP Provider Detection

Know exactly which email service is being used:

```json
{
    "smtp_provider": "Google Workspace",
    "smtp_check": true
}
```

### 2. Confidence Scoring

Get a clear confidence score (0-100):

```json
{
    "score": 95,
    "result": "deliverable"
}
```

### 3. MX Record Details

See the actual mail servers:

```json
{
    "mx_records": ["aspmx.l.google.com", "alt1.aspmx.l.google.com"]
}
```

### 4. Greylisting Detection

Identify temporary deferrals:

```json
{
    "greylisted": false
}
```

### 5. Gibberish Detection

Identify randomly generated addresses:

```json
{
    "gibberish": false
}
```

---

## Testing Your Migration

### Side-by-Side Comparison

```javascript
const testEmails = [
    "valid@example.com",
    "invalid@example.com",
    "catchall@example.com",
    "disposable@temp-mail.org",
];

async function compareServices() {
    for (const email of testEmails) {
        const bouncebanResult = await bouncebanVerify(email);
        const tombaResult = await tombaVerify(email);

        console.log({
            email,
            bounceban: bouncebanResult.status,
            tomba: {
                status: tombaResult.status,
                result: tombaResult.result,
                score: tombaResult.score,
                smtp_provider: tombaResult.smtp_provider,
                extras: {
                    accept_all: tombaResult.accept_all,
                    webmail: tombaResult.webmail,
                    disposable: tombaResult.disposable,
                },
            },
        });
    }
}
```

---

## Migration Checklist

- [ ] Sign up for Tomba account
- [ ] Get API credentials
- [ ] Update authentication in codebase
- [ ] Update API endpoints
- [ ] Map response fields to new structure
- [ ] Update error handling
- [ ] Test with sample emails
- [ ] Run parallel comparison tests
- [ ] Update bulk verification logic
- [ ] Update documentation
- [ ] Train team on new API
- [ ] Monitor initial rollout
- [ ] Cancel Bounceban subscription

---

## 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)
- [SDK 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 migration affect my application uptime?**
A: No, you can run both services in parallel during migration to ensure zero downtime.

**Q: How long does a typical migration take?**
A: Most teams complete migration in 1-2 hours, including testing.

**Q: Can I get help with the migration?**
A: Yes! Our support team offers migration assistance, especially for enterprise customers.

**Q: What about my existing verification credits?**
A: Use your remaining Bounceban credits while testing Tomba in parallel.

**Q: Is there a free trial?**
A: Yes, start with 25 free verifications to test the service before committing.
