PHPackages                             sergey-demidov/mailerlite-api-v2-php-sdk - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. sergey-demidov/mailerlite-api-v2-php-sdk

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

sergey-demidov/mailerlite-api-v2-php-sdk
========================================

MailerLite API v2 PHP SDK

0.3.11(4y ago)0906↓18.8%MITPHPPHP ^7.1||^8.0

Since May 16Pushed 4y agoCompare

[ Source](https://github.com/sergey-demidov/mailerlite-api-v2-php-sdk)[ Packagist](https://packagist.org/packages/sergey-demidov/mailerlite-api-v2-php-sdk)[ Docs](https://github.com/mailerlite/mailerlite-api-v2-php-sdk)[ RSS](/packages/sergey-demidov-mailerlite-api-v2-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (21)Used By (0)

MailerLite API v2 PHP SDK
=========================

[](#mailerlite-api-v2-php-sdk)

### It is a fork of official PHP SDK for MailerLite API v2.

[](#it-is-a-fork-of-official-php-sdk-for-mailerlite-api-v2)

> Just added support for `PHP 8` to `composer.json`.

You can find more examples and information about MailerLite API v2 here:

Getting started
---------------

[](#getting-started)

In order to use this library you need to have at least PHP 7.1 version.

There are two ways to use MailerLite PHP SDK:

##### Use [Composer](https://getcomposer.org/)

[](#use-composer)

If you are not familiar with Composer, learn about it [here](https://getcomposer.org/doc/01-basic-usage.md).

Then you will need to run this simple command using CLI:

```
composer require mailerlite/mailerlite-api-v2-php-sdk

```

This library is built atop of [PSR-7](https://www.php-fig.org/psr/psr-7/) and [PSR-18](https://www.php-fig.org/psr/psr-18/). If you are receiving `Http\Discovery\Exception\DiscoveryFailedException` exception, you will need to run:

```
composer require php-http/guzzle6-adapter
```

##### Manual (preferable for shared hostings)

[](#manual-preferable-for-shared-hostings)

This way is preferable only if you are using shared hosting and do not have a possibility to use Composer. You will need to download [this archive](https://bit.ly/32jmi7M)(v0.2.3), extract it and place its contents in root folder of your project. The next step is the same as using Composer, you will need to require `vendor/autoload.php` file in your index.php and lets dive in!

Usage examples
--------------

[](#usage-examples)

#### Groups API

[](#groups-api)

In the given example you will see how to initiate selected API and a few actions which are available:

- Create group
- Get groups
- Update group
- Get subscribers who belongs to selected group

```
$groupsApi = (new \MailerLiteApi\MailerLite('your-api-key'))->groups();

$newGroup = $groupsApi->create(['name' => 'New group']); // creates group and returns it

$allGroups = $groupsApi->get(); // returns array of groups

$groupId = 123;
$singleGroup = $groupsApi->find($groupId); // returns single item object

$subscribers = $groupsApi->getSubscribers($groupId); // get subscribers who belongs to selected group

$subscribers = $groupsApi->getSubscribers($groupId, 'unsubscribed'); // get unsubscribed subscribers who belongs to selected group
```

#### Use multiple APIs at once

[](#use-multiple-apis-at-once)

Also `MailerLiteApi\\MailerLite' object can be initiated before selecting API you want to use and it allows to achieve more.

```
$mailerliteClient = new \MailerLiteApi\MailerLite('your-api-key');

$groupsApi = $mailerliteClient->groups();
$groups = $groupsApi->get(); // returns array of groups

$fieldsApi = $mailerliteClient->fields();
$fields = $fieldsApi->get(); // returns array of fields
```

Use your preferred HTTP client
------------------------------

[](#use-your-preferred-http-client)

MailerLite SDK uses cURL as default HTTP client but it is easy to use your preferred client. It is achieved by using [HTTPlug](https://httplug.io) which is PSR-7 compliant HTTP client abstraction.

Here is an example how to use [Guzzle](https://docs.guzzlephp.org/) instead of cURL:

```
$guzzle = new \GuzzleHttp\Client();
$guzzleClient = new \Http\Adapter\Guzzle6\Client($guzzle);

$mailerliteClient = new \MailerLiteApi\Mailerlite('your-api-key', $guzzleClient);
```

Support and Feedback
--------------------

[](#support-and-feedback)

In case you find any bugs, submit an issue directly here in GitHub.

You are welcome to create SDK for any other programming language.

If you have any troubles using our API or SDK free to contact our support by email [info@mailerlite.com](mailto:info@mailerlite)

Official documentation is at

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~328 days

Total

18

Last Release

1798d ago

PHP version history (4 changes)0.1.0PHP ^5.4|^7.0

0.1.3PHP ^5.5|^7.0

0.3.0PHP ^7.1

0.3.11PHP ^7.1||^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f90d840111141f6ae2fde35616fdc83a3416787255f65b288241eda043a829f4?d=identicon)[sergey-demidov](/maintainers/sergey-demidov)

---

Top Contributors

[![npetrunova](https://avatars.githubusercontent.com/u/11510615?v=4)](https://github.com/npetrunova "npetrunova (18 commits)")[![dominykasmailer](https://avatars.githubusercontent.com/u/45770777?v=4)](https://github.com/dominykasmailer "dominykasmailer (10 commits)")[![DomasWEB](https://avatars.githubusercontent.com/u/11888315?v=4)](https://github.com/DomasWEB "DomasWEB (10 commits)")[![tadaspaplauskas](https://avatars.githubusercontent.com/u/5982246?v=4)](https://github.com/tadaspaplauskas "tadaspaplauskas (6 commits)")[![johnkelesidis](https://avatars.githubusercontent.com/u/72185528?v=4)](https://github.com/johnkelesidis "johnkelesidis (3 commits)")[![witold-prucnel](https://avatars.githubusercontent.com/u/7393285?v=4)](https://github.com/witold-prucnel "witold-prucnel (2 commits)")[![flowdee](https://avatars.githubusercontent.com/u/2278756?v=4)](https://github.com/flowdee "flowdee (2 commits)")[![JuliusB](https://avatars.githubusercontent.com/u/9655075?v=4)](https://github.com/JuliusB "JuliusB (2 commits)")[![sergeykdemidov](https://avatars.githubusercontent.com/u/206621447?v=4)](https://github.com/sergeykdemidov "sergeykdemidov (1 commits)")[![karlkeefer](https://avatars.githubusercontent.com/u/305272?v=4)](https://github.com/karlkeefer "karlkeefer (1 commits)")[![jissereitsma](https://avatars.githubusercontent.com/u/7670482?v=4)](https://github.com/jissereitsma "jissereitsma (1 commits)")

---

Tags

sdkemailmarketingmailerlite

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sergey-demidov-mailerlite-api-v2-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/sergey-demidov-mailerlite-api-v2-php-sdk/health.svg)](https://phpackages.com/packages/sergey-demidov-mailerlite-api-v2-php-sdk)
```

###  Alternatives

[mailerlite/mailerlite-api-v2-php-sdk

MailerLite API v2 PHP SDK

801.7M15](/packages/mailerlite-mailerlite-api-v2-php-sdk)[mailerlite/mailerlite-php

MailerLite PHP SDK

31423.6k3](/packages/mailerlite-mailerlite-php)[railsware/mailtrap-php

The Mailtrap SDK provides methods for all API functions.

56770.5k](/packages/railsware-mailtrap-php)[princealikhan/laravel-mautic-api

Free and Open Source Marketing Automation API

415.9k](/packages/princealikhan-laravel-mautic-api)

PHPackages © 2026

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