chimilevschi/laravel-weather

Package for get the weather data

v2.1.1 2024-08-01 15:45 UTC

This package is auto-updated.

Last update: 2024-10-31 16:16:09 UTC


README

Open Meteo

Download Meteorological Data from OPEN-METEO API (https://open-meteo.com/en)

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. You can embed them directly into your app.

Installation

You can install the package via composer:

composer require chimilevschi/laravel-weather

You can publish the config file with:

php artisan vendor:publish --tag="laravel-weather-config"

This is the contents of the published config file:

return [
    'temperature_unit' => 'celsius',
    'wind_speed_unit' => 'kmh',
    'precipitation_unit' => 'mm',
    'time_format' => 'iso8601',
    'timezone' => 'GMT',
];

Usage

$weather = \Clevada\Weather\Weather::location(30.0812558, 31.2511902)
    ->current()
    ->get();

Functions:

15-minutely Functions:

Hourly Functions:

Daily Functions:

WMO Weather interpretation codes (WW):

Testing

composer test

License

The MIT License (MIT). Please see License File for more information.