PHPackages                             o-ba/covid-php - 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. o-ba/covid-php

ActiveLibrary[API Development](/categories/api)

o-ba/covid-php
==============

CovidPHP is a PHP API wrapper for the coronavirus tracking API

1.2.1(3y ago)91456MITPHPPHP &gt;=7.2.0

Since Mar 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/o-ba/covid-php)[ Packagist](https://packagist.org/packages/o-ba/covid-php)[ RSS](/packages/o-ba-covid-php/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

CovidPHP
========

[](#covidphp)

CovidPHP is a PHP API wrapper for the [Coronavirus tracker API](https://github.com/ExpDev07/coronavirus-tracker-api).

Per default the data is provided by the [Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE)](https://github.com/CSSEGISandData/COVID-19), but you can also use [csbs](https://www.csbs.org/information-covid-19-coronavirus) as source.

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

[](#installation)

You can install `o-ba/covid-php` using Composer:

```
composer require o-ba/covid-php

```

Require the composer autoloader in your script:

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

```

Usage
-----

[](#usage)

Create a instance of the API wrapper first:

```
$covidApi = new \Bo\CovidPHP\CovidApi();

```

**Available methods**

**Methods****Parameters****Description**`getSources()`Get all available sources.`getLatest()``string $source`Get the latest data summarized.`getAllLocations()``bool $includeTimelines` (optional)
`string $source` (optional)Get all available locations.`findByCountryCode()``string $countryCode`
`bool $includeTimelines` (optional)
`string $source` (optional)Get country specific data based on the country code.`findByLocation()``int $locationId`
`bool $includeTimelines` (optional)
`string $source` (optional)Get location specific data based on the location id.**Further information**

- Setting `$includeTimelines` adds timeline data to the response
- Setting `$source` let's you specify which source the data should be fetched from (default: `jhu`)

### Examples

[](#examples)

Get all available sources:

```
$covidApi->getSources();

```

Get the latest global amount of total confirmed cases, deaths and recoveries:

```
$covidApi->getLatest();

```

Get all locations:

```
$covidApi->getAllLocations();

```

Get all locations including timelines:

```
$covidApi->getAllLocations(true);

```

Get location data by country code:

```
$covidApi->findByCountryCode('DE');

```

Get location data by country code from `csbs` as source:

```
$covidApi->findByCountryCode('US', false, 'csbs');

```

Get location data for a specific location:

```
$covidApi->findByLocation(11);

```

Note
----

[](#note)

- All responses will be decoded and returned as `array`

License
-------

[](#license)

[MIT License](http://opensource.org/licenses/MIT)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~273 days

Total

4

Last Release

1426d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d1bfc89c42d831e190c1023b69a614bbbc3fc261def8b5e462467d142eaa4d1a?d=identicon)[o-ba](/maintainers/o-ba)

---

Top Contributors

[![o-ba](https://avatars.githubusercontent.com/u/8812114?v=4)](https://github.com/o-ba "o-ba (9 commits)")

---

Tags

apitrackingcovid-19

### Embed Badge

![Health badge](/badges/o-ba-covid-php/health.svg)

```
[![Health](https://phpackages.com/badges/o-ba-covid-php/health.svg)](https://phpackages.com/packages/o-ba-covid-php)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[gabrielbull/ups-api

PHP UPS API

4642.4M10](/packages/gabrielbull-ups-api)[gavroche/ups-api

PHP UPS API

45613.2k](/packages/gavroche-ups-api)[get-stream/stream-chat

A PHP client for Stream Chat (https://getstream.io/chat/)

301.8M2](/packages/get-stream-stream-chat)

PHPackages © 2026

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