php-weather / open-meteo
Open Meteo provider
Installs: 1 420
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8
- ext-json: *
- php-weather/core: 0.4.*
- php-weather/http-provider: 0.6.*
Requires (Dev)
- php-http/guzzle7-adapter: ^1.0
- phpstan/phpstan: ^1.6
- phpunit/phpunit: >=8.0
README
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);