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.
ktm avatar
weatherTest
@ktm
Script
An interactive, runnable TypeScript val by ktm
webup avatar
schemasWeather
@webup
Script
An interactive, runnable TypeScript val by webup
ralfw avatar
weather_ask_for_location
@ralfw
Script
An interactive, runnable TypeScript val by ralfw
ellenchisa avatar
weatherGPT
@ellenchisa
Cron
Forked from stevekrouse/weatherGPT
cjpais avatar
getWeatherForecast
@cjpais
HTTP
Forked from jamiedubs/weatherInCity
janpaul123 avatar
valle_tmp_328293536271528244631103783931838
@janpaul123
HTTP
// This val retrieves the weather in Brooklyn, NY using the MetaWeather API
janpaul123 avatar
valle_tmp_0112503842756113147839156482696499
@janpaul123
HTTP
// This val retrieves the weather in Brooklyn, NY using the MetaWeather API
stevekrouse avatar
example_gsmaverick_weather
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
emilycoe avatar
Which_Jacket
@emilycoe
Cron
An interactive, runnable TypeScript val by emilycoe
jamiedubs avatar
weatherInCity
@jamiedubs
HTTP
Forked from fab1an/glif_weather
jamiedubs avatar
fetchWeatherPrediction
@jamiedubs
HTTP
An interactive, runnable TypeScript val by jamiedubs
seflless avatar
weatherGPT
@seflless
HTTP
Forked from stevekrouse/weatherGPT
varun_balani avatar
weatherGPT
@varun_balani
Cron
Forked from stevekrouse/weatherGPT
jesi_rgb avatar
email_weather
@jesi_rgb
Cron
* This val will create a daily weather email service. * It uses the OpenWeatherMap API to fetch weather data and the Val Town email API to send emails. * The val will be triggered daily using a cron job.
janpaul123 avatar
valle_tmp_53901278199117542092711693057927
@janpaul123
HTTP
// This val fetches weather data from an open API
ljus avatar
weatherGPT
@ljus
HTTP
WeatherGPT Using OpenAI chat completion (GPT3) with function calls to SMHI api The API is instructed to use the current time in Europe/Stockholm timezone. If the message can not be handled with the weather API endpoint, the Open AI assistant will reply instead. Relevant API documentation SMHI, forecast documentation OPEN AI, GPT function calling documentation How to use this endpoint GET: RUN_ENDPOINT?args=["A weather question"] Response { answer?: string // If the message could not be answered with the SMHI API error?:string // data?: unknown // the actual data returned from SMHI, if the API is called summary?: string // a summary of the data, by GPT API } Examples How is the weather in the Capital of Sweden tomorrow. How is the weather at Liseberg on Friday. Packages used zod: for describing the SMHI API response and function API input zod-to-json-schema: Transform the zod schema to json schema (readable by the GPT API) gpt3-tokenizer: count the number of tokens date-fns-tz: To handle dates in a specific timezone (Europe/Stockholm)