PHPackages                             eliashaeussler/cpanel-requests - 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. eliashaeussler/cpanel-requests

AbandonedArchivedLibrary[API Development](/categories/api)

eliashaeussler/cpanel-requests
==============================

Small PHP library enabling requests to cPanel instances

3.1.3(7mo ago)322[1 issues](https://github.com/eliashaeussler/cpanel-requests/issues)GPL-3.0-or-laterPHPPHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

Since Jul 1Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/eliashaeussler/cpanel-requests)[ Packagist](https://packagist.org/packages/eliashaeussler/cpanel-requests)[ RSS](/packages/eliashaeussler-cpanel-requests/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (10)Dependencies (20)Versions (16)Used By (0)

Abandoned!
==========

[](#abandoned)

Caution

**This library is abandoned and will no longer receive updates. Please switch to a dedicated alternative.**

---

cPanel Requests
===============

[](#cpanel-requests)

[![Coverage](https://camo.githubusercontent.com/b628e7d1ad9efcee7a44bdb9efb067cad7614a5c92b0fe395b39f6261316ce23/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c73436f7665726167652f6769746875622f656c6961736861657573736c65722f6370616e656c2d72657175657374733f6c6f676f3d636f766572616c6c73)](https://coveralls.io/github/eliashaeussler/cpanel-requests)[![Maintainability](https://camo.githubusercontent.com/1da1ff289283eb0db086359dc40b3459a2f481f161ba769f7267b6b615440f06/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31323737636238303135316333333264303466662f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/eliashaeussler/cpanel-requests/maintainability)[![Tests](https://github.com/eliashaeussler/cpanel-requests/actions/workflows/tests.yaml/badge.svg)](https://github.com/eliashaeussler/cpanel-requests/actions/workflows/tests.yaml)[![CGL](https://github.com/eliashaeussler/cpanel-requests/actions/workflows/cgl.yaml/badge.svg)](https://github.com/eliashaeussler/cpanel-requests/actions/workflows/cgl.yaml)[![Latest Stable Version](https://camo.githubusercontent.com/d6513a031515f61d98a1533b120653dfb0ddf042003a6e8a1d324ce4c093e1e6/687474703a2f2f706f7365722e707567782e6f72672f656c6961736861657573736c65722f6370616e656c2d72657175657374732f76)](https://packagist.org/packages/eliashaeussler/cpanel-requests)[![Total Downloads](https://camo.githubusercontent.com/d11d94b0331eae84054d2a5f5675e2d98945b96c88a16d72684f0d65e827b565/687474703a2f2f706f7365722e707567782e6f72672f656c6961736861657573736c65722f6370616e656c2d72657175657374732f646f776e6c6f616473)](https://packagist.org/packages/eliashaeussler/cpanel-requests)[![License](https://camo.githubusercontent.com/e4332fbba30fd0410ca39b9c84cb293445d03205bfdfbaf6c1fcdd8e01e0515d/687474703a2f2f706f7365722e707567782e6f72672f656c6961736861657573736c65722f6370616e656c2d72657175657374732f6c6963656e7365)](LICENSE)

📦 [Packagist](https://packagist.org/packages/eliashaeussler/cpanel-requests) | :floppy\_disk: [Repository](https://github.com/eliashaeussler/cpanel-requests) | :bug: [Issue tracker](https://github.com/eliashaeussler/cpanel-requests/issues)

A simple PHP project to make API requests on your [cPanel](https://cpanel.com/) installation. This allows you to call modules inside the installation and interact with them to add, show or list data such as domains, e-mail accounts, databases and so on.

**The project makes use of [UAPI](https://documentation.cpanel.net/display/DD/Guide+to+UAPI). Therefore, it is required to have a cPanel installation with at least version 42 running**.

🔥 Installation
--------------

[](#fire-installation)

```
composer require eliashaeussler/cpanel-requests
```

⚠️ If you want to use two-factor authentication together with the HTTP session [authorization](#authorization) method, you must **manually require the `spomky-labs/otphp` package (&gt;= 11.1)**.

⚡Usage
------

[](#zapusage)

### Authorization

[](#authorization)

The following authorization methods are currently available:

TypeImplementation classAuthorization via [**API token**](https://api.docs.cpanel.net/cpanel/tokens/) (recommended)[`Application\Authorization\TokenAuthorization`](src/Application/Authorization/TokenAuthorization.php)Authorization via [**HTTP session**](https://api.docs.cpanel.net/cpanel/introduction/)[`Application\Authorization\HttpAuthorization`](src/Application/Authorization/HttpAuthorization.php)💡 You can also provide your own implementation for authorization at your cPanel instance. For this, you have to implement the interface [`Application\Authorization\AuthorizationInterface`](src/Application/Authorization/AuthorizationInterface.php).

### Create a new [`CPanel`](src/Application/CPanel.php) instance

[](#create-a-new-cpanel-instance)

Once you have selected an authentication method, you can create a new [`Application\CPanel`](src/Application/CPanel.php) instance:

```
use EliasHaeussler\CpanelRequests\Application;

/** @var Application\Authorization\AuthorizationInterface $authorization */
$cPanel = new Application\CPanel($authorization, 'example.com', 2083);
```

### Perform API requests

[](#perform-api-requests)

Now you're able to make API requests:

```
use EliasHaeussler\CpanelRequests\Application;

/** @var Application\CPanel $cPanel */
$response = $cPanel->api('', '', ['optional' => 'parameters']);
if ($response->isValid()) {
    // Do anything...
    // Response data can be fetched using $response->getData()
}
```

**Note that currently only GET requests are supported.**

Visit the [official documentation](https://documentation.cpanel.net/display/DD/Guide+to+UAPI) to get an overview about available API modules and functions.

🐝 Example
---------

[](#bee-example)

```
use EliasHaeussler\CpanelRequests\Application;
use EliasHaeussler\CpanelRequests\Http;

$authorization = new Application\Authorization\TokenAuthorization(
    username: 'bob',
    token: '9CKU401OH5WVDGSAVXN3UMLT8BJ5IY',
);
$cPanel = new Application\CPanel(
    authorization: $authorization,
    host: 'cpanel.bobs.site',
    port: 2083,
    protocol: Http\Protocol::Https,
);

// Fetch domains from cPanel API
$response = $cPanel->api(
    module: 'DomainInfo',
    function: 'list_domains',
);

if (!$response->isValid()) {
    throw new \RuntimeException('Got invalid response from cPanel application.');
}

$domains = $response->getData()->data;
echo 'Bob\'s main domain is: ' . $domains->main_domain;
```

🗑️ Cleanup
----------

[](#wastebasket-cleanup)

The project provides a console application that can be used to execute several cleanup commands from the command line.

```
# General usage
vendor/bin/cpanel-requests

# Remove expired request cookie files (default lifetime: 1 hour)
vendor/bin/cpanel-requests cleanup:cookies
vendor/bin/cpanel-requests cleanup:cookies --lifetime 1800

# Remove log files
vendor/bin/cpanel-requests cleanup:logs
```

🧑‍💻 Contributing
----------------

[](#technologist-contributing)

Please have a look at [`CONTRIBUTING.md`](CONTRIBUTING.md).

⭐ License
---------

[](#star-license)

This project is licensed under [GNU General Public License 3.0 (or later)](LICENSE).

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance56

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

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

Recently: every ~184 days

Total

13

Last Release

232d ago

Major Versions

1.0.1 → 2.0.02022-07-05

2.0.4 → 3.0.02023-03-11

PHP version history (5 changes)1.0.0PHP &gt;= 7.1 &lt; 7.5

2.0.0PHP ~8.1.0

3.0.1PHP ~8.1.0 || ~8.2.0

3.1.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0

3.1.2PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/144cefe55242b883c87cb537463f3ba75a0f8198fc5b602b50c838aae31fe7ee?d=identicon)[eliashaeussler](/maintainers/eliashaeussler)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (304 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (222 commits)")[![eliashaeussler](https://avatars.githubusercontent.com/u/16313625?v=4)](https://github.com/eliashaeussler "eliashaeussler (170 commits)")

---

Tags

apicpanelrequestuapi

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eliashaeussler-cpanel-requests/health.svg)

```
[![Health](https://phpackages.com/badges/eliashaeussler-cpanel-requests/health.svg)](https://phpackages.com/packages/eliashaeussler-cpanel-requests)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M343](/packages/drupal-core-recommended)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M468](/packages/saloonphp-saloon)

PHPackages © 2026

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