All extensions

WeatherAPI Extension

Fetch live weather and astronomy data for any city into Streamer.bot, powered by WeatherAPI

WeatherWeatherAPI v1.0.0 Streamer.bot 1.0.4+
- downloads No ratings yet

What it does

Connects to WeatherAPI and fetches current weather and astronomy data for any default city you configure. A timed action fetches both every 30 minutes automatically, and two custom trigger events fire any time that data comes in - whether from the timer or from calling the fetch methods yourself.

You can also call the two fetch methods directly from your own actions, optionally passing a %cityOverride% argument to fetch for a different city for that call only, without changing your configured default. All results will come in both the custom triggers, and as arguments from the fetch.

Importing into Streamer.bot

  1. Download the extension file above.
  2. In Streamer.bot, open the Import tab.
  3. Choose drag the downloaded file or paste its contents into the Import String area.
  4. Click Import - this adds the WeatherAPI actions and triggers to your Streamer.bot.

First-time setup

  1. Sign up for a free API key at weatherapi.
  2. After importing, find the [Weather] [0] Setup action and run its Test Trigger - a prompt will appear for your API key and a default city name (e.g. London).
  3. Once saved, the timed action will fetch weather and astronomy data for that city every 30 minutes, firing the triggers below each time.

You only need to do this once unless your API key or default city changes.

How to use

Create a new action and search for triggers under Custom -> WeatherAPI for Weather Update and Astronomy Update. These fire on the 30-minute timer for your default city, and also whenever you manually call the extension’s fetch methods from your own actions - pass a %cityOverride% argument to fetch a different city for that one call.

This can be handy if you want to set quick globals for the current moon phase or weather status text.

Triggers

Weather Update

Fires whenever current weather data is fetched - via the 30-minute timer, or a manual call to the weather fetch method.

ArgumentTypeDescription
%location.name%stringCity name
%location.region%stringRegion/state/province
%location.country%stringCountry
%location.lat%floatLatitude
%location.lon%floatLongitude
%location.tz_id%stringIANA timezone id
%location.localtime_epoch%intCity’s local time (unix epoch)
%location.localtime%string/datetimeCity’s local time
%current.last_updated_epoch%intWhen this weather data was last updated (unix epoch)
%current.last_updated%string/datetimeWhen this weather data was last updated
%current.temp_c% / %current.temp_f%floatCurrent temperature
%current.is_day%bool (0/1)Whether it’s currently daytime at the location
%current.condition.text%stringCondition summary (e.g. Sunny)
%current.condition.icon%stringURL to a condition icon
%current.condition.code%intWeatherAPI condition code
%current.wind_mph% / %current.wind_kph%floatWind speed
%current.wind_degree%intWind direction, in degrees
%current.wind_dir%stringWind direction, compass notation (e.g. WNW)
%current.pressure_mb% / %current.pressure_in%floatAtmospheric pressure
%current.precip_mm% / %current.precip_in%floatPrecipitation
%current.humidity%intHumidity, percent
%current.cloud%intCloud cover, percent
%current.feelslike_c% / %current.feelslike_f%float”Feels like” temperature
%current.windchill_c% / %current.windchill_f%floatWind chill
%current.heatindex_c% / %current.heatindex_f%floatHeat index
%current.dewpoint_c% / %current.dewpoint_f%floatDew point
%current.vis_km% / %current.vis_miles%floatVisibility
%current.uv%floatUV index
%current.gust_mph% / %current.gust_kph%floatWind gust speed
%current.will_it_rain%bool (0/1)Whether rain is expected
%current.chance_of_rain%intChance of rain, percent
%current.will_it_snow%bool (0/1)Whether snow is expected
%current.chance_of_snow%intChance of snow, percent
%weatherApiRawJson%string (JSON)The full raw response from WeatherAPI, location + current weather
Astronomy Update

Fires whenever astronomy data is fetched - via the 30-minute timer, or a manual call to the astronomy fetch method.

ArgumentTypeDescription
%location.name%stringCity name
%location.region%stringRegion/state/province
%location.country%stringCountry
%location.lat%floatLatitude
%location.lon%floatLongitude
%location.tz_id%stringIANA timezone id
%location.localtime_epoch%intCity’s local time (unix epoch)
%location.localtime%string/datetimeCity’s local time
%astronomy.astro.sunrise%stringSunrise time
%astronomy.astro.sunset%stringSunset time
%astronomy.astro.moonrise%stringMoonrise time
%astronomy.astro.moonset%stringMoonset time
%astronomy.astro.moon_phase%stringMoon phase (e.g. Waxing Crescent)
%astronomy.astro.moon_illumination%intMoon illumination, percent
%astronomy.astro.is_moon_up%bool (0/1)Whether the moon is currently up
%astronomy.astro.is_sun_up%bool (0/1)Whether the sun is currently up
%weatherApiRawJson%string (JSON)The full raw response from WeatherAPI, location + astronomy

Troubleshooting

  • No triggers firing - double check your API key is valid and your default city name is spelled correctly in the Setup action.
  • Fetch method calls with %cityOverride% don’t seem to change the city - make sure the argument name matches exactly (cityOverride) and is set before the sub-action that calls the fetch method. It’s also possible the city may not return valid data.
  • Need help? Reach out on Discord or Twitter.

Reviews

Loading ratings…

Loading reviews…

Checking your download history…

Sign in to leave a review.

Download this extension to leave a review.

Leave a review

Share your experience with this extension.

You
0 / 500