PHP code example of waqidevs / waqi-php-client

1. Go to this page and download the library: Download waqidevs/waqi-php-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

waqidevs / waqi-php-client example snippets


$api = new WAQI\API(WAQI_TOKEN);

$response = $api->cityFeed()
    ->setCity("Munich")
    ->fetch();

$response = $api->search()
    ->setKeyword("Johannesburg")
    ->fetch();

$response = $api->geoFeed()
    ->setCoordinates(37.7749, -122.4194)
    ->fetch();

$response = $api->ipFeed()
    ->setIP("MY_IP")
    ->fetch();

$response = $api->mapStation()
    ->setMapBounds(40.712, -74.006, 34.052, -118.243)
    ->fetch();
shell
 composer