Bulk-Verify WhatsApp Numbers: Ten per Request, Resume a CSV

Published August 23, 2026 · UpdatedOctober 16, 2026

A twelve-row export is already a bulk job, and it is already a way to burn credits. Three cells are the same US number written as digits, as +1 with spaces, and as a copy-paste from a CRM. One UK number sits two columns over. Two rows are blank. One says N/A. Loop check-exist-by-phone once per cell and you pay twelve times, three of them for the same person, with nothing on disk you can resume. Paste all twelve into accounts and batch-check-10 will not take them. Ten numbers is the unit of work: one GET, a comma-separated list, at most ten full international numbers.

This page is that unit applied to a CSV you can kill and start again. It is not the three-state isExist walkthrough — that lives in how to check if a number is on WhatsApp. It is not the enrich-versus-check budget — that is the WhatsApp number lookup guide. Opening this page or copying a snippet does not send a lookup. Running the script does, and it spends credits.

Sign in, copy an authorized platform key from the dashboard, and read it as OPENDATA_API_KEY on the machine that opens the CSV. Examples that show YOUR_API_KEY are placeholders. The key rides in the query string, so those URLs do not belong in tickets, screenshots, git, or a column in the sheet.

Ten is the unit of work

batch-check-10 answers a file, not a sign-up form. Pass accounts as a comma-separated list of full international numbers. One to ten is valid. Eleven is not a bigger batch; it is a bad request. A leftover chunk of three at the end of a CSV is a real request — do not pad it with seven dummy rows so the list “looks full.” Dummy rows become fake misses, and the next resume will treat those inventions as work already done.

Each delivered row reports exist (on WhatsApp or not) and isBusiness. isBusiness is a segmentation hint you can store beside the verdict. It is not the registration answer. A personal account with isBusiness false is still on WhatsApp. The field is also not isExist and it does not mint a userHash. If you came here hoping the batch would hand you a 24-hour ticket for avatar or About, stop and use the lookup guide after a real hit.

Status is two layers, then a list. HTTP 4xx/5xx — missing key, unauthorized key, quota, transport — means the request did not run. There is no WhatsApp verdict in that response; fix the credential or the network, and do not write ten false values. The gateway envelope is {code, message, data}. code other than 200 is the same rule: no per-number answer. HTTP 2xx with gateway code 200 means the batch was delivered. Only then read each row’s exist. A short result list, a row with no exist, or a group that exhausted retries is undetermined for those inputs. Retry the group. Do not invent a miss so the CSV looks complete.

The numbers below are documented shapes, not guaranteed registrations. A GET that you actually run spends credits:

# Documented request shape only — running it spends credits.
# GET https://api.opendata-api.com/api/project/whatsapp/batch-check-10
#   key=YOUR_API_KEY
#   accounts=15551234567,15557654321,442071234567

A live form has one number and a person waiting. Use check-exist-by-phone or check-active there. Holding the request until nine more numbers arrive is not a bulk optimization; it is latency you paid for nothing.

Chunk, write, resume

Read the CSV, drop junk, collapse duplicates, then walk the remainder in groups of ten. After every successful group, append one JSON line that stores the requested numbers next to the raw payload, and flush(). If the process dies, at most one in-flight batch is unpaid-for-on-disk. The next run loads those requested lists and does not send them again.

Keep the raw payload. Flattening exist / isBusiness is a second pass once you have inspected a real body. Index alignment is not a contract you should assume from an article, and a parser that invents a miss for a number the server never returned will resume as if that number were finished.

import csv
import json
import os
import time
from datetime import datetime, timezone

import requests

URL = "https://api.opendata-api.com/api/project/whatsapp/batch-check-10"
KEY = os.environ["OPENDATA_API_KEY"].strip()
IN_CSV = "numbers.csv"
OUT = "whatsapp_results.jsonl"


def canonical(raw):
    text = raw.strip()
    digits = "".join(ch for ch in text if ch.isdigit())
    if text.startswith("00") and len(digits) > 8:
        digits = digits.lstrip("0")
    return digits


def load_input(path):
    phones = []
    with open(path, newline="") as fh:
        sample = fh.read(2048)
        fh.seek(0)
        has_header = False
        if sample:
            has_header = csv.Sniffer().has_header(sample)
        reader = csv.reader(fh)
        if has_header:
            next(reader, None)
        for row in reader:
            if not row:
                continue
            raw = (row[0] or "").strip()
            if not raw or raw.lower() in {"n/a", "na", "none", "null"}:
                continue
            phone = canonical(raw)
            if len(phone) < 8:
                continue
            phones.append(phone)
    seen = set()
    unique = []
    for phone in phones:
        if phone in seen:
            continue
        seen.add(phone)
        unique.append(phone)
    return unique


