Download the PHP package azuyalabs/waqi without Composer

On this page you can find all versions of the php package azuyalabs/waqi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package waqi

GitHub Release CodeCheck

A simple PHP Wrapper for the World Air Quality Index API

The World Air Quality Index project is an initiative to map the current and real-time air quality around the globe. The Air Quality indexes are based on PM2.5, PM10, Ozone, NO2, SO2 and CO hourly measurements provided by various monitoring stations in the world.

This packages makes it easy to retrieve the Air Quality Index for your area and is based on the real-time Air Quality data feed (API) of the WAQI project.

Note: To make use of this package (and the underlying AQI API) an access token is required. You can acquire your token here: https://aqicn.org/data-platform/token..

System Requirements

You need PHP >= 8.2 to use azuyalabs/waqi.

Installation

You can pull in this package via composer:

Usage

Start with including the Composer autoload file in your project:

Using your AQI access token, create an instance of the WAQI object:

Next, use the getObservationByStation method with the desired city or monitoring station name (e.g. 'new york'). This will obtain the latest air quality observations:

Air Quality

If all goes well, use the various API methods to get details about the retrieved Air Quality Index of the chosen city or monitoring station.

To get the AQI (Air Quality Index), use the method getAQI:

This returns an array structure containing the Air Quality Index measured at this monitoring station at the time of measurement. It contains 4 elements:

Example output (for 'New York'):

In addition to the general Air Quality Information, specific pollutant level information is available as well. Be aware that not every monitoring station captures all pollutant types, so some of these API functions may return 'null'.

The following API functions are available to get specific pollutant level information:

Monitoring Station

Information about the monitoring station can be obtained through two API methods.

First, using the API method getMonitoringStation(), will return information about the given monitoring station:

Secondly, the API method getAttributions() will return a list of EPA attributions for this monitoring station.

Other

Other API methods that provide additional information, are:

Changelog

Please see CHANGELOG for more information what has changed.

Testing

This package comes with a PHPUnit test suite. To run the tests, run the following command from the project directory:

,or alternatively run with:

Contributing

Contributions are encouraged and welcome; I am always happy to get feedback or pull requests on GitHub :) Create GitHub Issues for bugs and new features and comment on the ones you are interested in.

If you enjoy what I am making, an extra cup of coffee is very much appreciated :). Your support helps me to put more time into Open-Source Software projects like this.

Buy Me A Coffee

Credits

License

This package is open-sourced software licensed under the MIT License. Please see LICENSE for more information.


All versions of waqi with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
guzzlehttp/guzzle Version ^7.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package azuyalabs/waqi contains the following files

Loading the files please wait ....