https://github.com/lsv/windy-php-api
Windy PHP API client
https://github.com/lsv/windy-php-api
Last synced: 5 months ago
JSON representation
Windy PHP API client
- Host: GitHub
- URL: https://github.com/lsv/windy-php-api
- Owner: lsv
- License: mit
- Created: 2025-08-13T12:41:28.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-08-13T13:12:42.000Z (10 months ago)
- Last Synced: 2025-08-13T15:19:33.050Z (10 months ago)
- Language: PHP
- Size: 16.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Windy API Client
A library for interacting with the [Windy.com API](https://api.windy.com). This PHP client provides a streamlined way to request and handle weather forecast data from Windy's API.
## Features
- Easy integration with Windy.com API
- PSR compliant (HTTP Client, Request, Response, Logger)
- Supports Symfony Validator for request validation
- Includes utilities for working with point forecasts and weather models
- Fully tested with PHPUnit
- Automatic API request and response handling
## Requirements
- PHP 8.1 or higher
- A valid Windy API key
- Composer for dependency management
---
## Installation
Install the library via Composer:
```bash
composer require lsv/windy-api
```
---
## Usage
### Basic forecast request
```php
request($forecastRequest);
// $response is an array of Time[] objects
// $response[0]->time - DateTimeInterface;
// $response[0]->values - array of Value[] objects
// $response[0]->values[0]->name - name of the value;
// $response[0]->values[0]->unit - string - The value unit
// $response[0]->values[0]->value - int|float - the value;
} catch (\Throwable $e) {
echo 'Error: ' . $e->getMessage();
}
```
## Todo
- ~~Point forecast~~
- Map forecast
- Webcams
## Development
### Code Quality
The project uses PHPStan and PHP CS Fixer for static analysis and coding standards. Run the following command to check and fix code quality:
```bash
composer fix
```
---
## License
This library is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.