Skip to main content

Python SDK

neivi-iqx-lookup — Python 3.9+ client for the IQX Lookup API using urllib (zero dependencies).

Installation

pip install neivi-iqx-lookup

Quick Start

from iqx_lookup import IqxLookup

client = IqxLookup(api_key="ALk-your-api-key")

# Validate an email
email = client.validate_email("user@example.com")
print(f"Valid format: {email.valid_format}")
print(f"Disposable: {email.disposable_email}")

# Validate a phone number
phone = client.validate_phone("+34912345678", country_code="ES")
print(f"Valid: {phone.valid}")
print(f"Carrier: {phone.carrier}")

# Geolocate an IP
ip = client.geolocate_ip("8.8.8.8")
print(f"Country: {ip.country_name}")

# Validate a VAT number
vat = client.validate_vat("ES", "B87387775")
print(f"Valid: {vat.valid}")

# Parse a user-agent string
ua = client.parse_user_agent("Mozilla/5.0...")
print(f"Browser: {ua.browser_family}")

Configuration

from iqx_lookup import IqxLookup, IqxLookupConfig

# Direct construction
client = IqxLookup(
api_key="ALk-your-api-key",
base_url="https://api.iqxlookup.neivi.es", # optional
timeout=15, # optional, seconds
)

# Or via config object
config = IqxLookupConfig(
api_key="ALk-your-api-key",
base_url="https://api.iqxlookup.neivi.es",
timeout=15,
)
client = IqxLookup(config=config)

API Reference

MethodReturnsDescription
validate_email(address)EmailValidationResultEmail format, MX, disposable, free provider checks
validate_phone(number, country_code=None)PhoneValidationResultPhone validation
geolocate_ip(ip=None)IpGeolocationIP geolocation + ASN (None = caller's IP)
validate_vat(country_code, number)VatValidationResultEU VIES VAT validation
parse_user_agent(ua=None)UserAgentResultUA parsing — browser, OS, device brand & model
validate_iban(iban)IbanValidationResultIBAN structure, checksum, bank info
validate_bic(bic)BicValidationResultBIC/SWIFT format, institution info
lookup_dns(domain, types=None)DnsLookupResultDNS records, SPF/DKIM/DMARC security
check_ssl(domain)SslCertificateResultSSL certificate, chain, grade
analyze_password(password)PasswordStrengthResultStrength score, crack time, breach check
validate_credit_card(number)CreditCardValidationResultLuhn check, card network, BIN lookup
last_rate_limit_info (property)RateLimitInfo | NoneRate limit from last response

All response types are Python dataclasses with full type hints.

Error Handling

from iqx_lookup.exceptions import (
RateLimitException,
UnauthorizedException,
IqxLookupException,
)

try:
result = client.validate_email("user@example.com")
except RateLimitException as e:
print(f"Retry after: {e.retry_after}s")
except UnauthorizedException:
print("Check your API key")
except IqxLookupException as e:
print(f"Error {e.status_code}: {e.error_message}")

Requirements

  • Python 3.9+
  • Zero external dependencies (uses urllib.request from stdlib)