PHPackages                             javleds/redspira-api - 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. javleds/redspira-api

ActiveLibrary[API Development](/categories/api)

javleds/redspira-api
====================

API wrapper for redspira.com

12[6 issues](https://github.com/javleds/redspira-api/issues)PHPCI failing

Since Feb 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/javleds/redspira-api)[ Packagist](https://packagist.org/packages/javleds/redspira-api)[ RSS](/packages/javleds-redspira-api/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (10)Used By (0)

redspira-api
============

[](#redspira-api)

Laravel API wrapper for

[![Build Status](https://camo.githubusercontent.com/f451d071488a659e0333a633cf6d5dd5211bf0cbdb52e3432dda1a88e5547a2f/68747470733a2f2f7472617669732d63692e636f6d2f6a61766c6564732f72656473706972612d6170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/javleds/redspira-api)

Requirements
------------

[](#requirements)

- Laravel 5.7
- PHP 7.2

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

[](#installation)

```
composer require javleds/redspira-api

```

Usage
-----

[](#usage)

### Device

[](#device)

```
class SomeClass
{
    public function example()
    {
        /** @var Collection $devices **/
        $devices = \RedspiraApi::devices()->all();
    }
}

```

#### Get device registries

[](#get-device-registries)

```
class SomeClass
{
    public function example()
    {
        $parameters = new Javleds\RedspiraApi\DataParameters\DeviceParameters(
            $deviceId, // string Monitor identifier
            $parameterId, // string Parameter or pollutant [ApiParameters::PM25_PARAMETER|ApiParameters::PM10_PARAMETER]
            $startDate, // DateTime First date for filtering device entries
            $endDate, // DateTime Last date for filtering device entries
            $interval, // string Intervl of time [ApiParameters::HOUR_INTERVAL|ApiParameters::MINUTE_INTERVAL]
            $tomeOffset, // (opt) int Time offset
        );

        /** @var Collection $registries **/
        $registries = \RedspiraApi::device()->get($parameters);
    }
}

```

#### Get device registries for last hours

[](#get-device-registries-for-last-hours)

```
class SomeClass
{
    public function example()
    {
        /** @var Collection $registries **/
        $registries = \RedspiraApi::device()->getLastHours(
            $deviceId, // string Monitor identifier
            $parameterId, // string Parameter or pollutant [ApiParameters::PM25_PARAMETER|ApiParameters::PM10_PARAMETER]
            $hours, // int Hours of interest before now
            $timeOffset // (opt) int Tome offset
        );
    }
}

```

#### Get device registries for last days

[](#get-device-registries-for-last-days)

```
class SomeClass
{
    public function example()
    {
        /** @var Collection $registries **/
        $registries = \RedspiraApi::device()->getLastDays(
            $deviceId, // string Monitor identifier
            $parameterId, // string Parameter or pollutant [ApiParameters::PM25_PARAMETER|ApiParameters::PM10_PARAMETER]
            $days, // int Days of interest before now
            $timeOffset // (opt) int Tome offset
        );
    }
}

```

### Areas

[](#areas)

```
class SomeClass
{
    public function example()
    {
        /** @var Collection $areas **/
        $areas = \RedspiraApi::areas()->all();
    }
}

```

#### Single area

[](#single-area)

```
class SomeClass
{
    public function example()
    {
        $parameters = new Javleds\RedspiraApi\DataParameters\AreaParameters(
            $areaId, // string Area identifier, you could get them useing RedspiraApi::areas->all();
            $parameterId, // string Parameter or pollutant [ApiParameters::PM25_PARAMETER|ApiParameters::PM10_PARAMETER]
            $startDate, // DateTime First date for filtering device entries
            $endDate, // DateTime Last date for filtering device entries
            $interval, // string Intervl of time [ApiParameters::HOUR_INTERVAL|ApiParameters::MINUTE_INTERVAL]
            $tomeOffset, // (opt) int Time offset
        );

        /** @var Collection $registries **/
        $registries = \RedspiraApi::area()->getRegistries($parameters);
    }
}

```

#### Single area for last hours

[](#single-area-for-last-hours)

```
class SomeClass
{
    public function example()
    {
        /** @var Collection $registries **/
        $registries = \RedspiraApi::area()->getLastHours(
            $areaId, // string Area identifier
            $parameterId, // string Parameter or pollutant [ApiParameters::PM25_PARAMETER|ApiParameters::PM10_PARAMETER]
            $hours, // int Hours of interest before now
            $timeOffset // (opt) int Tome offset
        );
    }
}

```

#### Single area for last days

[](#single-area-for-last-days)

```
class SomeClass
{
    public function example()
    {
        /** @var Collection $registries **/
        $registries = \RedspiraApi::area()->getLastDays(
            $areaId, // string Area identifier
            $parameterId, // string Parameter or pollutant [ApiParameters::PM25_PARAMETER|ApiParameters::PM10_PARAMETER]
            $days, // int Days of interest before now
            $timeOffset // (opt) int Tome offset
        );
    }
}

```

> Built as part of project:

Contribution
------------

[](#contribution)

If you want to contribute, follow next steps:

- Fork the project
- Create a new branch and perform the necessary changes
- Send your pull request

Licence
-------

[](#licence)

MIT

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 74.1% 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://www.gravatar.com/avatar/65b67fec8f0713fe42ce0c110d8969d35cbc74b952f514197d06ef0b69345fdb?d=identicon)[javleds](/maintainers/javleds)

---

Top Contributors

[![jledezma-mt](https://avatars.githubusercontent.com/u/65924428?v=4)](https://github.com/jledezma-mt "jledezma-mt (40 commits)")[![javleds](https://avatars.githubusercontent.com/u/11241239?v=4)](https://github.com/javleds "javleds (14 commits)")

### Embed Badge

![Health badge](/badges/javleds-redspira-api/health.svg)

```
[![Health](https://phpackages.com/badges/javleds-redspira-api/health.svg)](https://phpackages.com/packages/javleds-redspira-api)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k13](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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