Skip to main content

checkthatphone

PyPI version CI python >= 3.9

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["dipCarrierType"])  # "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.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 checkthatphone 0.2.1
File Size Uploaded Provenance Actions
checkthatphone-0.2.1.tar.gz 7.6 kB With provenance Details for checkthatphone-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for checkthatphone 0.2.1
File Interpreter ABI Platform Actions
checkthatphone-0.2.1-py3-none-any.whl Python 3 none any Details for checkthatphone-0.2.1-py3-none-any.whl

Total release size: 13.5 kB

Release files / checkthatphone-0.2.1.tar.gz

Download URL checkthatphone-0.2.1.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7ecd2c72f718fc2b1c6b4b70345dc01f9564a8e05e4fcba4e3289db04273b69a
BLAKE2b-256 checksum
How to use checksums
3b8ee86e707663a613e954b58a89d5e3bda22a70549e441af1bdba0be90a65b3
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 22, 2026.

Transparency log

Release files / checkthatphone-0.2.1-py3-none-any.whl

Download URL checkthatphone-0.2.1-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a86ba5ac84e7f1bcf663eb37013e4587eb3464af6d014eca5879ac819129167
BLAKE2b-256 checksum
How to use checksums
fe7ac9d89f28dd6d2319f43d212a28892daa0bc2b29f70b36e2662c99847f320
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 22, 2026.

Transparency log

Security for checkthatphone 0.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 checkthatphone-0.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 22, 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.

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