Skip to main content

whatsapp-data-sdk (Python)

PyPI version Python versions CI license: MIT website

Typed Python client for the WhatsApp Data API — official SDK for whatsapp.checkleaked.cc (also on RapidAPI). The Python port of whatsapp-data-sdk (npm), same endpoints and behavior.

WhatsApp profile lookups, phone breaches, carrier data, Telegram checks, OSINT, geo/business search, bulk verification — plus a cache-first lookup that reads the cheap DB endpoint before spending on a live check.

  • 🐍 Typed (TypedDict responses, py.typed), one dependency (requests).
  • 💸 Built-in cache-first strategy to minimize cost.
  • 🔁 Timeouts, retries with backoff (Retry-After aware), and a clean error taxonomy.

Install

pip install whatsapp-data-sdk

Quick start

from whatsapp_data_sdk import WhatsAppDataClient

client = WhatsAppDataClient(api_key="YOUR_KEY")  # sent as x-rapidapi-key

profile = client.get_profile("59898297150")
print(profile.get("exists"), profile.get("about"), profile.get("profilePic"))

Authentication & hosts

Your key is always sent in x-rapidapi-key. Choose where requests go with transport:

transport Live host Cache / DB-only host
"proxy" (default) whatsapp-proxy.checkleaked.cc same host, /number_cache path
"rapidapi" whatsapp-number-validator18.p.rapidapi.com wp-data-db-only.p.rapidapi.com
client = WhatsAppDataClient(api_key="RAPIDAPI_KEY", transport="rapidapi")

Override URLs/hosts via base_url, cache_base_url, rapidapi_host, rapidapi_cache_host.

RapidAPI live host = the "Whatsapp Number Validator" listing. The former wp-data.p.rapidapi.com listing was removed from RapidAPI in November 2026, and SDK versions before 1.2.1 still default to it. Since 2026-11-26 the validator listing returns the same records as a direct API key: display name, about, photos, business data, carrier, Telegram, Google, breaches and the linkedin flag, with bulk checks and searches. Still refused there: search_facebook_leak, search_linkedin, get_leaked_numbers_info and download_entire_database. The gemini_face_analysis, reverse_image_search and full_ai_report options are ignored. Use the default proxy transport with a direct API key for those.

💸 Cache-first lookups (save money)

check_cached() reads the cheap cache / DB-only endpoint first and only falls back to a paid live check on a true miss.

r1 = client.check_cached("59898297150")                  # cacheFirst (default)
print(r1["_source"])                                     # "cache" | "live"
r2 = client.check_cached("59898297150", mode="cacheOnly")  # never a live call
r3 = client.check_cached("59898297150", mode="live")       # always fresh

An authoritative cached "not on WhatsApp" record counts as a hit (no wasteful live re-check); only a true NOT_IN_DATABASE miss falls through to live.

API

Every method maps 1:1 to a marketplace endpoint.

# Profile & pictures
client.get_profile(number, telegram=True, include_carrier=True)  # Get Profile Information
client.get_profile(number, linkedin=True)                        # + LinkedIn profiles for the number (see below)
client.get_profile_no_picture(number)                            # (No profile pic)
pic = client.get_last_picture(number)                            # JPEG bytes -> pic.content, pic.to_data_uri()
client.get_device_count(number)                                  # Device count
client.get_osint_info(number)                                    # OSINT Info

# Breaches
client.get_phone_breaches(number, limit=50)                      # built-in (no external key)
client.get_phone_breaches_external(number, api_key="...")        # your checkleaked.cc key

# Search & database
client.search(country_code="UY", is_business=True, limit=20)     # Search
client.search(username="frog")                                   # by WhatsApp username (see below)
client.search_google_maps(latitude=-34.9, longitude=-56.16, radius=2000)  # Search in Google Maps
client.search_facebook_leak(q="jane doe", field="name")          # Facebook leak search (direct keys only, see below)
client.search_linkedin(q="data engineer", country="UY")          # LinkedIn search (direct keys only, see below)
client.get_leaked_numbers_info()                                 # Leaked Numbers (500M) -> Drive link (MEGA tier)
client.download_entire_database()                                # Download the Entire DB -> Drive link (MEGA tier)

# Bulk
client.bulk_check(numbers)                                       # live (max 50)
client.bulk_check_db_basic(numbers)                              # DB basic (max 1000)
client.bulk_check_db_full(numbers)                               # DB full (max 1000)

# Telegram / carrier
client.get_telegram_profile("59898297150")                      # experimental
client.get_telegram_profile(["num1", "num2"])
client.carrier_lookup(number)                                    # Carrier Lookup
client.carrier_lookup_alt(number, page=2)                        # Carrier Lookup Alternative