def load_done(path):
    done = set()
    if not os.path.exists(path):
        return done
    with open(path) as fh:
        for line in fh:
            line = line.strip()
            if not line:
                continue
            done.update(json.loads(line)["requested"])
    return done


def unwrap(body):
    # Replies wrap as {code, data}; the platform may wrap once more.
    while isinstance(body, dict) and "code" in body and isinstance(
        body.get("data"), (dict, list)
    ):
        if str(body.get("code")) != "200":
            raise RuntimeError(body.get("message") or "gateway code not 200")
        body = body["data"]
    return body


def check_batch(batch, attempts=4):
    for attempt in range(attempts):
        try:
            resp = requests.get(
                URL,
                params={"key": KEY, "accounts": ",".join(batch)},
                timeout=60,
            )
            if not 200 <= resp.status_code < 300:
                # HTTP layer: key, quota, or transport — not a WhatsApp verdict.
                time.sleep(2 ** attempt)
                continue
            return unwrap(resp.json())
        except (requests.RequestException, ValueError, RuntimeError):
            time.sleep(2 ** attempt)
    return None


def chunks(items, size=10):
    for i in range(0, len(items), size):
        yield items[i : i + size]


def run():
    unique = load_input(IN_CSV)
    done = load_done(OUT)
    todo = [n for n in unique if n not in done]
    failed = []
    with open(OUT, "a") as out:
        for batch in chunks(todo):
            result = check_batch(batch)
            if result is None:
                failed.extend(batch)
                continue
            out.write(
                json.dumps(
                    {
                        "requested": batch,
                        "result": result,
                        "checked_at": datetime.now(timezone.utc).isoformat(),
                    }
                )
                + "\n"
            )
            out.flush()
    return {
        "input_unique": len(unique),
        "already_done": len(unique) - len(todo),
        "failed": failed,
    }


if __name__ == "__main__":
    print(run())

Failures stay in the returned list. They are not written, so a re-run sends only those numbers plus anything the CSV gained since last time. HTTP 401/403 is a key problem; sleeping will not mint an authorized credential. Export OPENDATA_API_KEY on the server, install requests, point IN_CSV at the sheet, and run it there — not in a browser.

Credits you spend on duplicates

The expensive row is the one you already knew. On that twelve-row sheet, punctuation does not make a new person. Canonical digits collapse the three US spellings into one request slot. Blank and N/A never become accounts values. What you send is the unique, plausible remainder, chunked by ten — not the raw cell count.

Each call to batch-check-10 spends credits for the request, including a last chunk of two and including a retry of a group that never landed on disk. Pricing is the live rate; the budget mistake is how many times you send the same number. Two copies in two groups are two spends. Deleting whatsapp_results.jsonl and starting “clean” is paying the whole CSV again. Starting a Monday campaign by re-checking last month’s file, ignoring checked_at, is the same spend with a calendar excuse.

Looping check-exist-by-phone down a file is a different bill: one number per request, no resume file unless you build one, and a round-trip count that grows with every duplicate you failed to drop. Use the single check when the unit really is one number. Use this batch when the unit is a slice of a CSV.

Do not “make the credits worth it” by enriching every exist=true row from this script. batch-check-10 does not issue userHash. Avatar, About, presence and a full business card are later hops on a hit, and most lists are majority misses. That gate is the lookup article. Here the cheap screen is the product: exist, isBusiness, a timestamp, a file you can resume.

A group that keeps failing is also a credit leak if you mark it unregistered and then refresh it every night “to be sure.” Leave it failed. The script will ask again. A delivered exist you already stored does not need a nightly replay until your own schedule says the list has aged.

What bulk still cannot decide

Ten-at-a-time will not tell you that you may message the number. Registration is not consent. It will not mint userHash, fetch a photo, or read last seen. It will not turn HTTP 200 into ten yeses, and it will not turn a missing row into a no. exist is not isExist; if you need the three-state single-number record, leave this file-shaped job.

It will not replace a sign-up check. A form that waits for nine other numbers is not bulk verification. It will not classify junk you should have dropped before accounts — a short digit string still costs a slot in the ten. It will not remember work you did not write to disk. And copying the documented accounts=15551234567,15557654321,442071234567 line is not a live result; only a run against an authorized key is.

Stay on this page while the job is a CSV, a chunk of ten, a flushed line, and a reason not to pay for the same digits twice. Try the operation on WhatsApp Number Validation or read the batch-check-10 reference when you want the parameter list without the resume logic.