PHPackages                             happydemon/statuscake - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. happydemon/statuscake

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

happydemon/statuscake
=====================

Interface for StatusCake API

0.2.1(6y ago)1847[3 issues](https://github.com/happyDemon/statuscake/issues)MITPHPPHP &gt;=5.3.3

Since Oct 10Pushed 6y ago1 watchersCompare

[ Source](https://github.com/happyDemon/statuscake)[ Packagist](https://packagist.org/packages/happydemon/statuscake)[ Docs](https://github.com/happyDemon/statuscake)[ RSS](/packages/happydemon-statuscake/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

\#StatusCake API wrapper

StatusCake is a monitoring service that monitors website/servers over HTTP/TCP/PING.

This project wraps most endpoints StatusCake has to offer.

Install
-------

[](#install)

Via Composer

```
composer require happydemon/statuscake
```

Usage
-----

[](#usage)

Setting up the client:

```
$statusCake = new StatusCake\Client(`USER', 'TOKEN');
```

Checking if the credentials are valid:

```
$statusCake->validAccount(); // return true or false
```

Getting [basic account info](https://www.statuscake.com/api/The%20Basics/Confirm%20Authentication.md#render):

```
$statusCake->account();
```

### Tests

[](#tests)

These are actually your monitors, each test would represent a website you're monitoring.

Each returned test will be parsed into a class `StatusCake\Test`, all the properties are documented in there, be sure to check it out.

#### Creating a test

[](#creating-a-test)

To create a test you need to initialise `StatusCake\Test`. There are just a few properties that are actually required; websiteName, websiteURL, testType.

```
$test = new StatusCake\Test();

// Required parameters
$test->websiteName = 'HappyDemon';
$test->websiteURL = 'http://happydemon.xyz';
$test->testType = StatusCake\Test::TYPE_HTTP;

// I'm a little impatient, so I'd like more frequest checks (every 2 minutes)
$test->checkRate = 120;

// Save everything
$statusCake->updateTest($test);
```

#### Updating a test

[](#updating-a-test)

Updating is done in the same way:

```
// I've changed my mind, let's check every 5 minutes
$test->checkRate = 300;

// Save the change
$statusCake->updateTest($test);
```

#### Deleting a test

[](#deleting-a-test)

```
$statusCake->deleteTest($test);
```

#### Retrieving tests

[](#retrieving-tests)

Retrieving a list of existing tests is simple:

```
$tests = $statusCake->getTests();
```

#### Retrieving a test's period

[](#retrieving-a-tests-period)

A [period](https://www.statuscake.com/api/Period%20Data/Get%20Period%20Data.md#render) of data is two time stamps in which status has remained the same.

```
$periods = $test->getPeriods();
```

Retrieving a test's performance data
------------------------------------

[](#retrieving-a-tests-performance-data)

Retrieves a list of [checks](https://www.statuscake.com/api/Performance%20Data/Get%20All%20Data.md#render) performed for the current site (this statusCake users with a premium account).

```
$periods = $test->getPerformance();
```

#### Retrieve a test's previously sent alerts

[](#retrieve-a-tests-previously-sent-alerts)

Retrieves a list of [alerts](https://www.statuscake.com/api/Alerts/Get%20Sent%20Alerts.md#render) that have, previously, been sent.

```
$periods = $test->getAlerts();
```

### Contact Groups

[](#contact-groups)

One of the properties tests could need assigned is contact groups. You can retrieve and manage them through the API as wel.

The same principles as Tests are applied here, meaning every contact group will be loaded in a `StatusCake\ContactGroup` class (check the class definition for more info on the properties).

A few helper functions are included to work with email addresses.

#### Creating a contact group

[](#creating-a-contact-group)

```
$contactGroup = new StatusCake\ContactGroup();

// The only required parameter
$contactGroup->groupName = 'personal mail';

// let's add an email to get notifications
$contactGroup->addEmail('maxim.kerstens@gmail.com');

// Save everything
$statusCake->updateContactGroup($contactGroup);
```

#### Updating a contact group

[](#updating-a-contact-group)

```
// I've changed my mind, different email
$contactGroup->removeEmail('maxim.kerstens@gmail.com');
$contactGroup->addEmail('maxim@happydemon.xyz');

// Which is the same as doing
$contactGroup->email = ['maxim@happydemon.xyz']

// Save everything
$statusCake->updateContactGroup($contactGroup);
```

#### Deleting a contact group

[](#deleting-a-contact-group)

```
$statusCake->deleteContactGroup($contactGroup);
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~577 days

Total

3

Last Release

2349d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/91a724ec7e90c57050c6fa0fa34f9faeec7041896866d4f8ddc85ed00b0f8887?d=identicon)[happyDemon](/maintainers/happyDemon)

---

Top Contributors

[![christophluehr](https://avatars.githubusercontent.com/u/1352356?v=4)](https://github.com/christophluehr "christophluehr (2 commits)")[![DavidSteinbauer](https://avatars.githubusercontent.com/u/3392092?v=4)](https://github.com/DavidSteinbauer "DavidSteinbauer (1 commits)")[![happyDemon](https://avatars.githubusercontent.com/u/38573?v=4)](https://github.com/happyDemon "happyDemon (1 commits)")

---

Tags

apimonitoring

### Embed Badge

![Health badge](/badges/happydemon-statuscake/health.svg)

```
[![Health](https://phpackages.com/badges/happydemon-statuscake/health.svg)](https://phpackages.com/packages/happydemon-statuscake)
```

###  Alternatives

[ohdearapp/ohdear-php-sdk

An SDK to easily work with the Oh Dear API

742.6M13](/packages/ohdearapp-ohdear-php-sdk)[treblle/treblle-laravel

Stay in tune with your APIs

135204.9k](/packages/treblle-treblle-laravel)[treblle/security-headers

A collection of HTTP middleware classes to improve the security headers in your Laravel application.

9534.3k](/packages/treblle-security-headers)[muhammadsadeeq/laravel-activitylog-ui

A beautiful, modern UI for Spatie's Activity Log with advanced filtering, analytics, and real-time features.

17510.1k](/packages/muhammadsadeeq-laravel-activitylog-ui)[treblle/treblle-api-tools-laravel

A set of useful tools for building APIs in Laravel.

135.3k1](/packages/treblle-treblle-api-tools-laravel)

PHPackages © 2026

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