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.
Via Composer
composer require php-weather/open-meteo
$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);