Skip to main content

numberotp (Python)

The official Python client for the NumberOTP API: real phone numbers for SMS / OTP verification. It has sync and async clients, is fully typed, and supports Python 3.9+.

pip install numberotp

Get an API key at numberotp.com/dashboard/developer and set it as NOTP_API_KEY. Guides: numberotp.com/docs/sdks.

from numberotp import NumberOTP

client = NumberOTP()  # reads NOTP_API_KEY

act = client.activations.create_and_wait(
    service="wa", country="16",
    on_number=lambda n: print("Use this number:", n["phoneNumber"]),
)
print("Code:", act["otp"])

Async

from numberotp import AsyncNumberOTP

async with AsyncNumberOTP() as client:
    n = await client.activations.create(service="tg", country="187")
    act = await client.activations.wait_for_code(n["data"]["id"], timeout=600)

More

client.services.search(q="discord.com")
client.prices.get(service="wa")
client.activations.resend(id) / finish(id) / cancel(id)   # cancel → full refund
for event in client.events.stream():                      # live events, reconnects by itself
    ...
from numberotp import verify_webhook                      # check x-numberotp-signature
client.auth.device_login(lambda c: print(c["user_code"]))  # sign a user in (CLI-style)

Errors and reliability

  • Errors carry .status and a stable .code: InsufficientBalanceError, NotFoundError, ConflictError, ActivationClosedError, WaitTimeoutError and others.
  • Purchases send an Idempotency-Key, so retries never buy twice.
  • Expired access tokens refresh automatically.

Metadata

Release files for numberotp 0.1.0

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

Source distribution (sdist)

Source distribution for numberotp 0.1.0
File Size Uploaded
numberotp-0.1.0.tar.gz 20.6 kB Details

Built distribution (wheel)

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

Total release size: 41.9 kB

Release files / numberotp-0.1.0.tar.gz

Download URL numberotp-0.1.0.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
109c28fde0a380150328c4a4b3822bc1a466116ec19777205e5973dd6680cf63
BLAKE2b-256 checksum
How to use checksums
a2f30d2d2e398e3cde3f31427894b361e2b764ef5dea0858ef4b7ac9e89731d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / numberotp-0.1.0-py3-none-any.whl

Download URL numberotp-0.1.0-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1df0a96462b4b0e1c1fb0dee9dae300b4f906453b27ed6ae9b7de5374e83c733
BLAKE2b-256 checksum
How to use checksums
787dd0034a9f565ab976bd69441538652e0fdbd29b6a1ad008575327a7312a28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

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