PHPackages                             classy-org/mailchimp-api-php-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. classy-org/mailchimp-api-php-client

ActiveLibrary

classy-org/mailchimp-api-php-client
===================================

Simple wrapper around Guzzle Http Client to interact with Mailchimp API v3.0

1.0.2(9y ago)428.7k1PHP

Since Oct 31Pushed 9y ago33 watchersCompare

[ Source](https://github.com/classy-org/mailchimp-api-php-client)[ Packagist](https://packagist.org/packages/classy-org/mailchimp-api-php-client)[ RSS](/packages/classy-org-mailchimp-api-php-client/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Mailchimp API php client
========================

[](#mailchimp-api-php-client)

Simple wrapper around Guzzle Http Client to interact with Mailchimp API v3.0

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

[](#installation)

The Mailchimp API php client can be installed with [Composer](https://getcomposer.org/):

```
composer require classy-org/mailchimp-api-php-client
```

Be sure you included composer autoloader in your app:

```
require_once '/path/to/your/project/vendor/autoload.php';
```

Usage
-----

[](#usage)

```
// Instantiate the client
$client = new \Classy\MailchimpClient('dc834647d7f8a38c86b25dd4fdeff6f7-us2'); // use your mailchimp API key here

// Fetches your mailchimp lists
$httpResponse = $client->get('/lists');
$lists = json_decode($httpResponse->getBody()->getContents());

// Or shorter:
$lists = $client->getData('/lists');
```

Exception handling
------------------

[](#exception-handling)

This client is using Guzzle Http client. Exceptions are thrown when the Http response is not a 200 (OK) one:

```
try {
    $response = $client->get('/lists/e87ab1c34');
} catch (Exception $e) {
    if ($e instanceof \GuzzleHttp\Exception\ConnectException) {
        // there was a networking error
    }

    if ($e instanceof \GuzzleHttp\Exception\ClientException) {
        // Mailchimp API returned a 4xx response.
        $httpStatusCode = $e->getCode();
        if ($httpStatusCode == 404) {
            // resource doesn't exist
        }
        if ($httpStatusCode == 401) {
            // you're unauthorized (api key must be invalid)
        }
        if ($httpStatusCode == 403) {
            // you're not allowed to request this endpoint
        }
        if ($httpStatusCode == 400) {
            // body payload is invalid
        }
        if (...) {
            //
        }

        $bodyResponse = $e->getResponse()->getBody()->getContents();
    }

    if ($e instanceof \GuzzleHttp\Exception\ServerException) {
        // Mailchimp returned a 5xx response, which means they experience technical difficulties.
    }
}
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

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 ~19 days

Total

3

Last Release

3446d ago

### Community

### Embed Badge

![Health badge](/badges/classy-org-mailchimp-api-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/classy-org-mailchimp-api-php-client/health.svg)](https://phpackages.com/packages/classy-org-mailchimp-api-php-client)
```

PHPackages © 2026

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