Skip to content

php-weather/open-meteo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Weather Provider for Open Meteo

Packagist Version
PHP Weather Common Version PHP Weather HTTP Provider Version
GitHub Release Date GitHub commits since tagged version GitHub last commit
GitHub Workflow Status GitHub Packagist PHP Version Support

This is the Open Meteo provider from PHP Weather.

Open-Meteo collaborates with National Weather Services providing Open Data with 11 to 2 km resolution. Our high performance APIs select the best weather model for your location and provide data as a simple JSON API.
APIs are free without any API key for open-source developers and non-commercial use.

Installation

Via Composer

composer require php-weather/open-meteo

Usage

$httpClient = new \Http\Adapter\Guzzle7\Client();
$openMeteo = new \PhpWeather\Provider\OpenMeteo\OpenMeteo($httpClient);

$latitude = 47.873;
$longitude = 8.004;

$currentWeatherQuery = \PhpWeather\Common\WeatherQuery::create($latitude, $longitude);
$currentWeather = $openMeteo->getCurrentWeather($currentWeatherQuery);