Phone Verification API

Quick Start: Python

There are three steps to integrating the Phone Verification API into your Python project.

1. Create an account.

Sign up for an Esendex account. When you register you will receive a license key. You will need this to use the API.

2. Install Python.

Install Python if it is not on your computer already. To check, run this command in your terminal: python --version

PS C:\> python --version
Python 3.11.0

Next, make sure you have pip (the Python package installer). This is usually included when you install Python, but you can install pip separately here. To check, run this command in your terminal: python -m pip --version

PS C:\> python -m pip --version
pip 22.3 from C:\Python311\Lib\site-packages\pip (python 3.11)

3. Verify a phone number.

Install Zeep, a SOAP client for Python. Run this command in your terminal: pip install zeep

Create a new Python file. Let’s call it demo.py.

You can use the CheckPhoneNumber method to verify a phone number. Add the displayed code to your new file.

Replace the license_key value with your account’s license key.

import zeep

client = zeep.Client(wsdl="https://ws.esendex.us/phoneverify/phoneverify.asmx?wsdl")
phone_number = "17575449510"
license_key = "00000000-0000-0000-0000-000000000000"
response = client.service.CheckPhoneNumber(phone_number, license_key)

print(response)

Run the project in your terminal with this command: python demo.py. The program will display the results of the phone number verification.

PS C:\PythonDemo> python demo.py
{
    'Company': 'LEVEL 3 COMMUNICATIONS, LLC - ',       
    'Valid': True,
    'Use': 'Assigned to a code holder for normal use.',
    'State': 'VA',
    'Switch': None,
    'RC': 'PARKSLEY',
    'OCN': '8825',
    'OriginalNumber': '17575449510',
    'CleanNumber': '7575449510',
    'SwitchName': 'NORFOLK',
    'SwitchType': None,
    'Country': 'United States',
    'CLLI': 'CHSKVAAYDS0',
    'PrefixType': 'CLEC - (Competitive Local Exchange Carrier)',
    'LATA': '252',
    'sms': 'CLEC - (Competitive Local Exchange Carrier)',
    'Email': None,
    'AssignDate': 'Unknown',
    'TelecomCity': 'Chesapeake',
    'TelecomCounty': None,
    'TelecomState': 'VA',
    'TelecomZip': '23324',
    'TimeZone': 'EST',
    'Lat': None,
    'Long': None,
    'Wireless': False,
    'LRN': '7576559199'
}

Let’s start sending, together.