Skip to content

singfuse/singapore-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

singapore-php

Tests Packagist Version

PHP SDK for Singapore's open data API https://data.gov.sg/datasets?formats=API

Installation

The package vinkas/singapore can be installed using composer via Packagist.

composer require vinkas/singapore

Usage

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();

About

PHP SDK for Singapore's open data API and list of regions, areas, subzones, and postal districts

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages