Registry /
communication / vonage-network-number-verification
Install & Compatibility
Where this runs
tested against v1.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 48.1MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 4.8s · import 0.000s · 48MB
47MB installed
● package 47MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
NetworkNumberVerification
✓ from vonage_network_number_verification import NetworkNumberVerification
✗ from vonage_network_number_verification import Client
This quickstart demonstrates how to initialize the Vonage Network Number Verification client and make a request to verify a phone number. It requires your Vonage API Key and Secret, which are used to initialize the underlying `vonage.Client` instance. The response contains various network-level details about the number.
import os
from vonage import Client as VonageCoreClient
from vonage_network_number_verification import Client as NumberVerificationClient
from vonage_network_number_verification.models import VerifyNumberRequest
# Your Vonage API key and secret
VONAGE_API_KEY = os.environ.get("VONAGE_API_KEY", "YOUR_API_KEY")
VONAGE_API_SECRET = os.environ.get("VONAGE_API_SECRET", "YOUR_API_SECRET")
# Initialize the core Vonage client (required by the number verification client)
vonage_client = VonageCoreClient(key=VONAGE_API_KEY, secret=VONAGE_API_SECRET)
# Initialize the Network Number Verification client
nv_client = NumberVerificationClient(vonage_client=vonage_client)
# Define the request to verify a number
request_body = VerifyNumberRequest(
type="phone", # Required: 'phone'
number="447700900000" # Required: The phone number to verify
)
try:
# Make the API call
response = nv_client.post_verify_number(request_body)
# Print the raw response for inspection
print(f"\nNetwork Number Verification Response:\n{response.model_dump_json(indent=2)}")
# Access specific fields
if response.request_id:
print(f"\nRequest ID: {response.request_id}")
if response.port_id_check_status:
print(f"Port ID Check Status: {response.port_id_check_status}")
if response.reachability_status:
print(f"Reachability Status: {response.reachability_status}")
except Exception as e:
print(f"An error occurred: {e}")
Debug
Known issues
breakingThis package relies on `vonage >= 4.0.0, < 5.0.0`. If the main `vonage` SDK is updated to a `5.x.x` version (or newer major version), this package may become incompatible or break due to API changes in the underlying dependency.fixBefore upgrading the main `vonage` SDK to a new major version, check for a compatible `vonage-network-number-verification` release or consult the official documentation for compatibility notes.
affects: < 1.0.3 (potentially all current versions)
gotchaDo not confuse `vonage-network-number-verification` with `vonage-number-insight`. They are distinct Vonage APIs serving different purposes. Number Insight provides general information about a number (carrier, type, roaming status), while Network Number Verification provides network-level checks like number reachability and porting status.fixEnsure you are using the correct API for your specific use case. If you need general number data, use `vonage-number-insight`. For network status, use `vonage-network-number-verification`.
affects: All versions
gotchaThe `vonage-network-number-verification` client requires an initialized `vonage.Client` instance, which primarily uses API Key and Secret for authentication. This differs from some other Vonage APIs (e.g., Voice, Video) that frequently use JWT authentication.fixAlways initialize the core `vonage.Client` with `key` and `secret` parameters when creating an instance for `vonage-network-number-verification`. Ensure these credentials have the necessary permissions for the Number Verification Network API.
affects: All versions
Upgrade
Version history
1.0.2latest on PyPI · released Nov 29, 2024
Audit
Dependencies
vonagerequiredRequired for underlying API client functionality, authentication, and communication with Vonage APIs.