Back to APIs list

Weather API examples & templates

Use these vals as a playground to view and fork Weather API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
iamseeley avatar
LandingPage
@iamseeley
script
@jsxImportSource https://esm.sh/hono@latest/jsx
habosa avatar
umbrellaReminder
@habosa
interval
☔️ Umbrella reminder if there's rain today Setup Fork this val 👉 https://val.town/v/stevekrouse.umbrellaReminder/fork Customize the location (line 8). You can supply any free-form description of a location. ⚠️ Only works for US-based locations (where weather.gov covers). How it works Geocodes an free-form description of a location to latitude and longitude – @stevekrouse.nominatimSearch Converts a latitude and longitude to weather.gov grid – @stevekrouse.weatherGovGrid Gets the hourly forecast for that grid Filters the forecast for periods that are today and >30% chance of rain If there are any, it formats them appropriately, and sends me an email
stevekrouse avatar
weatherGPT
@stevekrouse
interval
flafi87 avatar
periodical_weather_telegram
@flafi87
interval
An interactive, runnable TypeScript val by flafi87
stevekrouse avatar
getWeather
@stevekrouse
script
Get Weather Simple function to get weather data from the free wttr.in service. import { getWeather } from "https://esm.town/v/stevekrouse/getWeather"; let weather = await getWeather("Brooklyn, NY"); console.log(weather.current_condition[0].FeelsLikeF)
stevekrouse avatar
harlequinCobra
@stevekrouse
script
An interactive, runnable TypeScript val by stevekrouse
michaelmang avatar
umbrellaReminder
@michaelmang
interval
☔️ Umbrella reminder if there's rain today Setup Fork this val 👉 https://val.town/v/stevekrouse.umbrellaReminder/fork Customize the location (line 8). You can supply any free-form description of a location. ⚠️ Only works for US-based locations (where weather.gov covers). How it works Geocodes an free-form description of a location to latitude and longitude – @stevekrouse.nominatimSearch Converts a latitude and longitude to weather.gov grid – @stevekrouse.weatherGovGrid Gets the hourly forecast for that grid Filters the forecast for periods that are today and >30% chance of rain If there are any, it formats them appropriately, and sends me an email
emilycoe avatar
Which_Jacket
@emilycoe
interval
An interactive, runnable TypeScript val by emilycoe
flafi87 avatar
weather_forecast_in_the_morning
@flafi87
interval
An interactive, runnable TypeScript val by flafi87
ayush37 avatar
umbrellaReminder
@ayush37
interval
☔️ Umbrella reminder if there's rain today Setup Fork this val 👉 https://val.town/v/stevekrouse.umbrellaReminder/fork Customize the location (line 8). You can supply any free-form description of a location. ⚠️ Only works for US-based locations (where weather.gov covers). How it works Geocodes an free-form description of a location to latitude and longitude – @stevekrouse.nominatimSearch Converts a latitude and longitude to weather.gov grid – @stevekrouse.weatherGovGrid Gets the hourly forecast for that grid Filters the forecast for periods that are today and >30% chance of rain If there are any, it formats them appropriately, and sends me an email
astrat1 avatar
umbrellaReminder
@astrat1
interval
☔️ Umbrella reminder if there's rain today Setup Fork this val 👉 https://val.town/v/stevekrouse.umbrellaReminder/fork Customize the location (line 8). You can supply any free-form description of a location. ⚠️ Only works for US-based locations (where weather.gov covers). How it works Geocodes an free-form description of a location to latitude and longitude – @stevekrouse.nominatimSearch Converts a latitude and longitude to weather.gov grid – @stevekrouse.weatherGovGrid Gets the hourly forecast for that grid Filters the forecast for periods that are today and >30% chance of rain If there are any, it formats them appropriately, and sends me an email
stevekrouse avatar
exponentialBackoffMiddleware
@stevekrouse
script
Exponential backoff middleware If your server returns a 5xx error, it will wait 1, 2, 4, 8, 16, 32, 64, 128... seconds before retrying Usage import { exponentialBackoffMiddleware } from "https://esm.town/v/stevekrouse/exponentialBackoffMiddleware" export default exponentialBackoffMiddleware(() => { /* your normal http handler * / }) Example usage: https://www.val.town/v/stevekrouse/BIGweather?v=164#L114
stevekrouse avatar
apricotTurkey
@stevekrouse
script
An interactive, runnable TypeScript val by stevekrouse
tjvantoll avatar
umbrellaReminder
@tjvantoll
interval
☔️ Umbrella reminder if there's rain today Setup Fork this val 👉 https://val.town/v/stevekrouse.umbrellaReminder/fork Customize the location (line 8). You can supply any free-form description of a location. ⚠️ Only works for US-based locations (where weather.gov covers). How it works Geocodes an free-form description of a location to latitude and longitude – @stevekrouse.nominatimSearch Converts a latitude and longitude to weather.gov grid – @stevekrouse.weatherGovGrid Gets the hourly forecast for that grid Filters the forecast for periods that are today and >30% chance of rain If there are any, it formats them appropriately, and sends me an email
jdan avatar
weatherBot
@jdan
script
An interactive, runnable TypeScript val by jdan