WhatsApp username

Profiles and search rows carry username (the WhatsApp @handle) where WhatsApp has rolled out usernames and the account set one — most records have none. search can filter on it:

# Handle or its leading part; case-insensitive, a leading "@" is ignored.
# Matches only the username, never a display name.
page = client.search(username="frog")
print([d.get("username") for d in page["data"]["docs"]])  # e.g. ["Frogdog_"]

# Only numbers that have a username (False = only numbers without one)
client.search(country_code="US", has_username=True)

search_facebook_leak() searches the 2019 Facebook leak by name, email, location, workplace or phone number. Each row is crossed with the WhatsApp cache by number (row["whatsapp"]: profile, username, business details, or status: "notOnWhatsapp") — a cache read only, never a live lookup.

res = client.search_facebook_leak(
    q="jane doe",       # <= 8 words, literal match; trailing * = prefix (3+ chars)
    field="name",       # "name" | "email" | "location" | "work"
    country_code="US",
    limit=25,           # 1-100; page * limit <= 10,000
)
for row in res["data"]["docs"]:
    wa = row.get("whatsapp", {})
    print(row["e164"], row.get("firstName"), row.get("lastName"), wa.get("status"), wa.get("username"))
print(res["data"]["totalDocs"], res["data"]["capped"])

# Exact number lookup (takes precedence over q); skip the WhatsApp cross-reference
client.search_facebook_leak(number="15551234567", whatsapp=False)

Other filters: gender ("male" | "female"), has_email, page. One credit per successful page.

  • Direct API keys only (default proxy transport). Not available on RapidAPI: with transport="rapidapi" it answers 403 (ENDPOINT_UNAVAILABLE) → AuthError.
  • Out-of-range values are refused with 400 (INVALID_PARAMETER, INVALID_NUMBER, INVALID_QUERY), not clamped → HttpError.
  • 429 RATE_LIMITED (30/min and 2,000/day per key) → RateLimitError with retry_after_ms.
  • 502 UPSTREAM_ERROR, 503 BUSY, 504 TOO_BROAD (add words, a field or country_code) → HttpError. 502 and 503 are retried per retries (a 503 after its Retry-After, at most 30 s); 504 TOO_BROAD is never retried: the same query would time out again.

The API's error code is in err.body["code"].

search_linkedin() searches the LinkedIn profile dataset by words, filters or phone number. Each profile carries details (emails, phones and other source columns) and, when it has a valid phone number, a whatsapp cross-reference: per number, the WhatsApp cache's record (profile, username, business details), status: "notOnWhatsapp" (checked, no account) or status: "absent" (never checked) — a cache read only, never a live lookup.

res = client.search_linkedin(
    q="data engineer",          # <= 8 words, matched literally
    country="UY",               # ISO 3166-1 alpha-2
    has=["phones", "emails"],   # only profiles with phones AND emails
    limit=25,                   # 1-100
)
for p in res["data"]["docs"]:
    print(p["fullName"], p["jobTitle"], p["company"], p.get("whatsapp", {}).get("onWhatsapp"))

# Cursor paging: send the previous nextCursor (None on the last page)
cursor = res["data"]["nextCursor"]
while cursor is not None:
    page = client.search_linkedin(q="data engineer", country="UY", cursor=cursor)
    cursor = page["data"]["nextCursor"]

# Look one phone number up (country code included; takes precedence over q and
# the filters; at most 10 profiles, no paging). Skip the WhatsApp cross-reference:
client.search_linkedin(number="+59899123456", whatsapp=False)

Other filters: industry, job_role, company_size, salary, company. res["data"]["totalDocs"] is the match count, a lower bound when capped is True (and None when the service gave none); indexComplete: False means the dataset is still being indexed and the newest profiles may be missing.

  • Direct API keys only (default proxy transport). Not available on RapidAPI: with transport="rapidapi" it answers 403 (ENDPOINT_UNAVAILABLE) → AuthError.
  • A q word with 7+ digits (or made only of digits and phone punctuation) is refused with 400 — look phone numbers up with number. Out-of-range values are refused too (INVALID_PARAMETER, INVALID_NUMBER, INVALID_QUERY), not clamped → HttpError.
  • 429 RATE_LIMITED (30/min and 2,000/day per key) → RateLimitError with retry_after_ms.
  • 502 UPSTREAM_ERROR, 503 BUSY/UNAVAILABLE, 504 TOO_BROAD (add words or filters) → HttpError. 502 and 503 are retried per retries (a 503 after its Retry-After, at most 30 s); 504 TOO_BROAD is never retried: the same query would time out again.

