# MillionVerifier에서 마이그레이션

이 가이드는 MillionVerifier API(단일 검증 v3, 대량 파일 API v2, 크레딧)를 Tomba [Email Verifier](/api/verifier#email-verifier) 및 [대량 검증 작업](/bulks#email-verifier)에 매핑합니다. MillionVerifier API 동작은 2026-09-29에 [MillionVerifier API 참조](https://developer.millionverifier.com/)를 기준으로 확인했습니다.

## 시작하기 전에

- API 키(`ta_…`)와 시크릿 키(`ts_…`)를 발급받습니다. [인증](/authentication)을 참고합니다.
- 검증 비용은 [크레딧 비용](/usage-and-quotas#credit-costs)에서, 사용 중인 플랜의 스로틀링은 [플랜별 한도](/rate-limits#limits-by-plan)에서 확인합니다.
- HTTP 클라이언트 타임아웃을 180초 이상으로 설정합니다. Tomba는 완성된 결과를 응답으로 반환합니다.

## 엔드포인트 매핑

MillionVerifier는 `api.millionverifier.com`과 `bulkapi.millionverifier.com`의 두 호스트를 사용합니다. Tomba는 모든 것을 `api.tomba.io`에서 제공합니다.

| MillionVerifier                                              | Tomba                                                                 |
| ------------------------------------------------------------ | --------------------------------------------------------------------- |
| `GET https://api.millionverifier.com/api/v3/`                | [`GET /v1/email-verifier`](/api/verifier#email-verifier)              |
| `POST https://bulkapi.millionverifier.com/bulkapi/v2/upload` | `POST /v1/bulk/verifier` 후 `PUT /v1/bulk/verifier/{id}`로 실행 |
| `GET /bulkapi/v2/fileinfo`                                   | `GET /v1/bulk/verifier/{id}/progress`                                 |
| `GET /bulkapi/v2/filelist`                                   | `GET /v1/bulk/verifier`                                               |
| `GET /bulkapi/v2/download`                                   | `GET /v1/bulk/verifier/{id}/download`                                 |
| `GET /bulkapi/stop`                                          | 대응 항목 없음                                                         |
| `GET /bulkapi/v2/delete`                                     | `DELETE /v1/bulk/verifier/{id}/delete`                                |
| `GET https://api.millionverifier.com/api/v3/credits`         | [`GET /v1/me`](/api/account#get-account)                              |

## 인증 변경 사항

MillionVerifier는 쿼리 문자열에서 키를 읽습니다. 단일 및 크레딧 엔드포인트에서는 `api`, 대량 엔드포인트에서는 `key`를 사용합니다. Tomba에는 다음과 같이 `X-Tomba-Key`와 `X-Tomba-Secret` 헤더 두 개가 필요하며, 쿼리 문자열의 자격 증명은 받지 않습니다.

```bash
# MillionVerifier
curl "https://api.millionverifier.com/api/v3/?api=$MILLIONVERIFIER_API_KEY&email=jane.doe@stripe.com&timeout=10"

# Tomba
curl "https://api.tomba.io/v1/email-verifier?email=jane.doe@stripe.com" \
  -H "X-Tomba-Key: $TOMBA_API_KEY" \
  -H "X-Tomba-Secret: $TOMBA_SECRET_KEY"
```

Tomba API 키에는 만료 기한이 있습니다. [키 만료](/authentication#key-expiry)를 참고해 키 교체 일정을 계획합니다.

## 매개변수 매핑

| MillionVerifier                                                      | Tomba                                      | 참고                                                                                                 |
| -------------------------------------------------------------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| `api`, `key`                                                         | `X-Tomba-Key` 및 `X-Tomba-Secret` 헤더 |                                                                                                       |
| `email`                                                              | `email`                                    | 필수입니다. 형식이 잘못된 주소는 결과 대신 `422 params_invalid`를 반환합니다.                       |
| `timeout`                                                            | 대응 항목 없음                              | HTTP 클라이언트에서 타임아웃을 설정합니다.                                                                  |
| Upload `file_contents`                                               | `file`                                     | `name`도 보내고, 헤더가 주소 열 이름을 나타내지 않으면 `email_field_index`(0부터 시작)도 보냅니다. |
| Download `filter=all`                                                | `file=full`                                |                                                                                                       |
| Download `filter=ok`                                                 | `file=valid`                               |                                                                                                       |
| Download `filter` `ok_and_catch_all`, `unknown`, `invalid`, `custom` | 대응 항목 없음                              | `file=full`을 다운로드하고 행을 필터링합니다.                                                             |
| `file_id`                                                            | 경로의 `{id}`                         |                                                                                                       |

## 응답 필드 매핑

MillionVerifier는 평면 객체를 반환합니다. Tomba는 확인 항목을 `data.email` 안에 중첩하고, 주소가 나타나는 공개 페이지를 `data.sources`에 나열합니다. 필드 정의는 [Email Verifier 응답](/attributes/verifier)에 있습니다.

| MillionVerifier        | Tomba                                     | 참고                                                                       |
| ---------------------- | ----------------------------------------- | --------------------------------------------------------------------------- |
| `email`                | `data.email.email`                        | 도메인이 일회용이면 빈 문자열입니다.                              |
| `result`, `resultcode` | `data.email.status`, `data.email.result`  | [상태 매핑](#status-mapping)을 참고합니다.                                      |
| `quality`              | `data.email.result`                       | 가장 가까운 필드입니다. [결과 값](/attributes/verifier#result-values)을 참고합니다. |
| `subresult`            | 대응 항목 없음                             | Tomba는 `greylisted`, `block`, `mx_check`를 별도 필드로 보고합니다.     |
| `free`                 | `data.email.webmail`                      |                                                                             |
| `role`                 | 대응 항목 없음                             |                                                                             |
| `didyoumean`           | 대응 항목 없음                             |                                                                             |
| `credits`              | `X-Verify-Remaining` 헤더, `GET /v1/me` | [사용량 확인](/usage-and-quotas#check-usage)을 참고합니다.                           |
| `executiontime`        | 대응 항목 없음                             |                                                                             |
| `error`                | `errors.message`                          | HTTP 오류 상태 코드와 함께 반환됩니다. [오류 매핑](#error-mapping)을 참고합니다.    |
| `livemode`             | 대응 항목 없음                             |                                                                             |

Tomba는 MillionVerifier에 대응 항목이 없는 `accept_all`, `disposable`, `gibberish`, `regex`, `smtp_provider`, `mx.records`, `whois`도 반환합니다.

## 상태 매핑

| MillionVerifier `result` | `resultcode` | Tomba `status`                                   | Tomba `result`  |
| ------------------------ | ------------ | ------------------------------------------------ | --------------- |
| `ok`                     | 1            | `valid`                                          | `deliverable`   |
| `catch_all`              | 2            | `accept_all`                                     | `risky`         |
| `unknown`                | 3            | `unknown`                                        | `risky`         |
| `error`                  | 4            | 상태가 없습니다. 요청이 HTTP 오류로 실패합니다. |                 |
| `disposable`             | 5            | `disposable`                                     | 빈 문자열    |
| `invalid`                | 6            | `invalid`                                        | `undeliverable` |

`status`는 대소문자를 구분하지 않고 비교합니다. 각 값의 정의는 [상태 값](/attributes/verifier#status-values)에 있습니다.

## 오류 매핑

MillionVerifier는 HTTP 200으로 오류를 반환하며, 단일 엔드포인트에서는 `result: "error"`와 `error` 문자열로, 대량 엔드포인트에서는 `error` 필드로 반환합니다. Tomba는 `errors` 객체와 함께 HTTP 오류 상태 코드를 반환하므로, 다음과 같이 대신 상태 코드를 확인합니다.

| MillionVerifier                                       | Tomba                                                                                                                        | 조치                                                                                          |
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `apikey_not_found`(단일), `invalid_api_key`(대량) | `400 authentication_failed`(누락 또는 형식 오류), `400 api_key_expired`, `401 authentication_failed`(잘못된 키 또는 시크릿 키) | 두 헤더를 모두 확인하고, 만료된 키는 [교체](/authentication#rotate-keys)합니다.                           |
| `No email specified`                                  | `422 params_invalid`                                                                                                         | 메시지에 명시된 매개변수를 수정합니다.                                                             |
| `insufficient_credits`(대량 업로드)                  | 단일 요청의 `402 quota_exceeded`                                                                                      | 대량 작업의 경우 대신 첫 다운로드 시점에 잔액을 확인합니다. [청구](/bulks#billing)를 참고합니다. |
| 대응 항목 없음                                         | `429 rate_limit`                                                                                                             | `Retry-After` 지연 시간이 지난 후 재시도합니다. [429 응답 처리](/rate-limits#handle-429-responses)를 참고합니다. |
| 대응 항목 없음                                         | `408 proxy_error`                                                                                                            | 메일함 확인에 실패했습니다. 나중에 재시도합니다.                                                              |
| 대응 항목 없음                                         | `451 claimed_email`                                                                                                          | 주소 소유자가 Tomba에 해당 주소의 처리 중단을 요청했습니다. 목록에서 제거합니다.               |

오류 응답은 크레딧을 소비하지 않습니다. 모든 유형은 [오류](/error-handling#error-types)에 나와 있습니다.

## 대량 작업 및 비동기 작업

| MillionVerifier                                   | Tomba                                                                                                                      |
| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `file_contents`로 파일 업로드                | `name`과 CSV `file` 또는 줄바꿈으로 구분한 주소 `list`를 사용하는 `POST /v1/bulk/verifier`                          |
| 시작 호출 없음                                     | 작업 실행: `PUT /v1/bulk/verifier/{id}`                                                                               |
| `fileinfo`를 폴링해 `status`와 `percent` 확인        | `status`가 `completed`가 될 때까지 `GET /v1/bulk/verifier/{id}/progress`를 폴링해 `status`와 `progress` 확인                       |
| 계정 설정에서 지정하는 `file_ready` 웹훅 | 서명된 `bulk.completed` 이벤트를 받는 작업의 `webhook_url`. [대량 작업 이벤트](/webhook#bulk-job-events)를 참고합니다. |
| `filter`를 사용하는 `download`                        | `GET /v1/bulk/verifier/{id}/download?file=full`                                                                            |

```bash
curl -X POST "https://api.tomba.io/v1/bulk/verifier" \
  -H "X-Tomba-Key: $TOMBA_API_KEY" \
  -H "X-Tomba-Secret: $TOMBA_SECRET_KEY" \
  -F "name=Newsletter list" \
  -F "file=@emails.csv;type=text/csv" \
  -F "email_field_index=0"
```

Tomba는 파일의 첫 번째 행을 헤더로 처리합니다. 실행, 진행 상황, 다운로드 요청은 [수명 주기](/bulks#lifecycle)에 나와 있습니다. 행 한도와 일일 작업 한도는 [한도](/bulks#limits)에 있으며, 작업 비용은 결과를 처음 다운로드할 때 청구됩니다. [청구](/bulks#billing)를 참고합니다.

## 코드 예제

이 함수는 `/api/v3/` 호출을 대체하며, 주소에 대한 MillionVerifier의 `result`와 `resultcode`를 반환합니다. Node.js 18 이상이 필요합니다.

```js title="verify.mjs"
const TOMBA_HEADERS = {
    "X-Tomba-Key": process.env.TOMBA_API_KEY,
    "X-Tomba-Secret": process.env.TOMBA_SECRET_KEY,
};

// Tomba status -> MillionVerifier [result, resultcode]
const RESULTS = {
    valid: ["ok", 1],
    accept_all: ["catch_all", 2],
    unknown: ["unknown", 3],
    disposable: ["disposable", 5],
    invalid: ["invalid", 6],
};

async function verify(email) {
    const url = new URL("https://api.tomba.io/v1/email-verifier");
    url.searchParams.set("email", email);
    const res = await fetch(url, { headers: TOMBA_HEADERS });
    const body = await res.json();
    if (body.errors) {
        // Unlike MillionVerifier, errors use HTTP status codes, such as 402 or 429.
        throw new Error(
            `${res.status} ${body.errors.type}: ${body.errors.message}`,
        );
    }

    const check = body.data.email;
    const [result, resultcode] =
        RESULTS[check.status.toLowerCase()] ?? RESULTS.unknown;
    return {
        email: check.email || email,
        result,
        resultcode,
        free: check.webmail,
    };
}

console.log(await verify("jane.doe@stripe.com"));
```

## 전환 체크리스트

1. Tomba 키와 시크릿 키를 `TOMBA_API_KEY`와 `TOMBA_SECRET_KEY`로 저장하고, `X-Tomba-Key`와 `X-Tomba-Secret`으로 보내며, URL과 로그에서 `api` 및 `key` 매개변수를 제거합니다.
2. 단일 검증은 `GET https://api.tomba.io/v1/email-verifier`로 보내고, `timeout`을 제거하며, 클라이언트 타임아웃을 180초 이상으로 설정합니다.
3. `result: "error"` 확인을 HTTP 상태 코드 처리로 바꿉니다. `402`, `422`, `Retry-After`를 따르는 `429`, `408`, `451`을 처리합니다.
4. `result`와 `resultcode`는 [상태 매핑](#status-mapping)에 따라 변환하되, `status`는 대소문자를 구분하지 않고 비교합니다.
5. 파일 업로드를 `verifier` 대량 작업으로 바꿉니다. 생성하고, 실행하고, `file_ready` 웹훅 대신 `webhook_url` 이벤트를 받은 뒤 CSV를 다운로드합니다.
6. 프로덕션 트래픽을 전환하기 전에 같은 샘플 목록을 두 서비스로 검증하고 매핑된 결과를 비교합니다.
