Registry / communication / zerobouncesdk

zerobouncesdk

JSON →
library2.2.2pypypi✓ verified 84d ago

The `zerobouncesdk` is a Python library that provides an easy-to-use interface for interacting with the ZeroBounce email verification API. It allows developers to validate email addresses, check API usage, retrieve credit balance, and perform bulk email validation. The current version is 2.2.0, and it features a regular release cadence with frequent updates and occasional major versions that introduce new features and improvements.

pip install zerobouncesdk
INSTALL
IMPORT
SIG · ZEROBOUNCESDK
Z
zerobouncesdk
communicationpythonv2.2.2
Install
2.3s avg
Import
649ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.2.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
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.544s · 21.4MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.3s · import 0.494s · 22MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ZeroBounce
from zerobouncesdk import ZeroBounce
ZBApiUrl
from zerobouncesdk import ZBApiUrl
Used for specifying different ZeroBounce API regions (e.g., USA, EU).
ZBException
from zerobouncesdk import ZBException
Base exception class for ZeroBounce API errors.

This quickstart demonstrates how to initialize the ZeroBounce SDK with your API key, check your remaining credits, and perform a single email validation. It uses environment variables for secure API key handling and includes basic error checking.

import os from zerobouncesdk import ZeroBounce, ZBException API_KEY = os.environ.get('ZEROBOUNCE_API_KEY', 'YOUR_API_KEY') if API_KEY == 'YOUR_API_KEY': print("Please set the ZEROBOUNCE_API_KEY environment variable or replace 'YOUR_API_KEY'.") else: try: zero_bounce = ZeroBounce(API_KEY) # Get credit balance response = zero_bounce.get_credits() if response.get('success'): print(f"Remaining Credits: {response.get('credits')}") else: print(f"Error getting credits: {response.get('message')}") if response.get('errors'): for error in response.get('errors'): print(f" - {error.get('field')}: {error.get('message')}") # Example: Validate a single email (replace with a real email for testing) email_to_validate = 'test@example.com' ip_address = '127.0.0.1' validation_response = zero_bounce.validate(email_to_validate, ip_address) if validation_response.get('success'): print(f"Validation for {email_to_validate}: Status = {validation_response.get('status')}, Sub Status = {validation_response.get('sub_status')}") else: print(f"Error validating {email_to_validate}: {validation_response.get('message')}") except ZBException as e: print(f"An SDK exception occurred: {e}") except Exception as e: print(f"An unexpected error occurred: {e}")
Debug
Known issues
breakingUpgrading from `zerobouncesdk` v1.x to v2.x introduces breaking changes. While an explicit migration guide for the Python SDK isn't extensively documented, major version bumps often imply changes to method signatures, response object structures, or added mandatory parameters, as seen with new status fields and updated domain finding capabilities in v2.0.0.
fix
Review the official ZeroBounce API documentation and the SDK's changelog for `v2.0.0` to identify specific changes. Test your integration thoroughly after upgrading to ensure compatibility with new API responses and method behaviors.
affects: >=2.0.0
gotchaDirectly embedding your ZeroBounce API key in your code is a security risk. It can lead to unauthorized access to your account and API usage.
fix
Always store your API key securely, preferably using environment variables (e.g., `os.environ.get('ZEROBOUNCE_API_KEY')`), or a secure configuration management system. Avoid hardcoding credentials.
affects: All
gotchaThe ZeroBounce API has rate limits. Making too many requests in a short period without proper handling can lead to `ZBException` or API-level errors.
fix
Implement robust error handling, including `try-except ZBException` blocks, and check the `success` field and `message` or `errors` fields in API responses. Consider implementing rate limiting or exponential backoff for bulk operations.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'zerobouncesdk'
The `zerobouncesdk` package is not installed in your Python environment.
fix
Run `pip install zerobouncesdk` to install the library.
ZeroBounce get_credits response: {'success': False, 'message': 'Invalid API Key'}
The API key provided to the `ZeroBounce` constructor is incorrect, expired, or revoked.
fix
Verify your ZeroBounce API key in your ZeroBounce account dashboard and ensure it is correctly passed to the `ZeroBounce` constructor. Check for typos or leading/trailing spaces.
Error getting credits: Missing key request attributes
While less common for `get_credits`, this general API error indicates a required parameter (e.g., `email` for validation) was omitted or malformed in the API call.
fix
Review the specific method's documentation (e.g., `validate(email, ip_address)`) to ensure all required arguments are provided and correctly formatted.
Upgrade
Version history
2.2.2latest on PyPI · released Jun 10, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
55 hits · last 30 days
node
48
OpenAI (training)
1
Resources
zerobouncesdk — pip install zerobouncesdk · libregistry