The API's error code is in err.body["code"].

LinkedIn on a profile lookup

get_profile() takes linkedin=True to add the LinkedIn profiles (at most 3) whose phone matches the number, under linkedin on the entry:

entry = client.get_profile("59898297150", linkedin=True)
li = entry.get("linkedin")
if li and li.get("success"):
    print(li["count"], [p["fullName"] for p in li["profiles"]])
elif li:
    print(li["error"])  # e.g. "No LinkedIn profile for this number" (success is None)

A miss, or an index that is unavailable, answers {"error": ..., "success": None}; the lookup itself never fails because of it. Available on the direct API (the default proxy transport) and the RapidAPI "Number Validator" (since 2026-11-26) and "WP Data DB Only" listings.

"Not found" resolves — it does not raise

A number not on WhatsApp is a normal result, so these resolve (never raise):

  • get_profile / get_profile_no_picture / check_cached → a dict with exists=False (and code="NUMBER_NOT_FOUND").
  • search with zero matches → an empty page (success=False, data["docs"] == []).
  • get_device_count for a non-WhatsApp number → success=False.

What does raise: invalid number (400), auth (401/403), rate limit (429), timeout, network, 5xx.

Per-request options

Every method accepts timeout (seconds) and retries. GETs retry 5xx, 429, timeouts and network errors with exponential backoff from retry_delay (client option, default 0.5 s); a 429 or 503 with Retry-After waits that long instead (at most 30 s), and a 504 TOO_BROAD is never retried. POSTs are not retried.

client.get_profile("59898297150", timeout=5, retries=0)

Errors

All failures raise a subclass of WhatsAppDataError:

Class When
ValidationError Bad arguments (raised before any request; no .status).
AuthError 401 / 403 — missing/invalid/unsubscribed key.
RateLimitError 429 — carries .retry_after_ms when the server sent Retry-After.
HttpError Any other non-2xx (e.g. 400, 5xx); has .status, .body, and .retry_after_ms on a 503 with Retry-After.
TimeoutError Request exceeded the timeout.
NetworkError Transport failure.
WhatsAppDataError Base class.
from whatsapp_data_sdk import AuthError, RateLimitError, WhatsAppDataError

try:
    client.get_profile("59898297150")
except AuthError:
    ...  # 401/403
except RateLimitError as e:
    print(e.retry_after_ms)
except WhatsAppDataError as e:
    print(e.status, e.body)

POSTs (bulk_check, bulk_check_db_*) are not auto-retried, to avoid double-spending quota.

Phone number formats

Any format works — the SDK normalizes; the helpers are exported:

from whatsapp_data_sdk import to_digits, to_e164
to_digits("+598 98 297 150")  # "59898297150"  (path & live endpoints)
to_e164("59898297150")        # "+59898297150" (bulk-DB endpoints require it)

Notes

Enrichments run entirely server-side — you never supply Gemini, LeakCheck, or any other keys. Face analysis, breach lookups, etc. are handled by the API. The only user-provided key is your own checkleaked.cc key for get_phone_breaches_external.

License

MIT © Eduardo Airaudo

Metadata

Release files for whatsapp-data-sdk 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whatsapp-data-sdk 1.2.1
File Size Uploaded Provenance Actions
whatsapp_data_sdk-1.2.1.tar.gz 22.9 kB With provenance Details for whatsapp_data_sdk-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for whatsapp-data-sdk 1.2.1
File Interpreter ABI Platform Actions
whatsapp_data_sdk-1.2.1-py3-none-any.whl Python 3 none any Details for whatsapp_data_sdk-1.2.1-py3-none-any.whl

Total release size: 48.1 kB

Release files / whatsapp_data_sdk-1.2.1.tar.gz

Download URL whatsapp_data_sdk-1.2.1.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
57dd1222a8279f5dee6e34845369e509a1bb5235e2f54b3883205f0ce84ef017
BLAKE2b-256 checksum
How to use checksums
73f75b8802968cc37de784ebac720f591d13d82a7a661c495f9c6ab8f59085b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / whatsapp_data_sdk-1.2.1-py3-none-any.whl

Download URL whatsapp_data_sdk-1.2.1-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c5c1ea51d2c80d7033fd79243bd4fa6a348b77e158f30fe3035cdbe1e46cc9d
BLAKE2b-256 checksum
How to use checksums
5fd0c7564849724a446fc61e2fb167ebb99aa858381561493ff540a359596742
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for whatsapp-data-sdk 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for whatsapp_data_sdk-1.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page