PHP SDK for Singapore's open data API https://data.gov.sg/datasets?formats=API
The package vinkas/singapore
can be installed using composer via Packagist.
composer require vinkas/singapore
You can simply call the API endpoints by using the Connector
class.
use Vinkas\Singapore\Api\Connector;
$connector = new Connector();
$response = $connector->weather()->rainfall();
$data = $response->object()->data;
$stations = $data->stations;
$readings = $data->readings;
Also, you can get all the details of Singapore regions, areas, subzones, and postal districts from the classes below. Some of these lists are created from the MIT Node package https://github.com/horensen/sg-areas
use Vinkas\Singapore\Data\Regions;
use Vinkas\Singapore\Data\Areas;
use Vinkas\Singapore\Data\Subzones;
use Vinkas\Singapore\Data\PostalDistricts;
Regions::all();
Areas::all();
Subzones::all();
PostalDistricts::all();