PHPackages                             owenandrews/willyweather-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. owenandrews/willyweather-php

ActiveLibrary[API Development](/categories/api)

owenandrews/willyweather-php
============================

A PHP client for WillyWeathers's v2 API.

v0.1.0(9y ago)027MITPHPPHP ^7.0

Since May 22Pushed 8y ago1 watchersCompare

[ Source](https://github.com/owenandrews/willyweather-php)[ Packagist](https://packagist.org/packages/owenandrews/willyweather-php)[ Docs](https://github.com/owenandrews/willyweather-php)[ RSS](/packages/owenandrews-willyweather-php/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

willyweather-php
================

[](#willyweather-php)

A PHP client for WillyWeathers's v2 API.

**Note: This is not an official library, nor is it fully featured.**

Requirments
-----------

[](#requirments)

- PHP 7 or newer
- [A WillyWeather API key](http://www.willyweather.com.au/info/api.html)

Installation
------------

[](#installation)

```
composer require owenandrews/willyweather-php
```

Usage
-----

[](#usage)

### Get a location

[](#get-a-location)

Retrieve basic information for a given location ID.

```
use WillyWeather\Client;

$willyWeather = new Client('');
$sydney = $willyWeather->location(4950);
$sydney->getName();
```

### Get forecast and observational data

[](#get-forecast-and-observational-data)

Retrieve a location's basic forecast and observational data.

```
use WillyWeather\Client;

$willyWeather = new Client('');
$sydney = $willyWeather->location(4950);
$sydney->getForecasts();
$sydney->getObservational();
```

### Get custom forecast data

[](#get-custom-forecast-data)

By default, only the basic 7 day weather forecast is returned. To override this, just add an array of forecast types to the function call. Check out the [API documentation](http://www.willyweather.com/api/docs/v2.html) for all available forecast types. Keep in mind you must enable each forecast type for your API key, otherwise the request will fail.

```
use WillyWeather\Client;

$willyWeather = new Client('');
$sydney = $willyWeather->location(4950);
$sydney->getForecasts(["forecasts" => ["temperature", "wind", "rainfallprobability"], "days" => 3]);
```

### Shorthand

[](#shorthand)

So far we've recieved location, forecast and observational data, each time making a seperate API request. Thankfully, we can bundle that up into one API call.

```
use WillyWeather\Client;

$willyWeather = new Client('');
$sydney = $willyWeather->location(4950, ["forecasts" => ["temperature", "wind", "rainfallprobability"], "days" => 3, "observational" => true]);
$sydney->getForecasts();
$sydney->getObservational();
```

This time only one API call was made.

### Search

[](#search)

Search for locations based on placename or postcode.

```
use WillyWeather\Client;

$willyWeather = new Client('');
$sydney = $willyWeather->searchByQuery("Sydney")[0];
```

Search for locations based on proximity to a set of coordinates.

```
use WillyWeather\Client;

$willyWeather = new Client('');
$mackenziesBay = $willyWeather->searchByCoordinates(["lat" => -33.8996141, "lng" => 151.272962])[0];
```

### Caching

[](#caching)

A basic file-based cache is included, this can help reduce repetitive API calls. To enable it, just pass in a suitable path while constructing the client.

```
use WillyWeather\Client;

$willyWeather = new Client('', '/tmp/');
```

Dates and Times
---------------

[](#dates-and-times)

All date/time strings are converted to [Carbon](https://github.com/briannesbitt/Carbon) objects in the locations local timezone.

Contributing
------------

[](#contributing)

Contributions are most welcome, just submit a pull request. 😄

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

Built With
----------

[](#built-with)

- [Guzzle](https://github.com/guzzle/guzzle) - HTTP client
- [GuzzleCache](https://github.com/Kevinrob/guzzle-cache-middleware) - Guzzle caching middleware
- [Carbon](https://github.com/briannesbitt/Carbon) - Date time library
- [Flysystem](https://github.com/thephpleague/flysystem) - Filesystem abstraction

Authors
-------

[](#authors)

- [Owen Andrews](https://github.com/owenandrews)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3326d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/183721679?v=4)[owen](/maintainers/owen-andrews)[@owen-andrews](https://github.com/owen-andrews)

---

Top Contributors

[![owenandrews](https://avatars.githubusercontent.com/u/5018955?v=4)](https://github.com/owenandrews "owenandrews (11 commits)")

---

Tags

phpweatherweatherwillyweather

### Embed Badge

![Health badge](/badges/owenandrews-willyweather-php/health.svg)

```
[![Health](https://phpackages.com/badges/owenandrews-willyweather-php/health.svg)](https://phpackages.com/packages/owenandrews-willyweather-php)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[statamic/cms

The Statamic CMS Core Package

4.8k3.5M923](/packages/statamic-cms)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9317.2k55](/packages/open-dxp-opendxp)[flat3/lodata

OData v4.01 Producer for Laravel

99346.1k](/packages/flat3-lodata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
