checkthatphone
Official Python client for the CheckThatPhone phone validation API. Validate US and Canadian phone numbers in real time: carrier and line type from live carrier data, portability and deliverability, GeoIP and timezone, plus optional TCPA litigator screening and free state do-not-call and complainer scrubs — one call, one credit.
Zero dependencies (standard library only). Python 3.9+.
Install
pip install checkthatphone
Quick start
import os
from checkthatphone import CheckThatPhone
client = CheckThatPhone(api_key=os.environ["CHECKTHATPHONE_API_KEY"])
result = client.lookup("8182925409")
print(result.data["nanpType"]) # "mobile"
print(result.data["dipCarrier"]) # "AT&T"
print(result.data["deliverable"]) # "true"
print(result.credits_used) # 1
Get an API key at checkthatphone.com — the free tier includes 500 lookups per month.
TCPA litigator screening
Flag known serial TCPA plaintiffs before you call or text (+1 credit):
result = client.lookup("8182925409", litigator_filter=True)
if result.data.get("litigator") == "true":
# result.data["litigator_type"]: "litigator" | "plaintiff" | "agitator"
suppress(result.data["subscriber"])
State DNC and complainer scrub (free)
Screen state do-not-call registries (38 states plus DC) and a national complainer list at no extra credit. Each check is its own flag:
result = client.lookup("8182925409", dnc_state=True, dnc_complainer=True)
result.data.get("dncStateChecked") # "true" when the state check ran; absent for the 12 states with no registry data
result.data.get("dncStateResult") # "STATE DNC" on a match, "" otherwise (only when dncStateChecked is "true")
result.data.get("dncComplainerChecked") # "true" when the complainer check ran
result.data.get("dncComplainerResult") # "DNC COMPLAINER" on a match, "" otherwise
Read dncStateChecked before dncStateResult: a number in an uncovered state comes back with neither field, which means not checked, not clear. "error" means the check could not complete; treat it as unavailable.
dnc_other=True still works as a shorthand for both checks, but it is deprecated.
Landline SMS reachability
Some landlines can receive texts. Detect them instead of dropping them (+1 credit, charged only when the number is a landline):
result = client.lookup("5551234567", landline_sms_lookup=True)
if result.data.get("dipMessagingEnabled") == "true":
send_sms(...)
GeoIP and timezone
Pass the contact's IP for city-level location and the IANA timezone (no extra charge) — useful for TCPA calling-hours compliance:
result = client.lookup("8182925409", ip="136.38.145.14")
result.data["timezone"] # "America/Los_Angeles"
Errors
Non-2xx responses raise CheckThatPhoneError with status, code, detail, and a retryable hint. Failed and invalid requests are billed 0 credits.
from checkthatphone import CheckThatPhoneError
try:
client.lookup("not-a-number")
except CheckThatPhoneError as err:
if err.retryable:
retry_later()
Full field reference
Every response field (carrier DIP, portability/LRN, deactivation, blacklist, and more) is documented at checkthatphone.com/docs.
License
MIT
Metadata
Release files for checkthatphone 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| checkthatphone-0.2.0.tar.gz | 7.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| checkthatphone-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.9 kB
Release files / checkthatphone-0.2.0.tar.gz
| Download URL | checkthatphone-0.2.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3bbda9dcf94824f01ed73cfd4c4b4161b0a0077118da0394acb65c0b2a26c230
|
|
BLAKE2b-256 checksum How to use checksums |
5f2b9c3f4206913715bc21ba1f035260372b0c5d95336d1dc8dc7836ed2b41e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / checkthatphone-0.2.0-py3-none-any.whl
| Download URL | checkthatphone-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
63007fbd0fb4d8ede8015c7ff97b673034a388854f4fc31a8e19e63e28d3cb0b
|
|
BLAKE2b-256 checksum How to use checksums |
b165af79e850642a8a0832136b2d2127e9e0f8b13a34f1a40d9848a0f29bf920
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency log