OpenWeatherMap helps making requests to the OpenWeatherMap API, without having to bother too much about passing your API key and building requests. The only thing you need is the API key (APPID) which you can find after registration on the website.
More info about custom parameters in the official API docs: http://bugs.openweathermap.org/projects/api/wiki/Api_2_5
<?php use Endroid\OpenWeatherMap\Client; $client = new Client($apiKey); // Retrieve the current weather for Breda $weather = $client->getWeather('Breda,nl'); // Or retrieve the weather using the generic query method $response = $client->query('weather', array('q' => 'Breda,nl')); $weather = json_decode($response->getContent()); // You can also retrieve a N days forecast $forecast = $client->getForecast('Breda,nl', 7);
You can use
EndroidOpenWeatherMapBundle to enable this
service in your Symfony application or to expose the OpenWeatherMap API through your own domain.
Semantic versioning (semver) is applied as much as possible.
This bundle is under the MIT license. For the full copyright and license information, please view the LICENSE file that was distributed with this source code.