Download the PHP package meteoflow/php without Composer
On this page you can find all versions of the php package meteoflow/php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download meteoflow/php
More information about meteoflow/php
Files in meteoflow/php
Informations about the package php
MeteoFlow PHP SDK
Official PHP SDK for the MeteoFlow Weather API.
Requirements
- PHP 5.6 or higher
- ext-curl
- ext-json
Installation
Install via Composer:
Quick Start
API Methods
Weather
| Method | Description |
|---|---|
current($location) |
Get current weather |
forecastHourly($location, $options) |
Get hourly forecast |
forecast3Hourly($location, $options) |
Get 3-hourly forecast |
forecastDaily($location, $options) |
Get daily forecast |
Air Quality & Geomagnetic
| Method | Description |
|---|---|
airQuality($location, $options) |
Get air quality by days (max 8) |
geomagnetic($location) |
Get geomagnetic activity by days |
Geography
| Method | Description |
|---|---|
countries() |
List all supported countries |
citiesByCountry($countryCode) |
List cities for a country code |
searchCities($query, $limit) |
Search cities by name |
Location
The SDK uses a strict ONEOF pattern for locations. You can specify a location by slug, coordinates, or IP address, but not more than one at a time:
By Slug
By Coordinates
By IP Address
Forecast Options
Use ForecastOptions to customize forecast requests:
Default Values
When options are not specified, the SDK uses these defaults:
| Option | Default |
|---|---|
| days | 7 |
| units | metric |
| lang | en |
Air Quality Options
Use AirQualityOptions to customize air quality requests:
Geomagnetic Options
Geomagnetic endpoint does not support options (no days, units, or lang).
Use only location:
Configuration
Response Objects
CurrentWeatherResponse
Hourly & 3-Hourly Forecast
Daily Forecast
AirQualityResponse
GeomagneticResponse
Geography Responses
Error Handling
The SDK throws typed exceptions for different error scenarios:
Exception Hierarchy
Custom HTTP Transport
You can implement custom HTTP transport for framework integrations:
Examples
See the examples directory for complete usage examples:
Weather
- Current weather by slug
- Current weather by coordinates
- Current weather by IP
- Hourly forecast
- 3-hourly forecast
- Daily forecast
Geography
- List all countries
- Cities by country
- Search cities
Air Quality & Geomagnetic
- Air quality by days
- Geomagnetic activity by days
Testing
Run all tests:
PHP Version Compatibility
The SDK is designed to work with PHP 5.6 and higher:
- PHP 5.6+: Full compatibility, no typed properties or union types
- PHP 7.x: Works without modifications
- PHP 8.x: Works without modifications, benefits from JIT
Framework Integration
This SDK is designed as a standalone package. For framework-specific integrations:
- Laravel: See meteoflow/laravel
- Symfony: See
meteoflow/symfony(coming soon)
The SDK provides HttpTransportInterface as an extension point for custom transport implementations.
License
MIT License. See LICENSE for details.
All versions of php with dependencies
ext-curl Version *
ext-json Version *