kilmer / weather-client
A reusable PHP package for retrieving weather data from OpenWeather API
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/kilmer/weather-client
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.9
Requires (Dev)
- phpunit/phpunit: ^11.5
This package is not auto-updated.
Last update: 2026-01-06 18:07:17 UTC
README
WeatherClient is a reusable PHP Composer package for retrieving weather data from the OpenWeather API.
Features
- Fetch current weather data for Ndola City
- Basic output of weather information
- Built on top of Guzzle HTTP client
Requirements
- PHP 7.4 or higher
- Composer
- CodeIgniter 4
Installation
Install via Composer(recommended):
- composer require kilmer/weather-client
Usage
<?php use Kalam\WeatherClient\WeatherClient; $apiKey = 'YOUR_OPENWEATHER_API_KEY'; $client = new WeatherClient($apiKey); $weather = $client->getCurrentWeather('London'); print_r($weather);
Get your API key from here
https://openweathermap.org/api
Results
- once everything is set, run your CI4 project and navigate to localhost:8080/weather
Example usage in CI4
clone this repo https://github.com/BwalyaMK/WhatsTheWeather.git