PHPackages                             vannut/statamic-weather-addon - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. vannut/statamic-weather-addon

ActiveStatamic-addon[Utility &amp; Helpers](/categories/utility)

vannut/statamic-weather-addon
=============================

Get weather for a location

v2.0.2(1y ago)52.0k↓47.4%[5 issues](https://github.com/vannut/statamic-weather-addon/issues)PHP

Since May 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/vannut/statamic-weather-addon)[ Packagist](https://packagist.org/packages/vannut/statamic-weather-addon)[ RSS](/packages/vannut-statamic-weather-addon/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)DependenciesVersions (12)Used By (0)

Weather Forecast
================

[](#weather-forecast)

Display the current weather or a 7-day forecast for any lat/lon on earth.

> Attention: This version (2) is a complete rewrite of the addon. Although it does the same: display a weather forecast; the used weatherprovider is different and some of the fields are renamed. So please pay attention when upgrading.

Visual Crossing
---------------

[](#visual-crossing)

The weather data itself is coming from the Visual Crossing api. [It's free for the first 1,000 records a day.](https://www.visualcrossing.com/weather-data-editions)

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

[](#installation)

1. Install add on through composer: `composer require vannut/statamic-weather-addon "^2.0"`
2. [Create an account](https://www.visualcrossing.com/sign-up) at Visual Crossing.
3. After signing in go to your account, you'll find a `Key`
4. Go to your Statamic Control Panel and look for the Weather entry in the sidebar.
5. Fill out the settings-form with your api-key and create a location to fetch the forecast for.
6. Hit the fetch forecast button.
7. Or Go to the Command line and perform the first initial fetch of your specific data: `php artisan weather:fetchForecast`

Renewing the forecast
---------------------

[](#renewing-the-forecast)

Nothing is as changeable as the weather. Therefore this addon adds [a hourly call](https://github.com/vannut/statamic-weather-addon/blob/master/src/ServiceProvider.php#L25) to the scheduler of Statamic/Laravel. All you have to do is make sure the scheduler is run, by means of a cron-job. Take a look at [Laravels documentation](https://laravel.com/docs/10.x/scheduling#running-the-scheduler) on this!

Usage
-----

[](#usage)

This addon does not provide any styling, it *just* caches the json response and passes the raw data through to the two tags.

You can find every field in the api-response on [the api-docs of Visual Crossing](https://www.visualcrossing.com/resources/documentation/weather-api/timeline-weather-api/).

Next to the data provided by the API, the addon adds a couple of nice additional fields:

```
{{ icon_fa }}           A fontawesome icon derived fron weather.0.icon
{{ wind_compass }}   Converted wind direction to N/S/SSW etc
{{ wind_bft }}       Wind speed in Beaufort
{{ uvi_color }}      Color representation of  the UV Index
{{ uvi_percentage }} Percentage where UVI 10 = 100%;
{{ fetched_at }}     Unix Epoch timestamp of the datetime when fetched from API

```

You'll have two tags to your disposal: `{{ forecast }}` and `{{ current_weather }}`

Simple 7 day forecast
---------------------

[](#simple-7-day-forecast)

With the `{{ forecast }}` tag you will be able to display a card per day with the forecast. It's a loop of different days in the forecast. Typically 7 or 15 days depending on the location.

Make sure you specify from which location you want the forecast:

```

    {{ forecast :locale="site" location-identifier="xyz123" }}

                {{ datetimeEpoch | iso_format("dddd") }}
                {{ datetimeEpoch | iso_format("D MMM Y") }}

                    {{ tempmax | round }}&deg;C

                    &nbsp;&nbsp; /
                    {{ tempmin | round }}&deg;C

                    {{ wind_compass }} {{ wind_bft  }}Bft

    {{/forecast }}

```

Current weather
---------------

[](#current-weather)

Want to display the current weather of your location? Use the `{{ current_weather }}` tag. As this is a json-collection you can get its data as following:

```
    {{ current_weather :locale="site" location-identifier="xyz123" }}

                Current temperature: {{  temp }}&deg;C

                Feels like: {{ feels_like }}&deg;C

    {{ /current_weather }}
```

---

[![Compatible with Statamic v5](https://camo.githubusercontent.com/820b9babc7e6fe23a1586cfd06bc39fcccda3204a9619ec59807aa360c5ac1b3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53746174616d69632d352e302b2d4646323639453f7374796c653d666f722d7468652d6261646765)](https://statamic.com)[![Addon on Packagist](https://camo.githubusercontent.com/323477896c98c01b3a41812dfa3a38b73f219937b73715def2c3cd22938e38cb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76616e6e75742f73746174616d69632d776561746865722d6164646f6e3f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/vannut/statamic-weather-addon/stats)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Every ~158 days

Recently: every ~45 days

Total

10

Last Release

405d ago

Major Versions

v0.5 → v1.0.02021-12-11

v1.0.1 → v2.0-beta.12024-10-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/fdd8e743224ae5b796258767eef6491e845e828a1a98384dbb8ee4a7c898bc10?d=identicon)[vannut](/maintainers/vannut)

---

Top Contributors

[![vannut](https://avatars.githubusercontent.com/u/7419859?v=4)](https://github.com/vannut "vannut (35 commits)")

---

Tags

openweathermapopenweathermap-apistatamicstatamic-addonstatamic-v3

### Embed Badge

![Health badge](/badges/vannut-statamic-weather-addon/health.svg)

```
[![Health](https://phpackages.com/badges/vannut-statamic-weather-addon/health.svg)](https://phpackages.com/packages/vannut-statamic-weather-addon)
```

###  Alternatives

[anlutro/l4-settings

Persistent settings in Laravel.

9312.4M19](/packages/anlutro-l4-settings)[godruoyi/php-snowflake

An ID Generator for PHP based on Snowflake Algorithm (Twitter announced).

8582.3M61](/packages/godruoyi-php-snowflake)[tuupola/ksuid

K-Sortable Globally Unique IDs

1081.2M4](/packages/tuupola-ksuid)[mcordingley/linearalgebra

Matrix math for PHP.

85146.3k1](/packages/mcordingley-linearalgebra)[hyva-themes/magento2-wysiwyg-svg

Allow SVGs and all tailwind classes in CMS block and page content.

17130.8k](/packages/hyva-themes-magento2-wysiwyg-svg)[syrian-open-source/laravel-youtube-iframe-generator

Laravel package allows you to generate an iframe tag with a video player depending on a youtube URL.

184.2k](/packages/syrian-open-source-laravel-youtube-iframe-generator)

PHPackages © 2026

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