PHP code example of epixian / laravel-noaa

1. Go to this page and download the library: Download epixian/laravel-noaa 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/ */

    

epixian / laravel-noaa example snippets


// fetch all datasets
$response = \Noaa::datasets()->get();

// fetch dataset with id of 'GSOM'
$dataset = \Noaa::datasets()->get('GSOM');

$dataset = \Noaa::datasets()->from('1970-10-03')->to('2012-09-10')->take(50)->get();

$dataset = \Noaa::datasets()->withDataType('ACMH')->get();
// or
$dataset = \Noaa::datasets()->withDataType(['ACMH', 'MLY-TAVG-NORMAL'])->get();

$dataset = \Noaa::datasets()->withLocation('FIPS:37')->get();
// or
$dataset = \Noaa::datasets()->withLocation(['FIPS:09', 'FIPS:10'])->get();

$dataset = \Noaa::datasets()->withStation('COOP:310090')->get();
// or
$dataset = \Noaa::datasets()->withStation(['COOP:310090', 'COOP:310184'])->get();

$dataset = \Noaa::dataCategories()->withDataset('ACMH')->get();
// or
$dataset = \Noaa::dataCategories()->withDataset(['ACMH', 'GSOM'])->get();

$dataset = \Noaa::dataCategories()->withLocation('FIPS:37')->get();
// or
$dataset = \Noaa::dataCategories()->withLocation(['FIPS:09', 'FIPS:10'])->get();

$dataset = \Noaa::dataCategories()->withStation('COOP:310090')->get();
// or
$dataset = \Noaa::dataCategories()->withStation(['COOP:310090', 'COOP:310184'])->get();

$dataset = \Noaa::dataTypes()->withDataset('ACMH')->get();
// or
$dataset = \Noaa::dataTypes()->withDataset(['ACMH', 'GSOM'])->get();

$dataset = \Noaa::dataTypes()->withLocation('FIPS:37')->get();
// or
$dataset = \Noaa::dataTypes()->withLocation(['FIPS:09', 'FIPS:10'])->get();

$dataset = \Noaa::dataTypes()->withStation('COOP:310090')->get();
// or
$dataset = \Noaa::dataTypes()->withStation(['COOP:310090', 'COOP:310184'])->get();

$dataset = \Noaa::dataTypes()->withDataCategory('ANNAGR')->get();
// or
$dataset = \Noaa::dataTypes()->withDataCategory(['ANNAGR', 'ANNTEMP'])->get();