PHPackages                             nullform/zerobounce-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. nullform/zerobounce-client

ActiveLibrary[API Development](/categories/api)

nullform/zerobounce-client
==========================

ZeroBounce API client

v0.1.3(6y ago)21411MITPHPPHP &gt;=7.2

Since Dec 13Pushed 6y ago1 watchersCompare

[ Source](https://github.com/nullform/zerobounce-client)[ Packagist](https://packagist.org/packages/nullform/zerobounce-client)[ Docs](https://github.com/nullform/zerobounce-client)[ RSS](/packages/nullform-zerobounce-client/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (4)Used By (0)

ZeroBounce API client
=====================

[](#zerobounce-api-client)

Non official PHP client for [ZeroBounce API](https://www.zerobounce.net/docs/email-validation-api-quickstart/).

Installation
------------

[](#installation)

```
composer require nullform/zerobounce-client

```

Usage
-----

[](#usage)

### Basic

[](#basic)

```
use Nullform\ZeroBounce;

$client = new ZeroBounce\Client($api_key);

try {
    $result = $client->validate($email);
} catch (ZeroBounce\Exceptions\AbstractException $exception) {
    echo $exception->getMessage();
}
```

### Caching

[](#caching)

You can cache API responses if you use PSR-6 or PSR-16 caching in your project. Just pass to `Client::caching()` your cache repository instance, TTL and prefix.

If the cache instance is passed, each successful response will be stored to the cache for the `$ttl` seconds. With repeated requests with the same parameters, the response will be taken from the cache.

```
// Set PSR-6 or PSR-16 cache instance, TTL (60) and cache keys prefix (zerobounce_)
$client->caching($cache, 60, 'zerobounce_');
```

### Logging

[](#logging)

You can log your API calls by passing your own function to `Client::logFunction()`. Passed function will be called on every API call. The function takes an instance of `\Nullform\ZeroBounce\Client` as a parameter. For example:

```
$log_func = function (ZeroBounce\Client $client) {
    file_put_contents('zerobounce-client.log', print_r($client->lastResponse(), true));
};

$client = new ZeroBounce\Client($api_key);
$client->logFunction($log_func);

$usage = $client->getUsage('2019-01-01');
```

Or you can just override the `Client::log()` method that is called on every API call.

Methods
-------

[](#methods)

### Client::timeout()

[](#clienttimeout)

`Client::timeout( [ int $timeout = null ] ) : int`

Timeout (maximum time the request is allowed to take). Get or set value.

### Client::caching()

[](#clientcaching)

`Client::caching( $cache, int $ttl [, string $prefix = '' ] ) : bool`

Caching of API responses.

You can pass `null` to disable caching (default).

### Client::logFunction()

[](#clientlogfunction)

`Client::logFunction( ?callable $func ) : bool`

The function for logging that will be called after every ZeroBounce API call.

The function takes a client instance as a parameter.

### Client::lastRequest()

[](#clientlastrequest)

`Client::lastRequest( void ) : Http\Request`

Get last request.

### Client::lastResponse()

[](#clientlastresponse)

`Client::lastResponse( void ) : Http\Response`

Get last response.

### Client::getCredits()

[](#clientgetcredits)

`Client::getCredits( void ) : int`

Get credit balance. If a -1 is returned, that means your API Key is invalid.

[Validation API: Credit Balance](https://www.zerobounce.net/docs/email-validation-api-quickstart/v2-credit-balance/)

### Client::validate()

[](#clientvalidate)

`Client::validate( string $email [, ?string $ip_address = null ] ) : Models\Email`

Validate email.

[Validation API: Validate Emails](https://www.zerobounce.net/docs/email-validation-api-quickstart/v2-validate-emails/)

### Client::getUsage()

[](#clientgetusage)

`Client::getUsage( mixed $start_date [, mixed $end_date = 'now' ] ) : Models\Usage`

Get API usage.

`$start_date` and `$end_date` - timestamp or string that the strtotime(), DateTime and date\_create() parser understands.

[Validation API: API Usage](https://www.zerobounce.net/docs/email-validation-api-quickstart/v2-get-api-usage/)

### Client::bulkSendFile()

[](#clientbulksendfile)

`Client::bulkSendFile( string $filename, string $type, Params\BulkSendFileParams $params ) : Models\BulkFile`

Send a csv or txt file for bulk email validation/scoring.

```
$client = new Client($api_key);
$client->timeout(60);
$params = new Params\BulkSendFileParams();
$params->email_address_column = 2;
$file = $client->bulkSendFile($filename, Models\BulkFile::TYPE_VALIDATION, $params);
```

[Validation API: Send File](https://www.zerobounce.net/docs/email-validation-api-quickstart/v2-send-file/)| [AI Scoring API: Send File](https://www.zerobounce.net/docs/ai-scoring-api/send-file/)

### Client::bulkFileStatus()

[](#clientbulkfilestatus)

`Client::bulkFileStatus( string $file_id, string $type ) : Models\BulkFile`

Uploaded file status.

[Validation API: File Status](https://www.zerobounce.net/docs/email-validation-api-quickstart/v2-file-status/)| [AI Scoring API: File Status](https://www.zerobounce.net/docs/ai-scoring-api/file-status/)

### Client::bulkGetFile()

[](#clientbulkgetfile)

`Client::bulkGetFile( string $file_id, string $type [, ?string $output_filename = null ] ) : string`

Get the validation/scoring results csv (or zip) file for the file been submitted using sendfile API.

[Validation API: Get File](https://www.zerobounce.net/docs/email-validation-api-quickstart/v2-get-file/)| [AI Scoring API: Get File](https://www.zerobounce.net/docs/ai-scoring-api/get-file/)

### Client::bulkDeleteFile()

[](#clientbulkdeletefile)

`Client::bulkDeleteFile( string $file_id, string $type ) : bool`

Delete the file that was submitted using sendfile API. File can be deleted only when its status is Complete.

[Validation API: Delete File](https://www.zerobounce.net/docs/email-validation-api-quickstart/v2-delete-file/)| [AI Scoring API: Delete File](https://www.zerobounce.net/docs/ai-scoring-api/delete-file/)

Facade
------

[](#facade)

You can use facade for quick email validation and balance check.

```
use Nullform\ZeroBounce\Facade as ZeroBounce;

try {
    $result = ZeroBounce::validate($api_key, $email);
    $credits = ZeroBounce::getCredits($api_key);
} catch (\Exception $exception) {
    $error = $exception->getMessage();
}
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

3

Last Release

2380d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/04a9894c87cf7ea2b58fc41be2ebbb1a999e1906d209e146b0fc2fd9dd9b7b2e?d=identicon)[nullform](/maintainers/nullform)

---

Top Contributors

[![nullform](https://avatars.githubusercontent.com/u/4964609?v=4)](https://github.com/nullform "nullform (5 commits)")

---

Tags

apiclientzerobounce

### Embed Badge

![Health badge](/badges/nullform-zerobounce-client/health.svg)

```
[![Health](https://phpackages.com/badges/nullform-zerobounce-client/health.svg)](https://phpackages.com/packages/nullform-zerobounce-client)
```

###  Alternatives

[algolia/algoliasearch-client-php

API powering the features of Algolia.

69735.1M159](/packages/algolia-algoliasearch-client-php)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M339](/packages/api-platform-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[php-tmdb/api

PHP wrapper for TMDB (TheMovieDatabase) API v3. Supports two types of approaches, one modelled with repositories, models and factories. And the other by simple array access to RAW data from The Movie Database.

435383.9k17](/packages/php-tmdb-api)[api-platform/metadata

API Resource-oriented metadata attributes and factories

275.0M219](/packages/api-platform-metadata)[wtfzdotnet/php-tmdb-api

PHP wrapper for TMDB (TheMovieDatabase) API v3. Supports two types of approaches, one modelled with repositories, models and factories. And the other by simple array access to RAW data from The Movie Database.

4262.9k](/packages/wtfzdotnet-php-tmdb-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
