Skip to main content

Official Python SDK for the Verixo OTP-as-a-Service API

Project description

verixo

Official Python SDK for the Verixo OTP-as-a-Service API.

Install

pip install verixo

Quickstart

import os
import verixo

client = verixo.Client(os.environ["VC_API_KEY"])

result = client.numbers.search(
    service_slug="whatsapp",
    country_code="NG",
    min_score=80,
    limit=5,
)

session = client.numbers.purchase(
    service_slug="whatsapp",
    country_code="NG",
)

def handle(push):
    print(f"OTP: {push.otp} in {push.latency_ms}ms")

client.subscribe(session.session_token, handle)

Note: purchase() takes service_slug + country_code, not a specific number_id -- the server picks the best available number by Health Score at purchase time, since a candidate returned by search() may already be gone by the time you'd reference it back.

Polling instead of real-time push

subscribe() runs a background thread holding a persistent WebSocket connection, which isn't always practical (e.g. one-shot scripts, serverless functions). Use sessions.wait_for_otp() instead:

result = client.sessions.wait_for_otp(session.session_token)
if result.status == "DELIVERED":
    print(result.otp_code)

Errors

All non-2xx responses raise verixo.VerixoError with .status, and usually .code/.detail from the API's error body:

from verixo import VerixoError

try:
    client.numbers.purchase(service_slug="whatsapp", country_code="NG")
except VerixoError as err:
    if err.status == 402:
        print("Insufficient wallet balance")

Requirements

Python 3.8+.

Development

python -m venv .venv
.venv/Scripts/activate   # or `source .venv/bin/activate` on macOS/Linux
pip install -e .
python examples/quickstart.py   # requires VC_API_KEY env var, see file header

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

verixo-0.1.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

verixo-0.1.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file verixo-0.1.1.tar.gz.

File metadata

  • Download URL: verixo-0.1.1.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for verixo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 275616d38323b414c57032bb1ff35c0c86af5a93728e2c20d6597d3cdb41fff0
MD5 e3407908914eaeb648255d3e1cfc8b7e
BLAKE2b-256 36bca731a1ecdb169e36fe66a3f90774f4459fdb084609e8ca0c97ba6f28275b

See more details on using hashes here.

File details

Details for the file verixo-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: verixo-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for verixo-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5cfc35b545022a06784ea5cdebbe4f2e652e1ae69e1ea15fb7c5d87d1184613a
MD5 7d3998085daf8e0c3583f773fb0eea86
BLAKE2b-256 a11d3f5d1067782c6297c779a524d29199a95734c494351c377a3f2b973ffaf5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page