A micro-service aggregating weather information from weather providers. It serves as a gateway between the weather information providers (which normally limits the number of request) and the application that depends on weather information.
composer install
http://localhost/api/v1/current/[location]
http://localhost/api/v1/current/[location]?provider=openweathermap
http://localhost/api/v1/simple/[location]
php bin/console weather:current [location]
php bin/console weather:current [location] --provider=qweather
$location = 'shenyang';
$url = 'http://localhost/api/v1/current/'.$location;
$weather = file_get_contents($url);
$weather = json_decode($weather, true);
print_r($weather);
The following features are provided:
- Simple Restful API for apps to call, with JSON return format.
- Collects weather info from weather providers.
- Cache weather info per day per location. This is useful for apps that have massive user-base. e.g. digital signage, tourist apps.
- Support multiple weather providers and convert weather info into the same format.
Supported weather providers:
Supported weather information types:
- Current weather
- Lifestyle
- Air quality
- Forcast