PHPackages                             silvercomet89/covid-19\_api\_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. silvercomet89/covid-19\_api\_php\_sdk

ActiveLibrary

silvercomet89/covid-19\_api\_php\_sdk
=====================================

An unofficial SDK for connecting to the UK government API via PHP

00PHP

Since Oct 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/SilverComet89/covid_api_php_sdk)[ Packagist](https://packagist.org/packages/silvercomet89/covid-19_api_php_sdk)[ RSS](/packages/silvercomet89-covid-19-api-php-sdk/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

covid\_api\_php\_sdk
====================

[](#covid_api_php_sdk)

An unofficial SDK for connecting to the UK government COVID-19 API via PHP using curl requests.

**Please note that you should always make sure this API is valid for your use-case**

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

[](#installation)

To install via composer use:

```
composer require silvercomet89/covid-19_api_php_sdk
```

Basic Example
-------------

[](#basic-example)

Below is a copy of a basic example, this is the same as the structure example on the developer-guide produced by the UK government except that 2 metrics they list there are no longer in their list of valid metrics. You can find this example inside the code under the examples folder.

```
require __DIR__ . '/../vendor/autoload.php';

// We start creating filters using the metrics.
$filters = new Api\Filter\filter;
$filters->addFilter(Api\Filter\filter::METRIC_AREA_TYPE, Api\Filter\areaType::AREA_TYPE_NATION);
$filters->addFilter(Api\Filter\filter::METRIC_AREA_NAME, 'england');

// We start creating structures, if no display name is set the metric default will be used.
$structure = new Api\Structure\structure;
$structure->addStructure(Api\Structure\structure::METRIC_DATE);
$structure->addStructure(Api\Structure\structure::METRIC_AREA_NAME);
$structure->addStructure(Api\Structure\structure::METRIC_AREA_CODE);
$structure->addStructure(Api\Structure\structure::METRIC_NEW_CASES_BY_PUBLISH_DATE);
$structure->addStructure(Api\Structure\structure::METRIC_CUM_CASES_BY_PUBLISH_DATE);
$structure->addStructure(Api\Structure\structure::METRIC_NEW_DEATHS_28_DAYS_BY_DEATH_DATE);
$structure->addStructure(Api\Structure\structure::METRIC_CUM_DEATHS_28_DAYS_BY_DEATH_DATE);

$request = new Api\request;

// We set our content type here so we have a clear interface.
echo $request->make_request();
```

Format
------

[](#format)

You can set the output format as JSON, CSV or XML. The default is JSON.

```
$format = new Api\Format\format;
$format->format(Api\Format\format::FORMAT_JSON);
```

Pagination
----------

[](#pagination)

You can take advantage of the native pagination by passing the page number you are currently on. The request results give the link to the previous or next.

```
$page = new Api\Page\page;
$page->setPage(1);
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6968171?v=4)[Ben Faulkner](/maintainers/SilverComet89)[@SilverComet89](https://github.com/SilverComet89)

---

Top Contributors

[![SilverComet89](https://avatars.githubusercontent.com/u/6968171?v=4)](https://github.com/SilverComet89 "SilverComet89 (10 commits)")

### Embed Badge

![Health badge](/badges/silvercomet89-covid-19-api-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/silvercomet89-covid-19-api-php-sdk/health.svg)](https://phpackages.com/packages/silvercomet89-covid-19-api-php-sdk)
```

PHPackages © 2026

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